From 169c160509733d312ad8097a697b2439c982141f Mon Sep 17 00:00:00 2001 From: Samuel Mutel <12967891+smutel@users.noreply.github.com> Date: Tue, 17 May 2022 12:07:43 +0200 Subject: [PATCH] feat: Update provider to work with Netbox 3.1 --- .github/workflows/master.yml | 4 +- .github/workflows/pr.yml | 6 +- .github/workflows/release.yml | 4 +- README.md | 2 +- go.mod | 31 +- go.sum | 414 +- .../github.com/PuerkitoBio/purell/.gitignore | 5 - .../github.com/PuerkitoBio/purell/.travis.yml | 12 - vendor/github.com/PuerkitoBio/purell/LICENSE | 12 - .../github.com/PuerkitoBio/purell/README.md | 188 - .../github.com/PuerkitoBio/purell/purell.go | 379 -- .../github.com/PuerkitoBio/urlesc/.travis.yml | 15 - .../github.com/PuerkitoBio/urlesc/README.md | 16 - .../github.com/PuerkitoBio/urlesc/urlesc.go | 180 - vendor/github.com/go-openapi/analysis/go.mod | 1 + vendor/github.com/go-openapi/analysis/go.sum | 2 + .../go-openapi/jsonreference/go.mod | 3 - .../go-openapi/jsonreference/go.sum | 12 - .../jsonreference/internal/normalize_url.go | 63 + .../go-openapi/jsonreference/reference.go | 6 +- .../go-openapi/runtime/client/auth_info.go | 4 +- .../go-openapi/runtime/client/runtime.go | 39 +- .../go-openapi/runtime/client_response.go | 18 +- .../go-openapi/runtime/constants.go | 2 + .../runtime/middleware/swaggerui.go | 2 +- .../runtime/security/authenticator.go | 4 +- vendor/github.com/go-openapi/spec/go.mod | 3 +- vendor/github.com/go-openapi/spec/go.sum | 22 +- .../golang/protobuf/jsonpb/decode.go | 524 +++ .../golang/protobuf/jsonpb/encode.go | 559 +++ .../github.com/golang/protobuf/jsonpb/json.go | 69 + .../github.com/google/go-cmp/cmp/compare.go | 2 + .../google/go-cmp/cmp/report_compare.go | 5 +- .../google/go-cmp/cmp/report_reflect.go | 10 +- .../github.com/hashicorp/go-plugin/README.md | 5 +- .../github.com/hashicorp/go-plugin/client.go | 15 +- vendor/github.com/hashicorp/go-plugin/go.mod | 13 +- vendor/github.com/hashicorp/go-plugin/go.sum | 5 - .../hashicorp/go-plugin/process_posix.go | 1 + .../hashicorp/go-plugin/rpc_server.go | 6 +- .../github.com/hashicorp/go-plugin/server.go | 6 +- vendor/github.com/hashicorp/go-uuid/LICENSE | 2 + .../github.com/hashicorp/hcl/v2/CHANGELOG.md | 18 +- .../hashicorp/hcl/v2/hclsyntax/expression.go | 149 +- .../hashicorp/hcl/v2/hclsyntax/parser.go | 2 - .../hashicorp/hcl/v2/hclsyntax/token.go | 26 +- .../github.com/hashicorp/logutils/.gitignore | 22 + vendor/github.com/hashicorp/logutils/LICENSE | 354 ++ .../github.com/hashicorp/logutils/README.md | 36 + vendor/github.com/hashicorp/logutils/go.mod | 1 + vendor/github.com/hashicorp/logutils/level.go | 81 + .../internal/logging/context.go | 82 + .../internal/logging/doc.go | 2 + .../internal/logging/environment_variables.go | 22 + .../internal/logging/keys.go | 32 + .../internal/logging/protocol.go | 22 + .../internal/logging/protocol_data.go | 108 + .../internal/logging/provider.go | 19 + .../tfprotov5/diagnostic.go | 2 +- .../tfprotov5/dynamic_value.go | 10 +- .../tfprotov5/dynamic_value_json.go | 480 -- .../tfprotov5/dynamic_value_msgpack.go | 327 -- .../internal/fromproto/attribute_path.go | 6 +- .../tfprotov5/internal/fromproto/schema.go | 2 +- .../tfprotov5/internal/tfplugin5/generate.sh | 16 - .../internal/tfplugin5/tfplugin5.pb.go | 9 +- .../internal/tfplugin5/tfplugin5_grpc.pb.go | 25 +- .../internal/toproto/attribute_path.go | 7 +- .../internal/toproto/dynamic_value.go | 2 +- .../terraform-plugin-go/tfprotov5/resource.go | 5 +- .../terraform-plugin-go/tfprotov5/schema.go | 106 +- .../tfprotov5/server/server.go | 358 -- .../terraform-plugin-go/tfprotov5/state.go | 4 +- .../tfprotov5/{server => tf5server}/doc.go | 2 +- .../tfprotov5/{server => tf5server}/plugin.go | 4 +- .../tfprotov5/tf5server/server.go | 856 ++++ .../tfprotov5/tftypes/attribute_path_error.go | 6 - .../tfprotov5/tftypes/list.go | 42 - .../tfprotov5/tftypes/map.go | 41 - .../tfprotov5/tftypes/object.go | 56 - .../tfprotov5/tftypes/primitive.go | 56 - .../tfprotov5/tftypes/set.go | 42 - .../tfprotov5/tftypes/tuple.go | 53 - .../tfprotov5/tftypes/value_msgpack.go | 253 - .../tfprotov6/data_source.go | 98 + .../tfprotov6/diagnostic.go | 58 + .../terraform-plugin-go/tfprotov6/doc.go | 29 + .../tfprotov6/dynamic_value.go | 87 + .../internal/fromproto/attribute_path.go | 63 + .../internal/fromproto/data_source.go | 53 + .../internal/fromproto/diagnostic.go | 42 + .../tfprotov6/internal/fromproto/provider.go | 106 + .../tfprotov6/internal/fromproto/resource.go | 208 + .../tfprotov6/internal/fromproto/schema.go | 144 + .../tfprotov6/internal/fromproto/state.go | 13 + .../internal/fromproto/string_kind.go | 10 + .../tfprotov6/internal/fromproto/types.go | 13 + .../internal/tfplugin6/tfplugin6.pb.go | 4169 +++++++++++++++++ .../internal/tfplugin6/tfplugin6.proto | 350 ++ .../internal/tfplugin6/tfplugin6_grpc.pb.go | 509 ++ .../internal/toproto/attribute_path.go | 98 + .../tfprotov6/internal/toproto/data_source.go | 61 + .../tfprotov6/internal/toproto/diagnostic.go | 50 + .../internal/toproto/dynamic_value.go | 35 + .../tfprotov6/internal/toproto/provider.go | 117 + .../tfprotov6/internal/toproto/resource.go | 214 + .../tfprotov6/internal/toproto/schema.go | 147 + .../tfprotov6/internal/toproto/state.go | 21 + .../tfprotov6/internal/toproto/string_kind.go | 18 + .../terraform-plugin-go/tfprotov6/provider.go | 181 + .../terraform-plugin-go/tfprotov6/resource.go | 451 ++ .../terraform-plugin-go/tfprotov6/schema.go | 440 ++ .../terraform-plugin-go/tfprotov6/state.go | 79 + .../tfprotov6/string_kind.go | 25 + .../tfprotov6/tf6server/doc.go | 6 + .../tfprotov6/tf6server/plugin.go | 47 + .../tfprotov6/tf6server/server.go | 854 ++++ .../{tfprotov5 => }/tftypes/attribute_path.go | 222 +- .../tftypes/attribute_path_error.go | 43 + .../terraform-plugin-go/tftypes/diff.go | 293 ++ .../{tfprotov5 => }/tftypes/doc.go | 0 .../terraform-plugin-go/tftypes/list.go | 119 + .../terraform-plugin-go/tftypes/map.go | 122 + .../terraform-plugin-go/tftypes/object.go | 253 + .../terraform-plugin-go/tftypes/primitive.go | 405 ++ .../terraform-plugin-go/tftypes/set.go | 115 + .../terraform-plugin-go/tftypes/tuple.go | 153 + .../{tfprotov5 => }/tftypes/type.go | 76 +- .../{tfprotov5 => }/tftypes/unknown_value.go | 0 .../{tfprotov5 => }/tftypes/value.go | 549 ++- .../terraform-plugin-go/tftypes/value_json.go | 483 ++ .../tftypes/value_msgpack.go | 571 +++ .../terraform-plugin-go/tftypes/walk.go | 197 + .../hashicorp/terraform-plugin-log/LICENSE | 354 ++ .../internal/hclogutils/args.go | 36 + .../internal/hclogutils/logger_options.go | 29 + .../internal/logging/log.go | 73 + .../internal/logging/options.go | 116 + .../internal/logging/provider.go | 74 + .../internal/logging/sdk.go | 74 + .../internal/logging/sink.go | 51 + .../terraform-plugin-log/tflog/doc.go | 13 + .../terraform-plugin-log/tflog/options.go | 60 + .../terraform-plugin-log/tflog/provider.go | 108 + .../terraform-plugin-log/tflog/subsystem.go | 185 + .../terraform-plugin-log/tfsdklog/doc.go | 10 + .../terraform-plugin-log/tfsdklog/options.go | 78 + .../terraform-plugin-log/tfsdklog/sdk.go | 189 + .../terraform-plugin-log/tfsdklog/sink.go | 152 + .../tfsdklog/subsystem.go | 185 + .../v2/helper/logging/logging.go | 138 + .../v2/helper/logging/transport.go | 70 + .../v2/helper/schema/field_reader.go | 2 +- .../v2/helper/schema/field_reader_config.go | 6 +- .../v2/helper/schema/field_reader_diff.go | 4 +- .../v2/helper/schema/field_reader_map.go | 9 +- .../v2/helper/schema/field_writer_map.go | 27 +- .../v2/helper/schema/grpc_provider.go | 297 +- .../v2/helper/schema/provider.go | 47 +- .../v2/helper/schema/resource.go | 652 ++- .../v2/helper/schema/resource_data.go | 66 +- .../v2/helper/schema/resource_diff.go | 109 +- .../v2/helper/schema/resource_timeout.go | 8 +- .../v2/helper/schema/schema.go | 448 +- .../v2/helper/schema/set.go | 39 +- .../v2/helper/schema/shims.go | 10 +- .../v2/helper/structure/suppress_json_diff.go | 6 +- .../v2/helper/validation/map.go | 12 +- .../v2/helper/validation/meta.go | 17 +- .../v2/helper/validation/strings.go | 4 +- .../v2/helper/validation/testing.go | 30 - .../v2/helper/validation/time.go | 4 +- .../v2/internal/addrs/module_instance.go | 2 - .../v2/internal/configs/hcl2shim/flatmap.go | 6 +- .../configs/hcl2shim/single_attr_body.go | 85 - .../v2/internal/logging/context.go | 75 + .../internal/logging/environment_variables.go | 24 + .../v2/internal/logging/helper_resource.go | 32 + .../v2/internal/logging/helper_schema.go | 32 + .../v2/internal/logging/keys.go | 45 + .../v2/internal/plugin/convert/diagnostics.go | 73 +- .../v2/internal/plugin/convert/schema.go | 41 +- .../terraform-plugin-sdk/v2/meta/meta.go | 2 +- .../terraform-plugin-sdk/v2/plugin/debug.go | 74 +- .../terraform-plugin-sdk/v2/plugin/serve.go | 175 +- .../terraform-plugin-sdk/v2/terraform/diff.go | 6 +- .../v2/terraform/resource.go | 4 +- .../v2/terraform/state.go | 42 +- .../v2/terraform/state_filter.go | 15 +- .../terraform-registry-address/.go-version | 1 + .../terraform-registry-address/LICENSE | 354 ++ .../terraform-registry-address/README.md | 111 + .../terraform-registry-address/errors.go | 14 + .../terraform-registry-address/go.mod | 9 + .../terraform-registry-address/go.sum | 37 + .../terraform-registry-address/module.go | 241 + .../module_package.go | 87 + .../terraform-registry-address/provider.go | 482 ++ .../hashicorp/terraform-svchost/LICENSE | 353 ++ .../hashicorp/terraform-svchost/go.mod | 12 + .../hashicorp/terraform-svchost/go.sum | 36 + .../hashicorp/terraform-svchost/label_iter.go | 69 + .../hashicorp/terraform-svchost/svchost.go | 207 + .../mitchellh/mapstructure/CHANGELOG.md | 13 + .../mitchellh/mapstructure/decode_hooks.go | 22 + .../mitchellh/mapstructure/mapstructure.go | 83 +- ...ts_circuit_terminations_list_parameters.go | 341 ++ .../circuits_circuit_types_list_parameters.go | 403 ++ .../circuits_circuits_list_parameters.go | 465 ++ ...cuits_provider_networks_list_parameters.go | 341 ++ .../circuits_providers_list_parameters.go | 124 + .../dcim/dcim_cables_list_parameters.go | 186 + .../dcim/dcim_device_roles_list_parameters.go | 403 ++ .../dcim/dcim_device_types_list_parameters.go | 62 + .../dcim/dcim_devices_list_parameters.go | 248 + .../dcim/dcim_interfaces_list_parameters.go | 1054 +++++ .../dcim/dcim_locations_list_parameters.go | 434 ++ .../dcim_manufacturers_list_parameters.go | 186 + .../dcim/dcim_platforms_list_parameters.go | 62 + .../dcim/dcim_power_panels_list_parameters.go | 124 + .../dcim_rack_reservations_list_parameters.go | 341 ++ .../dcim/dcim_rack_roles_list_parameters.go | 403 ++ .../client/dcim/dcim_racks_list_parameters.go | 124 + .../dcim/dcim_regions_list_parameters.go | 186 + .../dcim/dcim_site_groups_list_parameters.go | 186 + .../client/dcim/dcim_sites_list_parameters.go | 527 +++ .../extras_config_contexts_list_parameters.go | 62 + .../extras_custom_fields_list_parameters.go | 341 ++ ...extras_export_templates_list_parameters.go | 341 ++ .../extras/extras_tags_list_parameters.go | 341 ++ .../ipam/ipam_aggregates_list_parameters.go | 341 ++ .../ipam/ipam_asns_bulk_delete_parameters.go | 141 + .../ipam/ipam_asns_bulk_delete_responses.go | 68 + ...pam_asns_bulk_partial_update_parameters.go | 163 + ...ipam_asns_bulk_partial_update_responses.go | 82 + .../ipam/ipam_asns_bulk_update_parameters.go | 163 + .../ipam/ipam_asns_bulk_update_responses.go | 82 + .../ipam/ipam_asns_create_parameters.go | 163 + .../client/ipam/ipam_asns_create_responses.go | 82 + .../ipam/ipam_asns_delete_parameters.go | 165 + .../client/ipam/ipam_asns_delete_responses.go | 68 + .../client/ipam/ipam_asns_list_parameters.go | 1637 +++++++ .../client/ipam/ipam_asns_list_responses.go | 247 + .../ipam_asns_partial_update_parameters.go | 186 + .../ipam_asns_partial_update_responses.go | 82 + .../client/ipam/ipam_asns_read_parameters.go | 165 + .../client/ipam/ipam_asns_read_responses.go | 82 + .../ipam/ipam_asns_update_parameters.go | 186 + .../client/ipam/ipam_asns_update_responses.go | 82 + .../netbox/client/ipam/ipam_client.go | 1543 +++++- ...roup_assignments_bulk_delete_parameters.go | 141 + ...group_assignments_bulk_delete_responses.go | 68 + ...ignments_bulk_partial_update_parameters.go | 163 + ...signments_bulk_partial_update_responses.go | 82 + ...roup_assignments_bulk_update_parameters.go | 163 + ...group_assignments_bulk_update_responses.go | 82 + ...hrp_group_assignments_create_parameters.go | 163 + ...fhrp_group_assignments_create_responses.go | 82 + ...hrp_group_assignments_delete_parameters.go | 165 + ...fhrp_group_assignments_delete_responses.go | 68 + ..._fhrp_group_assignments_list_parameters.go | 1079 +++++ ...m_fhrp_group_assignments_list_responses.go | 247 + ...p_assignments_partial_update_parameters.go | 186 + ...up_assignments_partial_update_responses.go | 82 + ..._fhrp_group_assignments_read_parameters.go | 165 + ...m_fhrp_group_assignments_read_responses.go | 82 + ...hrp_group_assignments_update_parameters.go | 186 + ...fhrp_group_assignments_update_responses.go | 82 + ...ipam_fhrp_groups_bulk_delete_parameters.go | 141 + .../ipam_fhrp_groups_bulk_delete_responses.go | 68 + ...p_groups_bulk_partial_update_parameters.go | 163 + ...rp_groups_bulk_partial_update_responses.go | 82 + ...ipam_fhrp_groups_bulk_update_parameters.go | 163 + .../ipam_fhrp_groups_bulk_update_responses.go | 82 + .../ipam_fhrp_groups_create_parameters.go | 163 + .../ipam/ipam_fhrp_groups_create_responses.go | 82 + .../ipam_fhrp_groups_delete_parameters.go | 165 + .../ipam/ipam_fhrp_groups_delete_responses.go | 68 + .../ipam/ipam_fhrp_groups_list_parameters.go | 1358 ++++++ .../ipam/ipam_fhrp_groups_list_responses.go | 247 + ...m_fhrp_groups_partial_update_parameters.go | 186 + ...am_fhrp_groups_partial_update_responses.go | 82 + .../ipam/ipam_fhrp_groups_read_parameters.go | 165 + .../ipam/ipam_fhrp_groups_read_responses.go | 82 + .../ipam_fhrp_groups_update_parameters.go | 186 + .../ipam/ipam_fhrp_groups_update_responses.go | 82 + ..._ranges_available_ips_create_parameters.go | 8 +- ...p_ranges_available_ips_create_responses.go | 4 +- ...p_ranges_available_ips_list_parameters.go} | 74 +- ...ip_ranges_available_ips_list_responses.go} | 28 +- .../ipam/ipam_ip_ranges_list_parameters.go | 341 ++ ...refixes_available_ips_create_parameters.go | 8 +- ...prefixes_available_ips_create_responses.go | 4 +- ...prefixes_available_ips_list_parameters.go} | 74 +- ..._prefixes_available_ips_list_responses.go} | 28 +- ...xes_available_prefixes_create_responses.go | 8 +- ...xes_available_prefixes_list_parameters.go} | 72 +- ...ixes_available_prefixes_list_responses.go} | 28 +- .../ipam/ipam_prefixes_list_parameters.go | 496 ++ .../client/ipam/ipam_rirs_list_parameters.go | 62 + .../client/ipam/ipam_roles_list_parameters.go | 403 ++ .../ipam_route_targets_list_parameters.go | 341 ++ .../ipam/ipam_services_list_parameters.go | 341 ++ .../ipam/ipam_vlan_groups_list_parameters.go | 62 + .../client/ipam/ipam_vlans_list_parameters.go | 341 ++ .../client/ipam/ipam_vrfs_list_parameters.go | 341 ++ .../netbox/client/net_box_api_client.go | 5 + .../netbox/client/tenancy/tenancy_client.go | 1476 ++++++ ...tact_assignments_bulk_delete_parameters.go | 141 + ...ntact_assignments_bulk_delete_responses.go | 68 + ...ignments_bulk_partial_update_parameters.go | 163 + ...signments_bulk_partial_update_responses.go | 82 + ...tact_assignments_bulk_update_parameters.go | 163 + ...ntact_assignments_bulk_update_responses.go | 82 + ...y_contact_assignments_create_parameters.go | 163 + ...cy_contact_assignments_create_responses.go | 82 + ...y_contact_assignments_delete_parameters.go | 165 + ...cy_contact_assignments_delete_responses.go | 68 + ...ncy_contact_assignments_list_parameters.go | 1141 +++++ ...ancy_contact_assignments_list_responses.go | 247 + ...t_assignments_partial_update_parameters.go | 186 + ...ct_assignments_partial_update_responses.go | 82 + ...ncy_contact_assignments_read_parameters.go | 165 + ...ancy_contact_assignments_read_responses.go | 82 + ...y_contact_assignments_update_parameters.go | 186 + ...cy_contact_assignments_update_responses.go | 82 + ...y_contact_groups_bulk_delete_parameters.go | 141 + ...cy_contact_groups_bulk_delete_responses.go | 68 + ...t_groups_bulk_partial_update_parameters.go | 163 + ...ct_groups_bulk_partial_update_responses.go | 82 + ...y_contact_groups_bulk_update_parameters.go | 163 + ...cy_contact_groups_bulk_update_responses.go | 82 + ...enancy_contact_groups_create_parameters.go | 163 + ...tenancy_contact_groups_create_responses.go | 82 + ...enancy_contact_groups_delete_parameters.go | 165 + ...tenancy_contact_groups_delete_responses.go | 68 + .../tenancy_contact_groups_list_parameters.go | 1823 +++++++ .../tenancy_contact_groups_list_responses.go | 247 + ...ontact_groups_partial_update_parameters.go | 186 + ...contact_groups_partial_update_responses.go | 82 + .../tenancy_contact_groups_read_parameters.go | 165 + .../tenancy_contact_groups_read_responses.go | 82 + ...enancy_contact_groups_update_parameters.go | 186 + ...tenancy_contact_groups_update_responses.go | 82 + ...cy_contact_roles_bulk_delete_parameters.go | 141 + ...ncy_contact_roles_bulk_delete_responses.go | 68 + ...ct_roles_bulk_partial_update_parameters.go | 163 + ...act_roles_bulk_partial_update_responses.go | 82 + ...cy_contact_roles_bulk_update_parameters.go | 163 + ...ncy_contact_roles_bulk_update_responses.go | 82 + ...tenancy_contact_roles_create_parameters.go | 163 + .../tenancy_contact_roles_create_responses.go | 82 + ...tenancy_contact_roles_delete_parameters.go | 165 + .../tenancy_contact_roles_delete_responses.go | 68 + .../tenancy_contact_roles_list_parameters.go | 1699 +++++++ .../tenancy_contact_roles_list_responses.go | 247 + ...contact_roles_partial_update_parameters.go | 186 + ..._contact_roles_partial_update_responses.go | 82 + .../tenancy_contact_roles_read_parameters.go | 165 + .../tenancy_contact_roles_read_responses.go | 82 + ...tenancy_contact_roles_update_parameters.go | 186 + .../tenancy_contact_roles_update_responses.go | 82 + ...tenancy_contacts_bulk_delete_parameters.go | 141 + .../tenancy_contacts_bulk_delete_responses.go | 68 + ...contacts_bulk_partial_update_parameters.go | 163 + ..._contacts_bulk_partial_update_responses.go | 82 + ...tenancy_contacts_bulk_update_parameters.go | 163 + .../tenancy_contacts_bulk_update_responses.go | 82 + .../tenancy_contacts_create_parameters.go | 163 + .../tenancy_contacts_create_responses.go | 82 + .../tenancy_contacts_delete_parameters.go | 165 + .../tenancy_contacts_delete_responses.go | 68 + .../tenancy_contacts_list_parameters.go | 2505 ++++++++++ .../tenancy_contacts_list_responses.go | 247 + ...ancy_contacts_partial_update_parameters.go | 186 + ...nancy_contacts_partial_update_responses.go | 82 + .../tenancy_contacts_read_parameters.go | 165 + .../tenancy_contacts_read_responses.go | 82 + .../tenancy_contacts_update_parameters.go | 186 + .../tenancy_contacts_update_responses.go | 82 + .../tenancy_tenant_groups_list_parameters.go | 62 + .../tenancy_tenants_list_parameters.go | 465 ++ .../users_permissions_list_parameters.go | 341 ++ .../users/users_tokens_list_parameters.go | 341 ++ ...lization_cluster_groups_list_parameters.go | 186 + ...alization_cluster_types_list_parameters.go | 62 + ...virtualization_clusters_list_parameters.go | 124 + ...rtualization_interfaces_list_parameters.go | 403 ++ ...zation_virtual_machines_list_parameters.go | 124 + .../netbox/client/wireless/wireless_client.go | 1161 +++++ ...eless_lan_groups_bulk_delete_parameters.go | 141 + ...reless_lan_groups_bulk_delete_responses.go | 68 + ...n_groups_bulk_partial_update_parameters.go | 163 + ...an_groups_bulk_partial_update_responses.go | 82 + ...eless_lan_groups_bulk_update_parameters.go | 163 + ...reless_lan_groups_bulk_update_responses.go | 82 + ...s_wireless_lan_groups_create_parameters.go | 163 + ...ss_wireless_lan_groups_create_responses.go | 82 + ...s_wireless_lan_groups_delete_parameters.go | 165 + ...ss_wireless_lan_groups_delete_responses.go | 68 + ...ess_wireless_lan_groups_list_parameters.go | 1823 +++++++ ...less_wireless_lan_groups_list_responses.go | 247 + ...ss_lan_groups_partial_update_parameters.go | 186 + ...ess_lan_groups_partial_update_responses.go | 82 + ...ess_wireless_lan_groups_read_parameters.go | 165 + ...less_wireless_lan_groups_read_responses.go | 82 + ...s_wireless_lan_groups_update_parameters.go | 186 + ...ss_wireless_lan_groups_update_responses.go | 82 + ...ss_wireless_lans_bulk_delete_parameters.go | 141 + ...ess_wireless_lans_bulk_delete_responses.go | 68 + ...ess_lans_bulk_partial_update_parameters.go | 163 + ...less_lans_bulk_partial_update_responses.go | 82 + ...ss_wireless_lans_bulk_update_parameters.go | 163 + ...ess_wireless_lans_bulk_update_responses.go | 82 + ...ireless_wireless_lans_create_parameters.go | 163 + ...wireless_wireless_lans_create_responses.go | 82 + ...ireless_wireless_lans_delete_parameters.go | 165 + ...wireless_wireless_lans_delete_responses.go | 68 + .../wireless_wireless_lans_list_parameters.go | 2009 ++++++++ .../wireless_wireless_lans_list_responses.go | 247 + ...wireless_lans_partial_update_parameters.go | 186 + ..._wireless_lans_partial_update_responses.go | 82 + .../wireless_wireless_lans_read_parameters.go | 165 + .../wireless_wireless_lans_read_responses.go | 82 + ...ireless_wireless_lans_update_parameters.go | 186 + ...wireless_wireless_lans_update_responses.go | 82 + ...s_wireless_links_bulk_delete_parameters.go | 141 + ...ss_wireless_links_bulk_delete_responses.go | 68 + ...ss_links_bulk_partial_update_parameters.go | 163 + ...ess_links_bulk_partial_update_responses.go | 82 + ...s_wireless_links_bulk_update_parameters.go | 163 + ...ss_wireless_links_bulk_update_responses.go | 82 + ...reless_wireless_links_create_parameters.go | 163 + ...ireless_wireless_links_create_responses.go | 82 + ...reless_wireless_links_delete_parameters.go | 165 + ...ireless_wireless_links_delete_responses.go | 68 + ...wireless_wireless_links_list_parameters.go | 2257 +++++++++ .../wireless_wireless_links_list_responses.go | 247 + ...ireless_links_partial_update_parameters.go | 186 + ...wireless_links_partial_update_responses.go | 82 + ...wireless_wireless_links_read_parameters.go | 165 + .../wireless_wireless_links_read_responses.go | 82 + ...reless_wireless_links_update_parameters.go | 186 + ...ireless_wireless_links_update_responses.go | 82 + .../smutel/go-netbox/netbox/models/a_s_n.go | 400 ++ .../smutel/go-netbox/netbox/models/cable.go | 114 + .../netbox/models/circuit_termination.go | 130 +- .../go-netbox/netbox/models/circuit_type.go | 58 + .../go-netbox/netbox/models/cluster_group.go | 58 + .../go-netbox/netbox/models/cluster_type.go | 58 + .../go-netbox/netbox/models/console_port.go | 68 +- .../netbox/models/console_server_port.go | 68 +- .../smutel/go-netbox/netbox/models/contact.go | 432 ++ .../netbox/models/contact_assignment.go | 563 +++ .../go-netbox/netbox/models/contact_group.go | 430 ++ .../go-netbox/netbox/models/contact_role.go | 350 ++ .../go-netbox/netbox/models/custom_field.go | 101 +- .../go-netbox/netbox/models/custom_link.go | 68 + .../smutel/go-netbox/netbox/models/device.go | 228 +- .../go-netbox/netbox/models/device_role.go | 58 + .../go-netbox/netbox/models/device_type.go | 213 + .../models/device_with_config_context.go | 228 +- .../netbox/models/export_template.go | 68 + .../go-netbox/netbox/models/f_h_r_p_group.go | 518 ++ .../netbox/models/f_h_r_p_group_assignment.go | 342 ++ .../go-netbox/netbox/models/front_port.go | 110 +- .../netbox/models/front_port_template.go | 44 +- .../netbox/models/image_attachment.go | 34 + .../go-netbox/netbox/models/interface.go | 1891 +++++++- .../netbox/models/interface_template.go | 42 +- .../go-netbox/netbox/models/ip_address.go | 4 +- .../go-netbox/netbox/models/location.go | 104 + .../go-netbox/netbox/models/manufacturer.go | 58 + .../go-netbox/netbox/models/nested_a_s_n.go | 171 + .../go-netbox/netbox/models/nested_contact.go | 169 + .../netbox/models/nested_contact_group.go | 235 + .../netbox/models/nested_contact_role.go | 201 + .../netbox/models/nested_f_h_r_p_group.go | 237 + .../netbox/models/nested_wireless_l_a_n.go | 169 + .../models/nested_wireless_l_a_n_group.go | 235 + .../netbox/models/nested_wireless_link.go | 162 + .../go-netbox/netbox/models/platform.go | 58 + .../go-netbox/netbox/models/power_feed.go | 68 +- .../go-netbox/netbox/models/power_outlet.go | 88 +- .../netbox/models/power_outlet_template.go | 20 +- .../go-netbox/netbox/models/power_panel.go | 68 + .../go-netbox/netbox/models/power_port.go | 82 +- .../netbox/models/power_port_template.go | 14 +- .../smutel/go-netbox/netbox/models/r_i_r.go | 58 + .../smutel/go-netbox/netbox/models/rack.go | 2 - .../netbox/models/rack_reservation.go | 34 + .../go-netbox/netbox/models/rack_role.go | 58 + .../go-netbox/netbox/models/rear_port.go | 110 +- .../netbox/models/rear_port_template.go | 44 +- .../smutel/go-netbox/netbox/models/region.go | 58 + .../smutel/go-netbox/netbox/models/role.go | 58 + .../smutel/go-netbox/netbox/models/service.go | 14 +- .../smutel/go-netbox/netbox/models/site.go | 62 + .../go-netbox/netbox/models/site_group.go | 58 + .../smutel/go-netbox/netbox/models/tag.go | 68 + .../go-netbox/netbox/models/tenant_group.go | 58 + .../go-netbox/netbox/models/v_l_a_n_group.go | 71 +- .../netbox/models/virtual_chassis.go | 68 + .../go-netbox/netbox/models/vm_interface.go | 63 + .../smutel/go-netbox/netbox/models/webhook.go | 73 + .../go-netbox/netbox/models/wireless_l_a_n.go | 827 ++++ .../netbox/models/wireless_l_a_n_group.go | 430 ++ .../go-netbox/netbox/models/wireless_link.go | 1019 ++++ .../go-netbox/netbox/models/writable_a_s_n.go | 357 ++ .../netbox/models/writable_available_ip.go | 125 + .../go-netbox/netbox/models/writable_cable.go | 71 + .../models/writable_circuit_termination.go | 114 +- .../netbox/models/writable_cluster.go | 32 +- .../netbox/models/writable_console_port.go | 68 +- .../models/writable_console_server_port.go | 68 +- .../netbox/models/writable_contact.go | 403 ++ .../models/writable_contact_assignment.go | 360 ++ .../netbox/models/writable_contact_group.go | 401 ++ .../netbox/models/writable_custom_field.go | 91 +- .../netbox/models/writable_device_type.go | 62 + .../writable_device_with_config_context.go | 129 +- .../writable_f_h_r_p_group_assignment.go | 311 ++ .../netbox/models/writable_front_port.go | 86 +- .../models/writable_front_port_template.go | 22 +- .../netbox/models/writable_interface.go | 851 +++- .../models/writable_interface_template.go | 23 +- .../netbox/models/writable_ip_address.go | 4 +- .../netbox/models/writable_location.go | 61 + .../netbox/models/writable_platform.go | 58 + .../netbox/models/writable_power_feed.go | 68 +- .../netbox/models/writable_power_outlet.go | 78 +- .../models/writable_power_outlet_template.go | 10 +- .../netbox/models/writable_power_panel.go | 68 + .../netbox/models/writable_power_port.go | 75 +- .../models/writable_power_port_template.go | 7 +- .../go-netbox/netbox/models/writable_rack.go | 18 +- .../models/writable_rack_reservation.go | 34 + .../netbox/models/writable_rear_port.go | 86 +- .../models/writable_rear_port_template.go | 22 +- .../netbox/models/writable_region.go | 58 + .../netbox/models/writable_service.go | 7 +- .../go-netbox/netbox/models/writable_site.go | 20 + .../netbox/models/writable_site_group.go | 58 + .../netbox/models/writable_tenant_group.go | 58 + .../netbox/models/writable_v_l_a_n.go | 16 +- .../netbox/models/writable_virtual_chassis.go | 68 + .../netbox/models/writable_vm_interface.go | 20 + .../netbox/models/writable_wireless_l_a_n.go | 454 ++ .../models/writable_wireless_l_a_n_group.go | 401 ++ .../netbox/models/writable_wireless_link.go | 528 +++ .../vmihailenco/msgpack/v4/.golangci.yml | 12 + .../vmihailenco/msgpack/v4/.travis.yml | 21 + .../vmihailenco/msgpack/v4/CHANGELOG.md | 24 + .../urlesc => vmihailenco/msgpack/v4}/LICENSE | 6 +- .../vmihailenco/msgpack/v4/Makefile | 6 + .../vmihailenco/msgpack/v4/README.md | 72 + .../vmihailenco/msgpack/v4/appengine.go | 64 + .../vmihailenco/msgpack/v4/codes/codes.go | 90 + .../vmihailenco/msgpack/v4/decode.go | 617 +++ .../vmihailenco/msgpack/v4/decode_map.go | 350 ++ .../vmihailenco/msgpack/v4/decode_number.go | 307 ++ .../vmihailenco/msgpack/v4/decode_query.go | 158 + .../vmihailenco/msgpack/v4/decode_slice.go | 191 + .../vmihailenco/msgpack/v4/decode_string.go | 186 + .../vmihailenco/msgpack/v4/decode_value.go | 276 ++ .../vmihailenco/msgpack/v4/encode.go | 241 + .../vmihailenco/msgpack/v4/encode_map.go | 172 + .../vmihailenco/msgpack/v4/encode_number.go | 244 + .../vmihailenco/msgpack/v4/encode_slice.go | 131 + .../vmihailenco/msgpack/v4/encode_value.go | 216 + .../github.com/vmihailenco/msgpack/v4/ext.go | 244 + .../github.com/vmihailenco/msgpack/v4/go.mod | 13 + .../github.com/vmihailenco/msgpack/v4/go.sum | 24 + .../vmihailenco/msgpack/v4/intern.go | 236 + .../vmihailenco/msgpack/v4/msgpack.go | 17 + .../github.com/vmihailenco/msgpack/v4/safe.go | 13 + .../github.com/vmihailenco/msgpack/v4/time.go | 149 + .../vmihailenco/msgpack/v4/types.go | 382 ++ .../vmihailenco/msgpack/v4/unsafe.go | 22 + .../vmihailenco/tagparser/.travis.yml | 24 + .../github.com/vmihailenco/tagparser/LICENSE | 25 + .../github.com/vmihailenco/tagparser/Makefile | 8 + .../vmihailenco/tagparser/README.md | 24 + .../github.com/vmihailenco/tagparser/go.mod | 3 + .../tagparser/internal/parser/parser.go | 82 + .../vmihailenco/tagparser/internal/safe.go | 11 + .../vmihailenco/tagparser/internal/unsafe.go | 22 + .../vmihailenco/tagparser/tagparser.go | 181 + .../mongo-driver/bson/bsoncodec/bsoncodec.go | 2 +- .../bson/bsoncodec/default_value_decoders.go | 14 +- .../mongo-driver/bson/bsoncodec/registry.go | 4 +- .../bson/bsonrw/extjson_parser.go | 2 +- .../mongo-driver/bson/bsonrw/value_reader.go | 10 +- .../mongo-driver/bson/bsonrw/value_writer.go | 2 +- .../go.mongodb.org/mongo-driver/bson/doc.go | 2 +- .../mongo-driver/bson/marshal.go | 3 + .../mongo-driver/bson/registry.go | 2 +- .../mongo-driver/bson/unmarshal.go | 2 +- .../x/bsonx/bsoncore/bson_documentbuilder.go | 2 +- .../mongo-driver/x/bsonx/bsoncore/bsoncore.go | 6 +- vendor/golang.org/x/net/context/context.go | 6 +- vendor/golang.org/x/net/context/go17.go | 10 +- vendor/golang.org/x/net/context/pre_go17.go | 10 +- .../golang.org/x/net/http/httpguts/httplex.go | 54 +- vendor/golang.org/x/net/http2/errors.go | 2 +- vendor/golang.org/x/net/http2/frame.go | 3 +- vendor/golang.org/x/net/http2/http2.go | 14 +- vendor/golang.org/x/net/http2/server.go | 59 +- vendor/golang.org/x/net/http2/transport.go | 18 +- vendor/golang.org/x/net/idna/trieval.go | 34 +- .../golang.org/x/sys/unix/asm_linux_loong64.s | 54 + vendor/golang.org/x/sys/unix/endian_little.go | 4 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 3 + vendor/golang.org/x/sys/unix/syscall_aix.go | 22 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 35 +- .../golang.org/x/sys/unix/syscall_darwin.go | 47 +- .../x/sys/unix/syscall_dragonfly.go | 11 +- .../golang.org/x/sys/unix/syscall_freebsd.go | 9 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 148 +- .../x/sys/unix/syscall_linux_386.go | 4 +- .../x/sys/unix/syscall_linux_amd64.go | 5 +- .../x/sys/unix/syscall_linux_arm.go | 4 +- .../x/sys/unix/syscall_linux_arm64.go | 5 +- .../x/sys/unix/syscall_linux_loong64.go | 191 + .../x/sys/unix/syscall_linux_mips64x.go | 4 +- .../x/sys/unix/syscall_linux_mipsx.go | 4 +- .../x/sys/unix/syscall_linux_ppc.go | 4 +- .../x/sys/unix/syscall_linux_ppc64x.go | 4 +- .../x/sys/unix/syscall_linux_riscv64.go | 4 +- .../x/sys/unix/syscall_linux_s390x.go | 4 +- .../x/sys/unix/syscall_linux_sparc64.go | 4 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 9 +- .../golang.org/x/sys/unix/syscall_openbsd.go | 11 +- .../golang.org/x/sys/unix/syscall_solaris.go | 148 +- vendor/golang.org/x/sys/unix/syscall_unix.go | 51 + vendor/golang.org/x/sys/unix/zerrors_linux.go | 30 +- .../x/sys/unix/zerrors_linux_loong64.go | 818 ++++ .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 4 +- .../x/sys/unix/zsyscall_aix_ppc64.go | 4 +- .../x/sys/unix/zsyscall_darwin_amd64.go | 41 +- .../x/sys/unix/zsyscall_darwin_amd64.s | 14 +- .../x/sys/unix/zsyscall_darwin_arm64.go | 41 +- .../x/sys/unix/zsyscall_darwin_arm64.s | 14 +- .../x/sys/unix/zsyscall_freebsd_386.go | 4 +- .../x/sys/unix/zsyscall_freebsd_amd64.go | 4 +- .../x/sys/unix/zsyscall_freebsd_arm.go | 4 +- .../x/sys/unix/zsyscall_freebsd_arm64.go | 4 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 99 + .../x/sys/unix/zsyscall_linux_386.go | 4 +- .../x/sys/unix/zsyscall_linux_amd64.go | 15 +- .../x/sys/unix/zsyscall_linux_arm.go | 4 +- .../x/sys/unix/zsyscall_linux_arm64.go | 15 +- .../x/sys/unix/zsyscall_linux_loong64.go | 552 +++ .../x/sys/unix/zsyscall_linux_mips.go | 4 +- .../x/sys/unix/zsyscall_linux_mips64.go | 4 +- .../x/sys/unix/zsyscall_linux_mips64le.go | 4 +- .../x/sys/unix/zsyscall_linux_mipsle.go | 4 +- .../x/sys/unix/zsyscall_linux_ppc.go | 4 +- .../x/sys/unix/zsyscall_linux_ppc64.go | 4 +- .../x/sys/unix/zsyscall_linux_ppc64le.go | 4 +- .../x/sys/unix/zsyscall_linux_riscv64.go | 4 +- .../x/sys/unix/zsyscall_linux_s390x.go | 4 +- .../x/sys/unix/zsyscall_linux_sparc64.go | 4 +- .../x/sys/unix/zsyscall_netbsd_386.go | 4 +- .../x/sys/unix/zsyscall_netbsd_amd64.go | 4 +- .../x/sys/unix/zsyscall_netbsd_arm.go | 4 +- .../x/sys/unix/zsyscall_netbsd_arm64.go | 4 +- .../x/sys/unix/zsyscall_openbsd_386.go | 4 +- .../x/sys/unix/zsyscall_openbsd_amd64.go | 4 +- .../x/sys/unix/zsyscall_openbsd_arm.go | 4 +- .../x/sys/unix/zsyscall_openbsd_arm64.go | 4 +- .../x/sys/unix/zsyscall_openbsd_mips64.go | 4 +- .../x/sys/unix/zsyscall_solaris_amd64.go | 16 +- .../x/sys/unix/zsysnum_linux_386.go | 1 + .../x/sys/unix/zsysnum_linux_amd64.go | 1 + .../x/sys/unix/zsysnum_linux_arm.go | 1 + .../x/sys/unix/zsysnum_linux_arm64.go | 1 + .../x/sys/unix/zsysnum_linux_loong64.go | 313 ++ .../x/sys/unix/zsysnum_linux_mips.go | 1 + .../x/sys/unix/zsysnum_linux_mips64.go | 1 + .../x/sys/unix/zsysnum_linux_mips64le.go | 1 + .../x/sys/unix/zsysnum_linux_mipsle.go | 1 + .../x/sys/unix/zsysnum_linux_ppc.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64.go | 1 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 1 + .../x/sys/unix/zsysnum_linux_riscv64.go | 1 + .../x/sys/unix/zsysnum_linux_s390x.go | 1 + .../x/sys/unix/zsysnum_linux_sparc64.go | 1 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 62 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 13 + .../x/sys/unix/ztypes_linux_amd64.go | 14 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 13 + .../x/sys/unix/ztypes_linux_arm64.go | 14 + .../x/sys/unix/ztypes_linux_loong64.go | 679 +++ .../x/sys/unix/ztypes_linux_mips.go | 13 + .../x/sys/unix/ztypes_linux_mips64.go | 14 + .../x/sys/unix/ztypes_linux_mips64le.go | 14 + .../x/sys/unix/ztypes_linux_mipsle.go | 13 + .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 13 + .../x/sys/unix/ztypes_linux_ppc64.go | 14 + .../x/sys/unix/ztypes_linux_ppc64le.go | 14 + .../x/sys/unix/ztypes_linux_riscv64.go | 14 + .../x/sys/unix/ztypes_linux_s390x.go | 14 + .../x/sys/unix/ztypes_linux_sparc64.go | 14 + vendor/golang.org/x/text/width/kind_string.go | 28 - .../golang.org/x/text/width/tables10.0.0.go | 1319 ------ .../golang.org/x/text/width/tables11.0.0.go | 1331 ------ .../golang.org/x/text/width/tables12.0.0.go | 1351 ------ .../golang.org/x/text/width/tables13.0.0.go | 1352 ------ vendor/golang.org/x/text/width/tables9.0.0.go | 1287 ----- vendor/golang.org/x/text/width/transform.go | 239 - vendor/golang.org/x/text/width/trieval.go | 30 - vendor/golang.org/x/text/width/width.go | 206 - .../grpc/balancer/balancer.go | 3 +- .../grpc/balancer_conn_wrappers.go | 318 +- .../grpc/channelz/channelz.go | 36 + vendor/google.golang.org/grpc/clientconn.go | 320 +- vendor/google.golang.org/grpc/dialoptions.go | 52 +- vendor/google.golang.org/grpc/go.mod | 10 +- vendor/google.golang.org/grpc/go.sum | 23 +- .../balancer/gracefulswitch/gracefulswitch.go | 382 ++ .../grpc/internal/binarylog/binarylog.go | 91 +- .../grpc/internal/binarylog/env_config.go | 6 +- .../grpc/internal/binarylog/method_logger.go | 26 +- .../grpc/internal/channelz/funcs.go | 159 +- .../grpc/internal/channelz/id.go | 75 + .../grpc/internal/channelz/logging.go | 91 +- .../grpc/internal/channelz/types.go | 23 +- .../grpc/internal/internal.go | 6 + .../grpc/internal/metadata/metadata.go | 46 + .../grpc/internal/pretty/pretty.go | 82 + .../grpc/internal/transport/http2_client.go | 31 +- .../grpc/internal/transport/http2_server.go | 18 +- .../grpc/internal/transport/transport.go | 5 +- .../grpc/metadata/metadata.go | 8 +- .../google.golang.org/grpc/picker_wrapper.go | 8 +- vendor/google.golang.org/grpc/pickfirst.go | 126 +- .../grpc/resolver/resolver.go | 8 +- .../grpc/resolver_conn_wrapper.go | 23 +- vendor/google.golang.org/grpc/server.go | 41 +- .../google.golang.org/grpc/service_config.go | 3 + vendor/google.golang.org/grpc/stream.go | 219 +- vendor/google.golang.org/grpc/version.go | 2 +- .../protobuf/encoding/protojson/decode.go | 665 +++ .../protobuf/encoding/protojson/doc.go | 11 + .../protobuf/encoding/protojson/encode.go | 344 ++ .../encoding/protojson/well_known_types.go | 889 ++++ .../protobuf/encoding/protowire/wire.go | 19 +- .../protobuf/internal/encoding/json/decode.go | 340 ++ .../internal/encoding/json/decode_number.go | 254 + .../internal/encoding/json/decode_string.go | 91 + .../internal/encoding/json/decode_token.go | 192 + .../protobuf/internal/encoding/json/encode.go | 276 ++ .../protobuf/internal/encoding/text/decode.go | 2 +- .../protobuf/internal/errors/is_go112.go | 1 + .../protobuf/internal/errors/is_go113.go | 1 + .../internal/flags/proto_legacy_disable.go | 1 + .../internal/flags/proto_legacy_enable.go | 1 + .../protobuf/internal/impl/codec_map_go111.go | 1 + .../protobuf/internal/impl/codec_map_go112.go | 1 + .../protobuf/internal/impl/codec_reflect.go | 1 + .../protobuf/internal/impl/codec_unsafe.go | 1 + .../protobuf/internal/impl/decode.go | 8 + .../protobuf/internal/impl/pointer_reflect.go | 1 + .../protobuf/internal/impl/pointer_unsafe.go | 1 + .../protobuf/internal/strs/strings_pure.go | 1 + .../protobuf/internal/strs/strings_unsafe.go | 1 + .../protobuf/internal/version/version.go | 4 +- .../protobuf/proto/decode.go | 17 +- .../protobuf/proto/proto_methods.go | 1 + .../protobuf/proto/proto_reflect.go | 1 + .../protobuf/reflect/protoreflect/methods.go | 1 + .../reflect/protoreflect/value_pure.go | 1 + .../reflect/protoreflect/value_union.go | 25 + .../reflect/protoreflect/value_unsafe.go | 1 + .../protobuf/runtime/protoiface/methods.go | 1 + vendor/modules.txt | 94 +- 777 files changed, 107791 insertions(+), 13533 deletions(-) delete mode 100644 vendor/github.com/PuerkitoBio/purell/.gitignore delete mode 100644 vendor/github.com/PuerkitoBio/purell/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/purell/LICENSE delete mode 100644 vendor/github.com/PuerkitoBio/purell/README.md delete mode 100644 vendor/github.com/PuerkitoBio/purell/purell.go delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/.travis.yml delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/README.md delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/urlesc.go create mode 100644 vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go create mode 100644 vendor/github.com/golang/protobuf/jsonpb/decode.go create mode 100644 vendor/github.com/golang/protobuf/jsonpb/encode.go create mode 100644 vendor/github.com/golang/protobuf/jsonpb/json.go create mode 100644 vendor/github.com/hashicorp/logutils/.gitignore create mode 100644 vendor/github.com/hashicorp/logutils/LICENSE create mode 100644 vendor/github.com/hashicorp/logutils/README.md create mode 100644 vendor/github.com/hashicorp/logutils/go.mod create mode 100644 vendor/github.com/hashicorp/logutils/level.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/context.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/doc.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/environment_variables.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/keys.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol_data.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/provider.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_json.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_msgpack.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/generate.sh delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go rename vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/{server => tf5server}/doc.go (73%) rename vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/{server => tf5server}/plugin.go (92%) create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/attribute_path_error.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/list.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/map.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/object.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/primitive.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/set.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/tuple.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/value_msgpack.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/data_source.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/diagnostic.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/doc.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/dynamic_value.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/attribute_path.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/data_source.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/diagnostic.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/provider.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/resource.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/schema.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/state.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/string_kind.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/types.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.pb.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.proto create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/attribute_path.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/data_source.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/dynamic_value.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/provider.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/resource.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/schema.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/state.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/string_kind.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/provider.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/resource.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/state.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/string_kind.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/doc.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/plugin.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/server.go rename vendor/github.com/hashicorp/terraform-plugin-go/{tfprotov5 => }/tftypes/attribute_path.go (52%) create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go rename vendor/github.com/hashicorp/terraform-plugin-go/{tfprotov5 => }/tftypes/doc.go (100%) create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go rename vendor/github.com/hashicorp/terraform-plugin-go/{tfprotov5 => }/tftypes/type.go (62%) rename vendor/github.com/hashicorp/terraform-plugin-go/{tfprotov5 => }/tftypes/unknown_value.go (100%) rename vendor/github.com/hashicorp/terraform-plugin-go/{tfprotov5 => }/tftypes/value.go (50%) create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/LICENSE create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/args.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/logger_options.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/log.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/options.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/provider.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sdk.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sink.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tflog/doc.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tflog/options.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tflog/provider.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tflog/subsystem.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/doc.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/options.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sdk.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sink.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/subsystem.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/transport.go delete mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/single_attr_body.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/context.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/environment_variables.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_resource.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_schema.go create mode 100644 vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/keys.go create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/.go-version create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/LICENSE create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/README.md create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/errors.go create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/go.mod create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/go.sum create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/module.go create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/module_package.go create mode 100644 vendor/github.com/hashicorp/terraform-registry-address/provider.go create mode 100644 vendor/github.com/hashicorp/terraform-svchost/LICENSE create mode 100644 vendor/github.com/hashicorp/terraform-svchost/go.mod create mode 100644 vendor/github.com/hashicorp/terraform-svchost/go.sum create mode 100644 vendor/github.com/hashicorp/terraform-svchost/label_iter.go create mode 100644 vendor/github.com/hashicorp/terraform-svchost/svchost.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_responses.go rename vendor/github.com/smutel/go-netbox/netbox/client/ipam/{ipam_ip_ranges_available_ips_read_parameters.go => ipam_ip_ranges_available_ips_list_parameters.go} (56%) rename vendor/github.com/smutel/go-netbox/netbox/client/ipam/{ipam_ip_ranges_available_ips_read_responses.go => ipam_ip_ranges_available_ips_list_responses.go} (69%) rename vendor/github.com/smutel/go-netbox/netbox/client/ipam/{ipam_prefixes_available_ips_read_parameters.go => ipam_prefixes_available_ips_list_parameters.go} (56%) rename vendor/github.com/smutel/go-netbox/netbox/client/ipam/{ipam_prefixes_available_ips_read_responses.go => ipam_prefixes_available_ips_list_responses.go} (69%) rename vendor/github.com/smutel/go-netbox/netbox/client/ipam/{ipam_prefixes_available_prefixes_read_parameters.go => ipam_prefixes_available_prefixes_list_parameters.go} (55%) rename vendor/github.com/smutel/go-netbox/netbox/client/ipam/{ipam_prefixes_available_prefixes_read_responses.go => ipam_prefixes_available_prefixes_list_responses.go} (68%) create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_client.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_parameters.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_responses.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/a_s_n.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/contact.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/contact_assignment.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/contact_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/contact_role.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group_assignment.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_a_s_n.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_contact.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_role.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_f_h_r_p_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_link.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/wireless_link.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_a_s_n.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_available_ip.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_contact.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_assignment.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_f_h_r_p_group_assignment.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n_group.go create mode 100644 vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_link.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/.golangci.yml create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/.travis.yml create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/CHANGELOG.md rename vendor/github.com/{PuerkitoBio/urlesc => vmihailenco/msgpack/v4}/LICENSE (83%) create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/Makefile create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/README.md create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/appengine.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/codes/codes.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/decode.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/decode_map.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/decode_number.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/decode_query.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/decode_slice.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/decode_string.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/decode_value.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/encode.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/encode_map.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/encode_number.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/encode_slice.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/encode_value.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/ext.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/go.mod create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/go.sum create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/intern.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/msgpack.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/safe.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/time.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/types.go create mode 100644 vendor/github.com/vmihailenco/msgpack/v4/unsafe.go create mode 100644 vendor/github.com/vmihailenco/tagparser/.travis.yml create mode 100644 vendor/github.com/vmihailenco/tagparser/LICENSE create mode 100644 vendor/github.com/vmihailenco/tagparser/Makefile create mode 100644 vendor/github.com/vmihailenco/tagparser/README.md create mode 100644 vendor/github.com/vmihailenco/tagparser/go.mod create mode 100644 vendor/github.com/vmihailenco/tagparser/internal/parser/parser.go create mode 100644 vendor/github.com/vmihailenco/tagparser/internal/safe.go create mode 100644 vendor/github.com/vmihailenco/tagparser/internal/unsafe.go create mode 100644 vendor/github.com/vmihailenco/tagparser/tagparser.go create mode 100644 vendor/golang.org/x/sys/unix/asm_linux_loong64.s create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go delete mode 100644 vendor/golang.org/x/text/width/kind_string.go delete mode 100644 vendor/golang.org/x/text/width/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables12.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables13.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/width/transform.go delete mode 100644 vendor/golang.org/x/text/width/trieval.go delete mode 100644 vendor/golang.org/x/text/width/width.go create mode 100644 vendor/google.golang.org/grpc/channelz/channelz.go create mode 100644 vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/id.go create mode 100644 vendor/google.golang.org/grpc/internal/pretty/pretty.go create mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/decode.go create mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/doc.go create mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/encode.go create mode 100644 vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go create mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode.go create mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go create mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go create mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go create mode 100644 vendor/google.golang.org/protobuf/internal/encoding/json/encode.go diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 7ee406fc5..9da5bbd66 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - go: [ '1.17.x' ] + go: [ '1.18.x' ] steps: - name: Checkout uses: actions/checkout@v3.0.2 @@ -34,7 +34,7 @@ jobs: shell: bash - name: Go installation - uses: actions/setup-go@v3.0.0 + uses: actions/setup-go@v3.1.0 with: go-version: ${{ matrix.go }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 344e44d1f..6194a1634 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,15 +10,13 @@ jobs: strategy: fail-fast: false matrix: - go: [ '1.17.x' ] + go: [ '1.18.x' ] steps: - name: Check conventional commits in PR uses: Namchee/conventional-pr@v0.10.1 with: access_token: ${{ secrets.github_token }} - label: "no-conventional-commits" close: false - template: "Thank you for your contribution attempt in this repository!\n\nUnfortunately, this pull request doesn't meet our standards by reason we stated below.\nFor future pull requests, please use conventional commits.\nPlease update the commits in this PR with conventional commits rules." strict: false report: false @@ -43,7 +41,7 @@ jobs: shell: bash - name: Go installation - uses: actions/setup-go@v3.0.0 + uses: actions/setup-go@v3.1.0 with: go-version: ${{ matrix.go }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be813f928..3194335e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - go: [ '1.17.x' ] + go: [ '1.18.x' ] steps: - name: Checkout uses: actions/checkout@v3.0.2 @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: Go installation - uses: actions/setup-go@v3.0.0 + uses: actions/setup-go@v3.1.0 with: go-version: ${{ matrix.go }} diff --git a/README.md b/README.md index cf5a97c26..1d7872791 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Terraform provider for [Netbox.](https://netbox.readthedocs.io/en/stable/) * A libc library like libc6-compat or libc-utils * General developer tools like make, bash, ... (to build the provider) -* Go 1.16 minimum (to build the provider) +* Go 1.18 minimum (to build the provider) * Terraform (to use the provider) ## Compatibility with Netbox diff --git a/go.mod b/go.mod index 682c4afb9..2fed7e2fa 100644 --- a/go.mod +++ b/go.mod @@ -5,30 +5,25 @@ go 1.15 require ( github.com/agext/levenshtein v1.2.3 // indirect github.com/fatih/color v1.13.0 // indirect - github.com/go-openapi/runtime v0.23.2 + github.com/go-openapi/analysis v0.21.3 // indirect + github.com/go-openapi/runtime v0.24.1 + github.com/go-openapi/spec v0.20.6 // indirect github.com/go-openapi/strfmt v0.21.2 - github.com/google/go-cmp v0.5.7 // indirect github.com/google/uuid v1.3.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-hclog v1.2.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.3 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect - github.com/hashicorp/go-version v1.4.0 // indirect - github.com/hashicorp/hcl/v2 v2.11.1 // indirect - github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3 + github.com/hashicorp/terraform-plugin-go v0.9.1 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 + github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 // indirect github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/oklog/run v1.1.0 // indirect - github.com/smutel/go-netbox v3.0.1+incompatible - github.com/zclconf/go-cty v1.10.0 // indirect - go.mongodb.org/mongo-driver v1.8.4 // indirect - golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect + github.com/smutel/go-netbox v3.1.0+incompatible + github.com/vmihailenco/tagparser v0.1.2 // indirect + go.mongodb.org/mongo-driver v1.9.1 // indirect + golang.org/x/net v0.0.0-20220516155154-20f960328961 // indirect + golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 // indirect - google.golang.org/grpc v1.45.0 // indirect + google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 // indirect + google.golang.org/grpc v1.46.2 // indirect ) diff --git a/go.sum b/go.sum index 03c566a04..b10296dda 100644 --- a/go.sum +++ b/go.sum @@ -1,51 +1,19 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -54,27 +22,19 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -87,6 +47,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= @@ -95,14 +56,13 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-openapi/analysis v0.21.2 h1:hXFrOYFHUAMQdu6zwAiKKJHJQ8kqZs1ux/ru1P1wLJU= +github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.3 h1:CPEa+B2oYCkb+lIKB4xP6Ork8Gvh0GNg9dm/twI3+QA= +github.com/go-openapi/analysis v0.21.3/go.mod h1:2rtHDVV21tLgvJd+eXu+ExiOhfMO4+dNb7496llyke0= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8= @@ -110,14 +70,16 @@ github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpX github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= -github.com/go-openapi/runtime v0.23.2 h1:SLoYVM3ovq+lynpgrHQZ5WQcx+CBE0HHHCZU3c2jQoo= -github.com/go-openapi/runtime v0.23.2/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/runtime v0.24.1 h1:Sml5cgQKGYQHF+M7yYSHaH1eOjvTykrddTE/KtQVjqo= +github.com/go-openapi/runtime v0.24.1/go.mod h1:AKurw9fNre+h3ELZfk6ILsfvPN+bvvlaU/M9q/r9hpk= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.6 h1:ich1RQ3WDbfoeTqTAb+5EIxNmpKVJZWBNah9RAT0jIQ= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/strfmt v0.21.2 h1:5NDNgadiX1Vhemth/TH4gCGopWSTdDjxl60H3B7f+os= @@ -158,22 +120,13 @@ github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGt github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -186,34 +139,21 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -221,71 +161,67 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.2.0 h1:La19f8d7WIlm4ogzNHB0JGqs5AUDAZ2UfCY4sJXcJdM= github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-plugin v1.4.3 h1:DXmvivbWD5qdiBts9TpBC7BYL1Aia5sxbRgQB+v6UZM= github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-plugin v1.4.4 h1:NVdrSdFRt3SkZtNckJ6tog7gbpRrcbOjQi/rgF7JYWQ= +github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/hcl/v2 v2.11.1 h1:yTyWcXcm9XB0TEkyU/JCRU6rYy4K+mgLtzn2wlrJbcc= -github.com/hashicorp/hcl/v2 v2.11.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= +github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= +github.com/hashicorp/hc-install v0.3.2/go.mod h1:xMG6Tr8Fw1WFjlxH0A9v61cW15pFwgEGqEz0V4jisHs= +github.com/hashicorp/hcl/v2 v2.12.0 h1:PsYxySWpMD4KPaoJLnsHwtK5Qptvj/4Q6s0t4sUxZf4= +github.com/hashicorp/hcl/v2 v2.12.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.13.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= -github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= -github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/0454b3MtYHkzOknqA= -github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3 h1:DGnxpIYRHXQZb2TOlQ1OCEYxoRQrAcbLIcYm8kvbFuU= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3/go.mod h1:5wrrTcxbSaQXamCDbHZTHk6yTF9OEZaOvQ9fvLXBE3o= +github.com/hashicorp/terraform-exec v0.16.1/go.mod h1:aj0lVshy8l+MHhFNoijNHtqTJQI3Xlowv5EOsEaGO7M= +github.com/hashicorp/terraform-json v0.13.0/go.mod h1:y5OdLBCT+rxbwnpxZs9kGL7R9ExU76+cpdY8zHwoazk= +github.com/hashicorp/terraform-plugin-go v0.9.0/go.mod h1:EawBkgjBWNf7jiKnVoyDyF39OSV+u6KUX+Y73EPj3oM= +github.com/hashicorp/terraform-plugin-go v0.9.1 h1:vXdHaQ6aqL+OF076nMSBV+JKPdmXlzG5mzVDD04WyPs= +github.com/hashicorp/terraform-plugin-go v0.9.1/go.mod h1:ItjVSlQs70otlzcCwlPcU8FRXLdO973oYFRZwAOxy8M= +github.com/hashicorp/terraform-plugin-log v0.3.0/go.mod h1:EjueSP/HjlyFAsDqt+okpCPjkT4NDynAe32AeDC4vps= +github.com/hashicorp/terraform-plugin-log v0.4.0 h1:F3eVnm8r2EfQCe2k9blPIiF/r2TT01SHijXnS7bujvc= +github.com/hashicorp/terraform-plugin-log v0.4.0/go.mod h1:9KclxdunFownr4pIm1jdmwKRmE4d6HVG2c9XDq47rpg= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 h1:9fjPgCenJqnbjo95SDcbJ+YdLyEC1N35cwKWcRWhJTQ= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0/go.mod h1:hLa0sTiySU/AWEgV2GxJh0/pQIqcCmm30IPja9N9lTg= +github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co= +github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 h1:IOawOnLgKntezAV3oJs17rkhXha+h0EF5OMjb2KFlYc= +github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -300,45 +236,34 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= @@ -350,25 +275,25 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smutel/go-netbox v3.0.1+incompatible h1:g/A7Hce+PPwYjbHLJrNHx7jhobB6n/VPJNkP/NiykOU= -github.com/smutel/go-netbox v3.0.1+incompatible/go.mod h1:UlNOimilX5qQkyVvFaDgajexiCRjVqzh1i0r9kQfr+M= +github.com/smutel/go-netbox v3.1.0+incompatible h1:2M1vldc2YIGs7OdPK+ujizRyghy04cK9Uzswgoc1Tcg= +github.com/smutel/go-netbox v3.1.0+incompatible/go.mod h1:UlNOimilX5qQkyVvFaDgajexiCRjVqzh1i0r9kQfr+M= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -383,78 +308,49 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.10.0 h1:mp9ZXQeIcN8kAwuqorjH+Q+njbJKjLrvB2yIh4q7U+0= github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= -go.mongodb.org/mongo-driver v1.8.4 h1:NruvZPPL0PBcRJKmbswoWSrmHeUvzdxA3GCPfD/NEOA= -go.mongodb.org/mongo-driver v1.8.4/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.mongodb.org/mongo-driver v1.9.1 h1:m078y9v7sBItkt1aaoe2YlvWEXcD263e1a4E1fBrJ1c= +go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -464,35 +360,23 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220516155154-20f960328961 h1:+W/iTMPG0EL7aW+/atntZwZrvSRIj3m3yX414dSULUU= +golang.org/x/net v0.0.0-20220516155154-20f960328961/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -501,188 +385,92 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40WUDnek3fPOyD08H5Vng= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a h1:N2T1jUrTQE9Re6TFF5PhvEHXHCguynGhKjWVsIUt5cY= +golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 h1:FglFEfyj61zP3c6LgjmVHxYxZWXYul9oiS1EZqD5gLc= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -695,20 +483,22 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -717,12 +507,4 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/vendor/github.com/PuerkitoBio/purell/.gitignore b/vendor/github.com/PuerkitoBio/purell/.gitignore deleted file mode 100644 index 748e4c807..000000000 --- a/vendor/github.com/PuerkitoBio/purell/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.sublime-* -.DS_Store -*.swp -*.swo -tags diff --git a/vendor/github.com/PuerkitoBio/purell/.travis.yml b/vendor/github.com/PuerkitoBio/purell/.travis.yml deleted file mode 100644 index cf31e6af6..000000000 --- a/vendor/github.com/PuerkitoBio/purell/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go - -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - "1.10.x" - - "1.11.x" - - tip diff --git a/vendor/github.com/PuerkitoBio/purell/LICENSE b/vendor/github.com/PuerkitoBio/purell/LICENSE deleted file mode 100644 index 4b9986dea..000000000 --- a/vendor/github.com/PuerkitoBio/purell/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Martin Angers -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/PuerkitoBio/purell/README.md b/vendor/github.com/PuerkitoBio/purell/README.md deleted file mode 100644 index 07de0c498..000000000 --- a/vendor/github.com/PuerkitoBio/purell/README.md +++ /dev/null @@ -1,188 +0,0 @@ -# Purell - -Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I know... - -Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc]. - -[![build status](https://travis-ci.org/PuerkitoBio/purell.svg?branch=master)](http://travis-ci.org/PuerkitoBio/purell) - -## Install - -`go get github.com/PuerkitoBio/purell` - -## Changelog - -* **v1.1.1** : Fix failing test due to Go1.12 changes (thanks to @ianlancetaylor). -* **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121). -* **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich). -* **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]). -* **v0.2.0** : Add benchmarks, Attempt IDN support. -* **v0.1.0** : Initial release. - -## Examples - -From `example_test.go` (note that in your code, you would import "github.com/PuerkitoBio/purell", and would prefix references to its methods and constants with "purell."): - -```go -package purell - -import ( - "fmt" - "net/url" -) - -func ExampleNormalizeURLString() { - if normalized, err := NormalizeURLString("hTTp://someWEBsite.com:80/Amazing%3f/url/", - FlagLowercaseScheme|FlagLowercaseHost|FlagUppercaseEscapes); err != nil { - panic(err) - } else { - fmt.Print(normalized) - } - // Output: http://somewebsite.com:80/Amazing%3F/url/ -} - -func ExampleMustNormalizeURLString() { - normalized := MustNormalizeURLString("hTTpS://someWEBsite.com:443/Amazing%fa/url/", - FlagsUnsafeGreedy) - fmt.Print(normalized) - - // Output: http://somewebsite.com/Amazing%FA/url -} - -func ExampleNormalizeURL() { - if u, err := url.Parse("Http://SomeUrl.com:8080/a/b/.././c///g?c=3&a=1&b=9&c=0#target"); err != nil { - panic(err) - } else { - normalized := NormalizeURL(u, FlagsUsuallySafeGreedy|FlagRemoveDuplicateSlashes|FlagRemoveFragment) - fmt.Print(normalized) - } - - // Output: http://someurl.com:8080/a/c/g?c=3&a=1&b=9&c=0 -} -``` - -## API - -As seen in the examples above, purell offers three methods, `NormalizeURLString(string, NormalizationFlags) (string, error)`, `MustNormalizeURLString(string, NormalizationFlags) (string)` and `NormalizeURL(*url.URL, NormalizationFlags) (string)`. They all normalize the provided URL based on the specified flags. Here are the available flags: - -```go -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) -``` - -For convenience, the set of flags `FlagsSafe`, `FlagsUsuallySafe[Greedy|NonGreedy]`, `FlagsUnsafe[Greedy|NonGreedy]` and `FlagsAll[Greedy|NonGreedy]` are provided for the similarly grouped normalizations on [wikipedia's URL normalization page][wiki]. You can add (using the bitwise OR `|` operator) or remove (using the bitwise AND NOT `&^` operator) individual flags from the sets if required, to build your own custom set. - -The [full godoc reference is available on gopkgdoc][godoc]. - -Some things to note: - -* `FlagDecodeUnnecessaryEscapes`, `FlagEncodeNecessaryEscapes`, `FlagUppercaseEscapes` and `FlagRemoveEmptyQuerySeparator` are always implicitly set, because internally, the URL string is parsed as an URL object, which automatically decodes unnecessary escapes, uppercases and encodes necessary ones, and removes empty query separators (an unnecessary `?` at the end of the url). So this operation cannot **not** be done. For this reason, `FlagRemoveEmptyQuerySeparator` (as well as the other three) has been included in the `FlagsSafe` convenience set, instead of `FlagsUnsafe`, where Wikipedia puts it. - -* The `FlagDecodeUnnecessaryEscapes` decodes the following escapes (*from -> to*): - - %24 -> $ - - %26 -> & - - %2B-%3B -> +,-./0123456789:; - - %3D -> = - - %40-%5A -> @ABCDEFGHIJKLMNOPQRSTUVWXYZ - - %5F -> _ - - %61-%7A -> abcdefghijklmnopqrstuvwxyz - - %7E -> ~ - - -* When the `NormalizeURL` function is used (passing an URL object), this source URL object is modified (that is, after the call, the URL object will be modified to reflect the normalization). - -* The *replace IP with domain name* normalization (`http://208.77.188.166/ → http://www.example.com/`) is obviously not possible for a library without making some network requests. This is not implemented in purell. - -* The *remove unused query string parameters* and *remove default query parameters* are also not implemented, since this is a very case-specific normalization, and it is quite trivial to do with an URL object. - -### Safe vs Usually Safe vs Unsafe - -Purell allows you to control the level of risk you take while normalizing an URL. You can aggressively normalize, play it totally safe, or anything in between. - -Consider the following URL: - -`HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -Normalizing with the `FlagsSafe` gives: - -`https://www.root.com/toto/tE%1F///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` - -With the `FlagsUsuallySafeGreedy`: - -`https://www.root.com/toto/tE%1F///a/c?z=3&w=2&a=4&w=1#invalid` - -And with `FlagsUnsafeGreedy`: - -`http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3` - -## TODOs - -* Add a class/default instance to allow specifying custom directory index names? At the moment, removing directory index removes `(^|/)((?:default|index)\.\w{1,4})$`. - -## Thanks / Contributions - -@rogpeppe -@jehiah -@opennota -@pchristopher1275 -@zenovich -@beeker1121 - -## License - -The [BSD 3-Clause license][bsd]. - -[bsd]: http://opensource.org/licenses/BSD-3-Clause -[wiki]: http://en.wikipedia.org/wiki/URL_normalization -[rfc]: http://tools.ietf.org/html/rfc3986#section-6 -[godoc]: http://go.pkgdoc.org/github.com/PuerkitoBio/purell -[pr5]: https://github.com/PuerkitoBio/purell/pull/5 -[iss7]: https://github.com/PuerkitoBio/purell/issues/7 diff --git a/vendor/github.com/PuerkitoBio/purell/purell.go b/vendor/github.com/PuerkitoBio/purell/purell.go deleted file mode 100644 index 6d0fc190a..000000000 --- a/vendor/github.com/PuerkitoBio/purell/purell.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -Package purell offers URL normalization as described on the wikipedia page: -http://en.wikipedia.org/wiki/URL_normalization -*/ -package purell - -import ( - "bytes" - "fmt" - "net/url" - "regexp" - "sort" - "strconv" - "strings" - - "github.com/PuerkitoBio/urlesc" - "golang.org/x/net/idna" - "golang.org/x/text/unicode/norm" - "golang.org/x/text/width" -) - -// A set of normalization flags determines how a URL will -// be normalized. -type NormalizationFlags uint - -const ( - // Safe normalizations - FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 - FlagLowercaseHost // http://HOST -> http://host - FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF - FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA - FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ - FlagRemoveDefaultPort // http://host:80 -> http://host - FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path - - // Usually safe normalizations - FlagRemoveTrailingSlash // http://host/path/ -> http://host/path - FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) - FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c - - // Unsafe normalizations - FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ - FlagRemoveFragment // http://host/path#fragment -> http://host/path - FlagForceHTTP // https://host -> http://host - FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b - FlagRemoveWWW // http://www.host/ -> http://host/ - FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) - FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 - - // Normalizations not in the wikipedia article, required to cover tests cases - // submitted by jehiah - FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 - FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 - FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 - FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path - FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path - - // Convenience set of safe normalizations - FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator - - // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, - // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". - - // Convenience set of usually safe normalizations (includes FlagsSafe) - FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments - FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments - - // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) - FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery - FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery - - // Convenience set of all available flags - FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator - FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator -) - -const ( - defaultHttpPort = ":80" - defaultHttpsPort = ":443" -) - -// Regular expressions used by the normalizations -var rxPort = regexp.MustCompile(`(:\d+)/?$`) -var rxDirIndex = regexp.MustCompile(`(^|/)((?:default|index)\.\w{1,4})$`) -var rxDupSlashes = regexp.MustCompile(`/{2,}`) -var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`) -var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`) -var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`) -var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`) -var rxEmptyPort = regexp.MustCompile(`:+$`) - -// Map of flags to implementation function. -// FlagDecodeUnnecessaryEscapes has no action, since it is done automatically -// by parsing the string as an URL. Same for FlagUppercaseEscapes and FlagRemoveEmptyQuerySeparator. - -// Since maps have undefined traversing order, make a slice of ordered keys -var flagsOrder = []NormalizationFlags{ - FlagLowercaseScheme, - FlagLowercaseHost, - FlagRemoveDefaultPort, - FlagRemoveDirectoryIndex, - FlagRemoveDotSegments, - FlagRemoveFragment, - FlagForceHTTP, // Must be after remove default port (because https=443/http=80) - FlagRemoveDuplicateSlashes, - FlagRemoveWWW, - FlagAddWWW, - FlagSortQuery, - FlagDecodeDWORDHost, - FlagDecodeOctalHost, - FlagDecodeHexHost, - FlagRemoveUnnecessaryHostDots, - FlagRemoveEmptyPortSeparator, - FlagRemoveTrailingSlash, // These two (add/remove trailing slash) must be last - FlagAddTrailingSlash, -} - -// ... and then the map, where order is unimportant -var flags = map[NormalizationFlags]func(*url.URL){ - FlagLowercaseScheme: lowercaseScheme, - FlagLowercaseHost: lowercaseHost, - FlagRemoveDefaultPort: removeDefaultPort, - FlagRemoveDirectoryIndex: removeDirectoryIndex, - FlagRemoveDotSegments: removeDotSegments, - FlagRemoveFragment: removeFragment, - FlagForceHTTP: forceHTTP, - FlagRemoveDuplicateSlashes: removeDuplicateSlashes, - FlagRemoveWWW: removeWWW, - FlagAddWWW: addWWW, - FlagSortQuery: sortQuery, - FlagDecodeDWORDHost: decodeDWORDHost, - FlagDecodeOctalHost: decodeOctalHost, - FlagDecodeHexHost: decodeHexHost, - FlagRemoveUnnecessaryHostDots: removeUnncessaryHostDots, - FlagRemoveEmptyPortSeparator: removeEmptyPortSeparator, - FlagRemoveTrailingSlash: removeTrailingSlash, - FlagAddTrailingSlash: addTrailingSlash, -} - -// MustNormalizeURLString returns the normalized string, and panics if an error occurs. -// It takes an URL string as input, as well as the normalization flags. -func MustNormalizeURLString(u string, f NormalizationFlags) string { - result, e := NormalizeURLString(u, f) - if e != nil { - panic(e) - } - return result -} - -// NormalizeURLString returns the normalized string, or an error if it can't be parsed into an URL object. -// It takes an URL string as input, as well as the normalization flags. -func NormalizeURLString(u string, f NormalizationFlags) (string, error) { - parsed, err := url.Parse(u) - if err != nil { - return "", err - } - - if f&FlagLowercaseHost == FlagLowercaseHost { - parsed.Host = strings.ToLower(parsed.Host) - } - - // The idna package doesn't fully conform to RFC 5895 - // (https://tools.ietf.org/html/rfc5895), so we do it here. - // Taken from Go 1.8 cycle source, courtesy of bradfitz. - // TODO: Remove when (if?) idna package conforms to RFC 5895. - parsed.Host = width.Fold.String(parsed.Host) - parsed.Host = norm.NFC.String(parsed.Host) - if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil { - return "", err - } - - return NormalizeURL(parsed, f), nil -} - -// NormalizeURL returns the normalized string. -// It takes a parsed URL object as input, as well as the normalization flags. -func NormalizeURL(u *url.URL, f NormalizationFlags) string { - for _, k := range flagsOrder { - if f&k == k { - flags[k](u) - } - } - return urlesc.Escape(u) -} - -func lowercaseScheme(u *url.URL) { - if len(u.Scheme) > 0 { - u.Scheme = strings.ToLower(u.Scheme) - } -} - -func lowercaseHost(u *url.URL) { - if len(u.Host) > 0 { - u.Host = strings.ToLower(u.Host) - } -} - -func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { - return "" - } - return val - }) - } -} - -func removeTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if strings.HasSuffix(u.Path, "/") { - u.Path = u.Path[:l-1] - } - } else if l = len(u.Host); l > 0 { - if strings.HasSuffix(u.Host, "/") { - u.Host = u.Host[:l-1] - } - } -} - -func addTrailingSlash(u *url.URL) { - if l := len(u.Path); l > 0 { - if !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } else if l = len(u.Host); l > 0 { - if !strings.HasSuffix(u.Host, "/") { - u.Host += "/" - } - } -} - -func removeDotSegments(u *url.URL) { - if len(u.Path) > 0 { - var dotFree []string - var lastIsDot bool - - sections := strings.Split(u.Path, "/") - for _, s := range sections { - if s == ".." { - if len(dotFree) > 0 { - dotFree = dotFree[:len(dotFree)-1] - } - } else if s != "." { - dotFree = append(dotFree, s) - } - lastIsDot = (s == "." || s == "..") - } - // Special case if host does not end with / and new path does not begin with / - u.Path = strings.Join(dotFree, "/") - if u.Host != "" && !strings.HasSuffix(u.Host, "/") && !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - // Special case if the last segment was a dot, make sure the path ends with a slash - if lastIsDot && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - } - } -} - -func removeDirectoryIndex(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDirIndex.ReplaceAllString(u.Path, "$1") - } -} - -func removeFragment(u *url.URL) { - u.Fragment = "" -} - -func forceHTTP(u *url.URL) { - if strings.ToLower(u.Scheme) == "https" { - u.Scheme = "http" - } -} - -func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") - } -} - -func removeWWW(u *url.URL) { - if len(u.Host) > 0 && strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = u.Host[4:] - } -} - -func addWWW(u *url.URL) { - if len(u.Host) > 0 && !strings.HasPrefix(strings.ToLower(u.Host), "www.") { - u.Host = "www." + u.Host - } -} - -func sortQuery(u *url.URL) { - q := u.Query() - - if len(q) > 0 { - arKeys := make([]string, len(q)) - i := 0 - for k := range q { - arKeys[i] = k - i++ - } - sort.Strings(arKeys) - buf := new(bytes.Buffer) - for _, k := range arKeys { - sort.Strings(q[k]) - for _, v := range q[k] { - if buf.Len() > 0 { - buf.WriteRune('&') - } - buf.WriteString(fmt.Sprintf("%s=%s", k, urlesc.QueryEscape(v))) - } - } - - // Rebuild the raw query string - u.RawQuery = buf.String() - } -} - -func decodeDWORDHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxDWORDHost.FindStringSubmatch(u.Host); len(matches) > 2 { - var parts [4]int64 - - dword, _ := strconv.ParseInt(matches[1], 10, 0) - for i, shift := range []uint{24, 16, 8, 0} { - parts[i] = dword >> shift & 0xFF - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[2]) - } - } -} - -func decodeOctalHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxOctalHost.FindStringSubmatch(u.Host); len(matches) > 5 { - var parts [4]int64 - - for i := 1; i <= 4; i++ { - parts[i-1], _ = strconv.ParseInt(matches[i], 8, 0) - } - u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[5]) - } - } -} - -func decodeHexHost(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHexHost.FindStringSubmatch(u.Host); len(matches) > 2 { - // Conversion is safe because of regex validation - parsed, _ := strconv.ParseInt(matches[1], 16, 0) - // Set host as DWORD (base 10) encoded host - u.Host = fmt.Sprintf("%d%s", parsed, matches[2]) - // The rest is the same as decoding a DWORD host - decodeDWORDHost(u) - } - } -} - -func removeUnncessaryHostDots(u *url.URL) { - if len(u.Host) > 0 { - if matches := rxHostDots.FindStringSubmatch(u.Host); len(matches) > 1 { - // Trim the leading and trailing dots - u.Host = strings.Trim(matches[1], ".") - if len(matches) > 2 { - u.Host += matches[2] - } - } - } -} - -func removeEmptyPortSeparator(u *url.URL) { - if len(u.Host) > 0 { - u.Host = rxEmptyPort.ReplaceAllString(u.Host, "") - } -} diff --git a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml b/vendor/github.com/PuerkitoBio/urlesc/.travis.yml deleted file mode 100644 index ba6b225f9..000000000 --- a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: go - -go: - - 1.4.x - - 1.5.x - - 1.6.x - - 1.7.x - - 1.8.x - - tip - -install: - - go build . - -script: - - go test -v diff --git a/vendor/github.com/PuerkitoBio/urlesc/README.md b/vendor/github.com/PuerkitoBio/urlesc/README.md deleted file mode 100644 index 57aff0a53..000000000 --- a/vendor/github.com/PuerkitoBio/urlesc/README.md +++ /dev/null @@ -1,16 +0,0 @@ -urlesc [![Build Status](https://travis-ci.org/PuerkitoBio/urlesc.svg?branch=master)](https://travis-ci.org/PuerkitoBio/urlesc) [![GoDoc](http://godoc.org/github.com/PuerkitoBio/urlesc?status.svg)](http://godoc.org/github.com/PuerkitoBio/urlesc) -====== - -Package urlesc implements query escaping as per RFC 3986. - -It contains some parts of the net/url package, modified so as to allow -some reserved characters incorrectly escaped by net/url (see [issue 5684](https://github.com/golang/go/issues/5684)). - -## Install - - go get github.com/PuerkitoBio/urlesc - -## License - -Go license (BSD-3-Clause) - diff --git a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go b/vendor/github.com/PuerkitoBio/urlesc/urlesc.go deleted file mode 100644 index 1b8462459..000000000 --- a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package urlesc implements query escaping as per RFC 3986. -// It contains some parts of the net/url package, modified so as to allow -// some reserved characters incorrectly escaped by net/url. -// See https://github.com/golang/go/issues/5684 -package urlesc - -import ( - "bytes" - "net/url" - "strings" -) - -type encoding int - -const ( - encodePath encoding = 1 + iota - encodeUserPassword - encodeQueryComponent - encodeFragment -) - -// Return true if the specified character should be escaped when -// appearing in a URL string, according to RFC 3986. -func shouldEscape(c byte, mode encoding) bool { - // §2.3 Unreserved characters (alphanum) - if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' { - return false - } - - switch c { - case '-', '.', '_', '~': // §2.3 Unreserved characters (mark) - return false - - // §2.2 Reserved characters (reserved) - case ':', '/', '?', '#', '[', ']', '@', // gen-delims - '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims - // Different sections of the URL allow a few of - // the reserved characters to appear unescaped. - switch mode { - case encodePath: // §3.3 - // The RFC allows sub-delims and : @. - // '/', '[' and ']' can be used to assign meaning to individual path - // segments. This package only manipulates the path as a whole, - // so we allow those as well. That leaves only ? and # to escape. - return c == '?' || c == '#' - - case encodeUserPassword: // §3.2.1 - // The RFC allows : and sub-delims in - // userinfo. The parsing of userinfo treats ':' as special so we must escape - // all the gen-delims. - return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@' - - case encodeQueryComponent: // §3.4 - // The RFC allows / and ?. - return c != '/' && c != '?' - - case encodeFragment: // §4.1 - // The RFC text is silent but the grammar allows - // everything, so escape nothing but # - return c == '#' - } - } - - // Everything else must be escaped. - return true -} - -// QueryEscape escapes the string so it can be safely placed -// inside a URL query. -func QueryEscape(s string) string { - return escape(s, encodeQueryComponent) -} - -func escape(s string, mode encoding) string { - spaceCount, hexCount := 0, 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEscape(c, mode) { - if c == ' ' && mode == encodeQueryComponent { - spaceCount++ - } else { - hexCount++ - } - } - } - - if spaceCount == 0 && hexCount == 0 { - return s - } - - t := make([]byte, len(s)+2*hexCount) - j := 0 - for i := 0; i < len(s); i++ { - switch c := s[i]; { - case c == ' ' && mode == encodeQueryComponent: - t[j] = '+' - j++ - case shouldEscape(c, mode): - t[j] = '%' - t[j+1] = "0123456789ABCDEF"[c>>4] - t[j+2] = "0123456789ABCDEF"[c&15] - j += 3 - default: - t[j] = s[i] - j++ - } - } - return string(t) -} - -var uiReplacer = strings.NewReplacer( - "%21", "!", - "%27", "'", - "%28", "(", - "%29", ")", - "%2A", "*", -) - -// unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986. -func unescapeUserinfo(s string) string { - return uiReplacer.Replace(s) -} - -// Escape reassembles the URL into a valid URL string. -// The general form of the result is one of: -// -// scheme:opaque -// scheme://userinfo@host/path?query#fragment -// -// If u.Opaque is non-empty, String uses the first form; -// otherwise it uses the second form. -// -// In the second form, the following rules apply: -// - if u.Scheme is empty, scheme: is omitted. -// - if u.User is nil, userinfo@ is omitted. -// - if u.Host is empty, host/ is omitted. -// - if u.Scheme and u.Host are empty and u.User is nil, -// the entire scheme://userinfo@host/ is omitted. -// - if u.Host is non-empty and u.Path begins with a /, -// the form host/path does not add its own /. -// - if u.RawQuery is empty, ?query is omitted. -// - if u.Fragment is empty, #fragment is omitted. -func Escape(u *url.URL) string { - var buf bytes.Buffer - if u.Scheme != "" { - buf.WriteString(u.Scheme) - buf.WriteByte(':') - } - if u.Opaque != "" { - buf.WriteString(u.Opaque) - } else { - if u.Scheme != "" || u.Host != "" || u.User != nil { - buf.WriteString("//") - if ui := u.User; ui != nil { - buf.WriteString(unescapeUserinfo(ui.String())) - buf.WriteByte('@') - } - if h := u.Host; h != "" { - buf.WriteString(h) - } - } - if u.Path != "" && u.Path[0] != '/' && u.Host != "" { - buf.WriteByte('/') - } - buf.WriteString(escape(u.Path, encodePath)) - } - if u.RawQuery != "" { - buf.WriteByte('?') - buf.WriteString(u.RawQuery) - } - if u.Fragment != "" { - buf.WriteByte('#') - buf.WriteString(escape(u.Fragment, encodeFragment)) - } - return buf.String() -} diff --git a/vendor/github.com/go-openapi/analysis/go.mod b/vendor/github.com/go-openapi/analysis/go.mod index 66b39b3a2..ef452d41f 100644 --- a/vendor/github.com/go-openapi/analysis/go.mod +++ b/vendor/github.com/go-openapi/analysis/go.mod @@ -3,6 +3,7 @@ module github.com/go-openapi/analysis require ( github.com/go-openapi/errors v0.19.9 // indirect github.com/go-openapi/jsonpointer v0.19.5 + github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/spec v0.20.4 github.com/go-openapi/strfmt v0.21.0 github.com/go-openapi/swag v0.19.15 diff --git a/vendor/github.com/go-openapi/analysis/go.sum b/vendor/github.com/go-openapi/analysis/go.sum index 539ad6fe3..c750ed76b 100644 --- a/vendor/github.com/go-openapi/analysis/go.sum +++ b/vendor/github.com/go-openapi/analysis/go.sum @@ -17,6 +17,8 @@ github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUe github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= github.com/go-openapi/strfmt v0.21.0 h1:hX2qEZKmYks+t0hKeb4VTJpUm2UYsdL3+DCid5swxIs= diff --git a/vendor/github.com/go-openapi/jsonreference/go.mod b/vendor/github.com/go-openapi/jsonreference/go.mod index 94727ab3e..015e80364 100644 --- a/vendor/github.com/go-openapi/jsonreference/go.mod +++ b/vendor/github.com/go-openapi/jsonreference/go.mod @@ -1,11 +1,8 @@ module github.com/go-openapi/jsonreference require ( - github.com/PuerkitoBio/purell v1.1.1 - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/go-openapi/jsonpointer v0.19.3 github.com/stretchr/testify v1.3.0 - golang.org/x/net v0.0.0-20210421230115-4e50805a0758 // indirect ) go 1.13 diff --git a/vendor/github.com/go-openapi/jsonreference/go.sum b/vendor/github.com/go-openapi/jsonreference/go.sum index 61714872d..07fa29701 100644 --- a/vendor/github.com/go-openapi/jsonreference/go.sum +++ b/vendor/github.com/go-openapi/jsonreference/go.sum @@ -1,7 +1,3 @@ -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -22,14 +18,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go new file mode 100644 index 000000000..8956c3088 --- /dev/null +++ b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go @@ -0,0 +1,63 @@ +package internal + +import ( + "net/url" + "regexp" + "strings" +) + +const ( + defaultHttpPort = ":80" + defaultHttpsPort = ":443" +) + +// Regular expressions used by the normalizations +var rxPort = regexp.MustCompile(`(:\d+)/?$`) +var rxDupSlashes = regexp.MustCompile(`/{2,}`) + +// NormalizeURL will normalize the specified URL +// This was added to replace a previous call to the no longer maintained purell library: +// The call that was used looked like the following: +// url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) +// +// To explain all that was included in the call above, purell.FlagsSafe was really just the following: +// - FlagLowercaseScheme +// - FlagLowercaseHost +// - FlagRemoveDefaultPort +// - FlagRemoveDuplicateSlashes (and this was mixed in with the |) +func NormalizeURL(u *url.URL) { + lowercaseScheme(u) + lowercaseHost(u) + removeDefaultPort(u) + removeDuplicateSlashes(u) +} + +func lowercaseScheme(u *url.URL) { + if len(u.Scheme) > 0 { + u.Scheme = strings.ToLower(u.Scheme) + } +} + +func lowercaseHost(u *url.URL) { + if len(u.Host) > 0 { + u.Host = strings.ToLower(u.Host) + } +} + +func removeDefaultPort(u *url.URL) { + if len(u.Host) > 0 { + scheme := strings.ToLower(u.Scheme) + u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { + if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { + return "" + } + return val + }) + } +} + +func removeDuplicateSlashes(u *url.URL) { + if len(u.Path) > 0 { + u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") + } +} diff --git a/vendor/github.com/go-openapi/jsonreference/reference.go b/vendor/github.com/go-openapi/jsonreference/reference.go index 3bc0a6e26..cfdef03e5 100644 --- a/vendor/github.com/go-openapi/jsonreference/reference.go +++ b/vendor/github.com/go-openapi/jsonreference/reference.go @@ -30,8 +30,8 @@ import ( "net/url" "strings" - "github.com/PuerkitoBio/purell" "github.com/go-openapi/jsonpointer" + "github.com/go-openapi/jsonreference/internal" ) const ( @@ -114,7 +114,9 @@ func (r *Ref) parse(jsonReferenceString string) error { return err } - r.referenceURL, _ = url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) + internal.NormalizeURL(parsed) + + r.referenceURL = parsed refURL := r.referenceURL if refURL.Scheme != "" && refURL.Host != "" { diff --git a/vendor/github.com/go-openapi/runtime/client/auth_info.go b/vendor/github.com/go-openapi/runtime/client/auth_info.go index d37e8f6b7..4f26e9234 100644 --- a/vendor/github.com/go-openapi/runtime/client/auth_info.go +++ b/vendor/github.com/go-openapi/runtime/client/auth_info.go @@ -33,7 +33,7 @@ func init() { func BasicAuth(username, password string) runtime.ClientAuthInfoWriter { return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { encoded := base64.StdEncoding.EncodeToString([]byte(username + ":" + password)) - return r.SetHeaderParam("Authorization", "Basic "+encoded) + return r.SetHeaderParam(runtime.HeaderAuthorization, "Basic "+encoded) }) } @@ -56,7 +56,7 @@ func APIKeyAuth(name, in, value string) runtime.ClientAuthInfoWriter { // BearerToken provides a header based oauth2 bearer access token auth info writer func BearerToken(token string) runtime.ClientAuthInfoWriter { return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { - return r.SetHeaderParam("Authorization", "Bearer "+token) + return r.SetHeaderParam(runtime.HeaderAuthorization, "Bearer "+token) }) } diff --git a/vendor/github.com/go-openapi/runtime/client/runtime.go b/vendor/github.com/go-openapi/runtime/client/runtime.go index f6ea0fad3..ec86793db 100644 --- a/vendor/github.com/go-openapi/runtime/client/runtime.go +++ b/vendor/github.com/go-openapi/runtime/client/runtime.go @@ -358,24 +358,28 @@ func (r *Runtime) EnableConnectionReuse() { ) } -// Submit a request and when there is a body on success it will turn that into the result -// all other things are turned into an api error for swagger which retains the status code -func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error) { - params, readResponse, auth := operation.Params, operation.Reader, operation.AuthInfo +// takes a client operation and creates equivalent http.Request +func (r *Runtime) createHttpRequest(operation *runtime.ClientOperation) (*request, *http.Request, error) { + params, _, auth := operation.Params, operation.Reader, operation.AuthInfo request, err := newRequest(operation.Method, operation.PathPattern, params) if err != nil { - return nil, err + return nil, nil, err } var accept []string accept = append(accept, operation.ProducesMediaTypes...) if err = request.SetHeaderParam(runtime.HeaderAccept, accept...); err != nil { - return nil, err + return nil, nil, err } if auth == nil && r.DefaultAuthentication != nil { - auth = r.DefaultAuthentication + auth = runtime.ClientAuthInfoWriterFunc(func(req runtime.ClientRequest, reg strfmt.Registry) error { + if req.GetHeaderParams().Get(runtime.HeaderAuthorization) != "" { + return nil + } + return r.DefaultAuthentication.AuthenticateRequest(req, reg) + }) } //if auth != nil { // if err := auth.AuthenticateRequest(request, r.Formats); err != nil { @@ -394,16 +398,33 @@ func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error } if _, ok := r.Producers[cmt]; !ok && cmt != runtime.MultipartFormMime && cmt != runtime.URLencodedFormMime { - return nil, fmt.Errorf("none of producers: %v registered. try %s", r.Producers, cmt) + return nil, nil, fmt.Errorf("none of producers: %v registered. try %s", r.Producers, cmt) } req, err := request.buildHTTP(cmt, r.BasePath, r.Producers, r.Formats, auth) if err != nil { - return nil, err + return nil, nil, err } req.URL.Scheme = r.pickScheme(operation.Schemes) req.URL.Host = r.Host req.Host = r.Host + return request, req, nil +} + +func (r *Runtime) CreateHttpRequest(operation *runtime.ClientOperation) (req *http.Request, err error) { + _, req, err = r.createHttpRequest(operation) + return +} + +// Submit a request and when there is a body on success it will turn that into the result +// all other things are turned into an api error for swagger which retains the status code +func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error) { + _, readResponse, _ := operation.Params, operation.Reader, operation.AuthInfo + + request, req, err := r.createHttpRequest(operation) + if err != nil { + return nil, err + } r.clientOnce.Do(func() { r.client = &http.Client{ diff --git a/vendor/github.com/go-openapi/runtime/client_response.go b/vendor/github.com/go-openapi/runtime/client_response.go index 0b7e38246..0d1691149 100644 --- a/vendor/github.com/go-openapi/runtime/client_response.go +++ b/vendor/github.com/go-openapi/runtime/client_response.go @@ -15,10 +15,9 @@ package runtime import ( + "encoding/json" "fmt" "io" - - "encoding/json" ) // A ClientResponse represents a client response @@ -61,13 +60,18 @@ type APIError struct { Code int } -func (a *APIError) Error() string { - resp, _ := json.Marshal(a.Response) - return fmt.Sprintf("%s (status %d): %s", a.OperationName, a.Code, resp) +func (o *APIError) Error() string { + var resp []byte + if err, ok := o.Response.(error); ok { + resp = []byte("'" + err.Error() + "'") + } else { + resp, _ = json.Marshal(o.Response) + } + return fmt.Sprintf("%s (status %d): %s", o.OperationName, o.Code, resp) } -func (a *APIError) String() string { - return a.Error() +func (o *APIError) String() string { + return o.Error() } // IsSuccess returns true when this elapse o k response returns a 2xx status code diff --git a/vendor/github.com/go-openapi/runtime/constants.go b/vendor/github.com/go-openapi/runtime/constants.go index a4de897ad..515969242 100644 --- a/vendor/github.com/go-openapi/runtime/constants.go +++ b/vendor/github.com/go-openapi/runtime/constants.go @@ -23,6 +23,8 @@ const ( // HeaderAccept the Accept header HeaderAccept = "Accept" + // HeaderAuthorization the Authorization header + HeaderAuthorization = "Authorization" charsetKey = "charset" diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go index 2c92f5c91..bab523c51 100644 --- a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go +++ b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go @@ -73,7 +73,7 @@ func SwaggerUI(opts SwaggerUIOpts, next http.Handler) http.Handler { b := buf.Bytes() return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { + if path.Join(r.URL.Path) == pth { rw.Header().Set("Content-Type", "text/html; charset=utf-8") rw.WriteHeader(http.StatusOK) diff --git a/vendor/github.com/go-openapi/runtime/security/authenticator.go b/vendor/github.com/go-openapi/runtime/security/authenticator.go index 476d26c3e..c3ffdac7e 100644 --- a/vendor/github.com/go-openapi/runtime/security/authenticator.go +++ b/vendor/github.com/go-openapi/runtime/security/authenticator.go @@ -220,7 +220,7 @@ func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Aut const prefix = "Bearer " return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { var token string - hdr := r.Request.Header.Get("Authorization") + hdr := r.Request.Header.Get(runtime.HeaderAuthorization) if strings.HasPrefix(hdr, prefix) { token = strings.TrimPrefix(hdr, prefix) } @@ -250,7 +250,7 @@ func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runti const prefix = "Bearer " return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { var token string - hdr := r.Request.Header.Get("Authorization") + hdr := r.Request.Header.Get(runtime.HeaderAuthorization) if strings.HasPrefix(hdr, prefix) { token = strings.TrimPrefix(hdr, prefix) } diff --git a/vendor/github.com/go-openapi/spec/go.mod b/vendor/github.com/go-openapi/spec/go.mod index 39aab5f7e..9e3e36fbb 100644 --- a/vendor/github.com/go-openapi/spec/go.mod +++ b/vendor/github.com/go-openapi/spec/go.mod @@ -2,10 +2,9 @@ module github.com/go-openapi/spec require ( github.com/go-openapi/jsonpointer v0.19.5 - github.com/go-openapi/jsonreference v0.19.6 + github.com/go-openapi/jsonreference v0.20.0 github.com/go-openapi/swag v0.19.15 github.com/stretchr/testify v1.6.1 - golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v2 v2.4.0 ) diff --git a/vendor/github.com/go-openapi/spec/go.sum b/vendor/github.com/go-openapi/spec/go.sum index 3a2f52263..7427dbddc 100644 --- a/vendor/github.com/go-openapi/spec/go.sum +++ b/vendor/github.com/go-openapi/spec/go.sum @@ -1,17 +1,12 @@ -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= @@ -19,12 +14,10 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= @@ -33,19 +26,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= @@ -53,7 +36,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/golang/protobuf/jsonpb/decode.go b/vendor/github.com/golang/protobuf/jsonpb/decode.go new file mode 100644 index 000000000..60e82caa9 --- /dev/null +++ b/vendor/github.com/golang/protobuf/jsonpb/decode.go @@ -0,0 +1,524 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package jsonpb + +import ( + "encoding/json" + "errors" + "fmt" + "io" + "math" + "reflect" + "strconv" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/encoding/protojson" + protoV2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" +) + +const wrapJSONUnmarshalV2 = false + +// UnmarshalNext unmarshals the next JSON object from d into m. +func UnmarshalNext(d *json.Decoder, m proto.Message) error { + return new(Unmarshaler).UnmarshalNext(d, m) +} + +// Unmarshal unmarshals a JSON object from r into m. +func Unmarshal(r io.Reader, m proto.Message) error { + return new(Unmarshaler).Unmarshal(r, m) +} + +// UnmarshalString unmarshals a JSON object from s into m. +func UnmarshalString(s string, m proto.Message) error { + return new(Unmarshaler).Unmarshal(strings.NewReader(s), m) +} + +// Unmarshaler is a configurable object for converting from a JSON +// representation to a protocol buffer object. +type Unmarshaler struct { + // AllowUnknownFields specifies whether to allow messages to contain + // unknown JSON fields, as opposed to failing to unmarshal. + AllowUnknownFields bool + + // AnyResolver is used to resolve the google.protobuf.Any well-known type. + // If unset, the global registry is used by default. + AnyResolver AnyResolver +} + +// JSONPBUnmarshaler is implemented by protobuf messages that customize the way +// they are unmarshaled from JSON. Messages that implement this should also +// implement JSONPBMarshaler so that the custom format can be produced. +// +// The JSON unmarshaling must follow the JSON to proto specification: +// https://developers.google.com/protocol-buffers/docs/proto3#json +// +// Deprecated: Custom types should implement protobuf reflection instead. +type JSONPBUnmarshaler interface { + UnmarshalJSONPB(*Unmarshaler, []byte) error +} + +// Unmarshal unmarshals a JSON object from r into m. +func (u *Unmarshaler) Unmarshal(r io.Reader, m proto.Message) error { + return u.UnmarshalNext(json.NewDecoder(r), m) +} + +// UnmarshalNext unmarshals the next JSON object from d into m. +func (u *Unmarshaler) UnmarshalNext(d *json.Decoder, m proto.Message) error { + if m == nil { + return errors.New("invalid nil message") + } + + // Parse the next JSON object from the stream. + raw := json.RawMessage{} + if err := d.Decode(&raw); err != nil { + return err + } + + // Check for custom unmarshalers first since they may not properly + // implement protobuf reflection that the logic below relies on. + if jsu, ok := m.(JSONPBUnmarshaler); ok { + return jsu.UnmarshalJSONPB(u, raw) + } + + mr := proto.MessageReflect(m) + + // NOTE: For historical reasons, a top-level null is treated as a noop. + // This is incorrect, but kept for compatibility. + if string(raw) == "null" && mr.Descriptor().FullName() != "google.protobuf.Value" { + return nil + } + + if wrapJSONUnmarshalV2 { + // NOTE: If input message is non-empty, we need to preserve merge semantics + // of the old jsonpb implementation. These semantics are not supported by + // the protobuf JSON specification. + isEmpty := true + mr.Range(func(protoreflect.FieldDescriptor, protoreflect.Value) bool { + isEmpty = false // at least one iteration implies non-empty + return false + }) + if !isEmpty { + // Perform unmarshaling into a newly allocated, empty message. + mr = mr.New() + + // Use a defer to copy all unmarshaled fields into the original message. + dst := proto.MessageReflect(m) + defer mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { + dst.Set(fd, v) + return true + }) + } + + // Unmarshal using the v2 JSON unmarshaler. + opts := protojson.UnmarshalOptions{ + DiscardUnknown: u.AllowUnknownFields, + } + if u.AnyResolver != nil { + opts.Resolver = anyResolver{u.AnyResolver} + } + return opts.Unmarshal(raw, mr.Interface()) + } else { + if err := u.unmarshalMessage(mr, raw); err != nil { + return err + } + return protoV2.CheckInitialized(mr.Interface()) + } +} + +func (u *Unmarshaler) unmarshalMessage(m protoreflect.Message, in []byte) error { + md := m.Descriptor() + fds := md.Fields() + + if jsu, ok := proto.MessageV1(m.Interface()).(JSONPBUnmarshaler); ok { + return jsu.UnmarshalJSONPB(u, in) + } + + if string(in) == "null" && md.FullName() != "google.protobuf.Value" { + return nil + } + + switch wellKnownType(md.FullName()) { + case "Any": + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return err + } + + rawTypeURL, ok := jsonObject["@type"] + if !ok { + return errors.New("Any JSON doesn't have '@type'") + } + typeURL, err := unquoteString(string(rawTypeURL)) + if err != nil { + return fmt.Errorf("can't unmarshal Any's '@type': %q", rawTypeURL) + } + m.Set(fds.ByNumber(1), protoreflect.ValueOfString(typeURL)) + + var m2 protoreflect.Message + if u.AnyResolver != nil { + mi, err := u.AnyResolver.Resolve(typeURL) + if err != nil { + return err + } + m2 = proto.MessageReflect(mi) + } else { + mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) + if err != nil { + if err == protoregistry.NotFound { + return fmt.Errorf("could not resolve Any message type: %v", typeURL) + } + return err + } + m2 = mt.New() + } + + if wellKnownType(m2.Descriptor().FullName()) != "" { + rawValue, ok := jsonObject["value"] + if !ok { + return errors.New("Any JSON doesn't have 'value'") + } + if err := u.unmarshalMessage(m2, rawValue); err != nil { + return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) + } + } else { + delete(jsonObject, "@type") + rawJSON, err := json.Marshal(jsonObject) + if err != nil { + return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err) + } + if err = u.unmarshalMessage(m2, rawJSON); err != nil { + return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) + } + } + + rawWire, err := protoV2.Marshal(m2.Interface()) + if err != nil { + return fmt.Errorf("can't marshal proto %v into Any.Value: %v", typeURL, err) + } + m.Set(fds.ByNumber(2), protoreflect.ValueOfBytes(rawWire)) + return nil + case "BoolValue", "BytesValue", "StringValue", + "Int32Value", "UInt32Value", "FloatValue", + "Int64Value", "UInt64Value", "DoubleValue": + fd := fds.ByNumber(1) + v, err := u.unmarshalValue(m.NewField(fd), in, fd) + if err != nil { + return err + } + m.Set(fd, v) + return nil + case "Duration": + v, err := unquoteString(string(in)) + if err != nil { + return err + } + d, err := time.ParseDuration(v) + if err != nil { + return fmt.Errorf("bad Duration: %v", err) + } + + sec := d.Nanoseconds() / 1e9 + nsec := d.Nanoseconds() % 1e9 + m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) + m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) + return nil + case "Timestamp": + v, err := unquoteString(string(in)) + if err != nil { + return err + } + t, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return fmt.Errorf("bad Timestamp: %v", err) + } + + sec := t.Unix() + nsec := t.Nanosecond() + m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) + m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) + return nil + case "Value": + switch { + case string(in) == "null": + m.Set(fds.ByNumber(1), protoreflect.ValueOfEnum(0)) + case string(in) == "true": + m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(true)) + case string(in) == "false": + m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(false)) + case hasPrefixAndSuffix('"', in, '"'): + s, err := unquoteString(string(in)) + if err != nil { + return fmt.Errorf("unrecognized type for Value %q", in) + } + m.Set(fds.ByNumber(3), protoreflect.ValueOfString(s)) + case hasPrefixAndSuffix('[', in, ']'): + v := m.Mutable(fds.ByNumber(6)) + return u.unmarshalMessage(v.Message(), in) + case hasPrefixAndSuffix('{', in, '}'): + v := m.Mutable(fds.ByNumber(5)) + return u.unmarshalMessage(v.Message(), in) + default: + f, err := strconv.ParseFloat(string(in), 0) + if err != nil { + return fmt.Errorf("unrecognized type for Value %q", in) + } + m.Set(fds.ByNumber(2), protoreflect.ValueOfFloat64(f)) + } + return nil + case "ListValue": + var jsonArray []json.RawMessage + if err := json.Unmarshal(in, &jsonArray); err != nil { + return fmt.Errorf("bad ListValue: %v", err) + } + + lv := m.Mutable(fds.ByNumber(1)).List() + for _, raw := range jsonArray { + ve := lv.NewElement() + if err := u.unmarshalMessage(ve.Message(), raw); err != nil { + return err + } + lv.Append(ve) + } + return nil + case "Struct": + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return fmt.Errorf("bad StructValue: %v", err) + } + + mv := m.Mutable(fds.ByNumber(1)).Map() + for key, raw := range jsonObject { + kv := protoreflect.ValueOf(key).MapKey() + vv := mv.NewValue() + if err := u.unmarshalMessage(vv.Message(), raw); err != nil { + return fmt.Errorf("bad value in StructValue for key %q: %v", key, err) + } + mv.Set(kv, vv) + } + return nil + } + + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return err + } + + // Handle known fields. + for i := 0; i < fds.Len(); i++ { + fd := fds.Get(i) + if fd.IsWeak() && fd.Message().IsPlaceholder() { + continue // weak reference is not linked in + } + + // Search for any raw JSON value associated with this field. + var raw json.RawMessage + name := string(fd.Name()) + if fd.Kind() == protoreflect.GroupKind { + name = string(fd.Message().Name()) + } + if v, ok := jsonObject[name]; ok { + delete(jsonObject, name) + raw = v + } + name = string(fd.JSONName()) + if v, ok := jsonObject[name]; ok { + delete(jsonObject, name) + raw = v + } + + field := m.NewField(fd) + // Unmarshal the field value. + if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) { + continue + } + v, err := u.unmarshalValue(field, raw, fd) + if err != nil { + return err + } + m.Set(fd, v) + } + + // Handle extension fields. + for name, raw := range jsonObject { + if !strings.HasPrefix(name, "[") || !strings.HasSuffix(name, "]") { + continue + } + + // Resolve the extension field by name. + xname := protoreflect.FullName(name[len("[") : len(name)-len("]")]) + xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname) + if xt == nil && isMessageSet(md) { + xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension")) + } + if xt == nil { + continue + } + delete(jsonObject, name) + fd := xt.TypeDescriptor() + if fd.ContainingMessage().FullName() != m.Descriptor().FullName() { + return fmt.Errorf("extension field %q does not extend message %q", xname, m.Descriptor().FullName()) + } + + field := m.NewField(fd) + // Unmarshal the field value. + if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) { + continue + } + v, err := u.unmarshalValue(field, raw, fd) + if err != nil { + return err + } + m.Set(fd, v) + } + + if !u.AllowUnknownFields && len(jsonObject) > 0 { + for name := range jsonObject { + return fmt.Errorf("unknown field %q in %v", name, md.FullName()) + } + } + return nil +} + +func isSingularWellKnownValue(fd protoreflect.FieldDescriptor) bool { + if md := fd.Message(); md != nil { + return md.FullName() == "google.protobuf.Value" && fd.Cardinality() != protoreflect.Repeated + } + return false +} + +func isSingularJSONPBUnmarshaler(v protoreflect.Value, fd protoreflect.FieldDescriptor) bool { + if fd.Message() != nil && fd.Cardinality() != protoreflect.Repeated { + _, ok := proto.MessageV1(v.Interface()).(JSONPBUnmarshaler) + return ok + } + return false +} + +func (u *Unmarshaler) unmarshalValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { + switch { + case fd.IsList(): + var jsonArray []json.RawMessage + if err := json.Unmarshal(in, &jsonArray); err != nil { + return v, err + } + lv := v.List() + for _, raw := range jsonArray { + ve, err := u.unmarshalSingularValue(lv.NewElement(), raw, fd) + if err != nil { + return v, err + } + lv.Append(ve) + } + return v, nil + case fd.IsMap(): + var jsonObject map[string]json.RawMessage + if err := json.Unmarshal(in, &jsonObject); err != nil { + return v, err + } + kfd := fd.MapKey() + vfd := fd.MapValue() + mv := v.Map() + for key, raw := range jsonObject { + var kv protoreflect.MapKey + if kfd.Kind() == protoreflect.StringKind { + kv = protoreflect.ValueOf(key).MapKey() + } else { + v, err := u.unmarshalSingularValue(kfd.Default(), []byte(key), kfd) + if err != nil { + return v, err + } + kv = v.MapKey() + } + + vv, err := u.unmarshalSingularValue(mv.NewValue(), raw, vfd) + if err != nil { + return v, err + } + mv.Set(kv, vv) + } + return v, nil + default: + return u.unmarshalSingularValue(v, in, fd) + } +} + +var nonFinite = map[string]float64{ + `"NaN"`: math.NaN(), + `"Infinity"`: math.Inf(+1), + `"-Infinity"`: math.Inf(-1), +} + +func (u *Unmarshaler) unmarshalSingularValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { + switch fd.Kind() { + case protoreflect.BoolKind: + return unmarshalValue(in, new(bool)) + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + return unmarshalValue(trimQuote(in), new(int32)) + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + return unmarshalValue(trimQuote(in), new(int64)) + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + return unmarshalValue(trimQuote(in), new(uint32)) + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + return unmarshalValue(trimQuote(in), new(uint64)) + case protoreflect.FloatKind: + if f, ok := nonFinite[string(in)]; ok { + return protoreflect.ValueOfFloat32(float32(f)), nil + } + return unmarshalValue(trimQuote(in), new(float32)) + case protoreflect.DoubleKind: + if f, ok := nonFinite[string(in)]; ok { + return protoreflect.ValueOfFloat64(float64(f)), nil + } + return unmarshalValue(trimQuote(in), new(float64)) + case protoreflect.StringKind: + return unmarshalValue(in, new(string)) + case protoreflect.BytesKind: + return unmarshalValue(in, new([]byte)) + case protoreflect.EnumKind: + if hasPrefixAndSuffix('"', in, '"') { + vd := fd.Enum().Values().ByName(protoreflect.Name(trimQuote(in))) + if vd == nil { + return v, fmt.Errorf("unknown value %q for enum %s", in, fd.Enum().FullName()) + } + return protoreflect.ValueOfEnum(vd.Number()), nil + } + return unmarshalValue(in, new(protoreflect.EnumNumber)) + case protoreflect.MessageKind, protoreflect.GroupKind: + err := u.unmarshalMessage(v.Message(), in) + return v, err + default: + panic(fmt.Sprintf("invalid kind %v", fd.Kind())) + } +} + +func unmarshalValue(in []byte, v interface{}) (protoreflect.Value, error) { + err := json.Unmarshal(in, v) + return protoreflect.ValueOf(reflect.ValueOf(v).Elem().Interface()), err +} + +func unquoteString(in string) (out string, err error) { + err = json.Unmarshal([]byte(in), &out) + return out, err +} + +func hasPrefixAndSuffix(prefix byte, in []byte, suffix byte) bool { + if len(in) >= 2 && in[0] == prefix && in[len(in)-1] == suffix { + return true + } + return false +} + +// trimQuote is like unquoteString but simply strips surrounding quotes. +// This is incorrect, but is behavior done by the legacy implementation. +func trimQuote(in []byte) []byte { + if len(in) >= 2 && in[0] == '"' && in[len(in)-1] == '"' { + in = in[1 : len(in)-1] + } + return in +} diff --git a/vendor/github.com/golang/protobuf/jsonpb/encode.go b/vendor/github.com/golang/protobuf/jsonpb/encode.go new file mode 100644 index 000000000..685c80a62 --- /dev/null +++ b/vendor/github.com/golang/protobuf/jsonpb/encode.go @@ -0,0 +1,559 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package jsonpb + +import ( + "encoding/json" + "errors" + "fmt" + "io" + "math" + "reflect" + "sort" + "strconv" + "strings" + "time" + + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/encoding/protojson" + protoV2 "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" +) + +const wrapJSONMarshalV2 = false + +// Marshaler is a configurable object for marshaling protocol buffer messages +// to the specified JSON representation. +type Marshaler struct { + // OrigName specifies whether to use the original protobuf name for fields. + OrigName bool + + // EnumsAsInts specifies whether to render enum values as integers, + // as opposed to string values. + EnumsAsInts bool + + // EmitDefaults specifies whether to render fields with zero values. + EmitDefaults bool + + // Indent controls whether the output is compact or not. + // If empty, the output is compact JSON. Otherwise, every JSON object + // entry and JSON array value will be on its own line. + // Each line will be preceded by repeated copies of Indent, where the + // number of copies is the current indentation depth. + Indent string + + // AnyResolver is used to resolve the google.protobuf.Any well-known type. + // If unset, the global registry is used by default. + AnyResolver AnyResolver +} + +// JSONPBMarshaler is implemented by protobuf messages that customize the +// way they are marshaled to JSON. Messages that implement this should also +// implement JSONPBUnmarshaler so that the custom format can be parsed. +// +// The JSON marshaling must follow the proto to JSON specification: +// https://developers.google.com/protocol-buffers/docs/proto3#json +// +// Deprecated: Custom types should implement protobuf reflection instead. +type JSONPBMarshaler interface { + MarshalJSONPB(*Marshaler) ([]byte, error) +} + +// Marshal serializes a protobuf message as JSON into w. +func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error { + b, err := jm.marshal(m) + if len(b) > 0 { + if _, err := w.Write(b); err != nil { + return err + } + } + return err +} + +// MarshalToString serializes a protobuf message as JSON in string form. +func (jm *Marshaler) MarshalToString(m proto.Message) (string, error) { + b, err := jm.marshal(m) + if err != nil { + return "", err + } + return string(b), nil +} + +func (jm *Marshaler) marshal(m proto.Message) ([]byte, error) { + v := reflect.ValueOf(m) + if m == nil || (v.Kind() == reflect.Ptr && v.IsNil()) { + return nil, errors.New("Marshal called with nil") + } + + // Check for custom marshalers first since they may not properly + // implement protobuf reflection that the logic below relies on. + if jsm, ok := m.(JSONPBMarshaler); ok { + return jsm.MarshalJSONPB(jm) + } + + if wrapJSONMarshalV2 { + opts := protojson.MarshalOptions{ + UseProtoNames: jm.OrigName, + UseEnumNumbers: jm.EnumsAsInts, + EmitUnpopulated: jm.EmitDefaults, + Indent: jm.Indent, + } + if jm.AnyResolver != nil { + opts.Resolver = anyResolver{jm.AnyResolver} + } + return opts.Marshal(proto.MessageReflect(m).Interface()) + } else { + // Check for unpopulated required fields first. + m2 := proto.MessageReflect(m) + if err := protoV2.CheckInitialized(m2.Interface()); err != nil { + return nil, err + } + + w := jsonWriter{Marshaler: jm} + err := w.marshalMessage(m2, "", "") + return w.buf, err + } +} + +type jsonWriter struct { + *Marshaler + buf []byte +} + +func (w *jsonWriter) write(s string) { + w.buf = append(w.buf, s...) +} + +func (w *jsonWriter) marshalMessage(m protoreflect.Message, indent, typeURL string) error { + if jsm, ok := proto.MessageV1(m.Interface()).(JSONPBMarshaler); ok { + b, err := jsm.MarshalJSONPB(w.Marshaler) + if err != nil { + return err + } + if typeURL != "" { + // we are marshaling this object to an Any type + var js map[string]*json.RawMessage + if err = json.Unmarshal(b, &js); err != nil { + return fmt.Errorf("type %T produced invalid JSON: %v", m.Interface(), err) + } + turl, err := json.Marshal(typeURL) + if err != nil { + return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err) + } + js["@type"] = (*json.RawMessage)(&turl) + if b, err = json.Marshal(js); err != nil { + return err + } + } + w.write(string(b)) + return nil + } + + md := m.Descriptor() + fds := md.Fields() + + // Handle well-known types. + const secondInNanos = int64(time.Second / time.Nanosecond) + switch wellKnownType(md.FullName()) { + case "Any": + return w.marshalAny(m, indent) + case "BoolValue", "BytesValue", "StringValue", + "Int32Value", "UInt32Value", "FloatValue", + "Int64Value", "UInt64Value", "DoubleValue": + fd := fds.ByNumber(1) + return w.marshalValue(fd, m.Get(fd), indent) + case "Duration": + const maxSecondsInDuration = 315576000000 + // "Generated output always contains 0, 3, 6, or 9 fractional digits, + // depending on required precision." + s := m.Get(fds.ByNumber(1)).Int() + ns := m.Get(fds.ByNumber(2)).Int() + if s < -maxSecondsInDuration || s > maxSecondsInDuration { + return fmt.Errorf("seconds out of range %v", s) + } + if ns <= -secondInNanos || ns >= secondInNanos { + return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos) + } + if (s > 0 && ns < 0) || (s < 0 && ns > 0) { + return errors.New("signs of seconds and nanos do not match") + } + var sign string + if s < 0 || ns < 0 { + sign, s, ns = "-", -1*s, -1*ns + } + x := fmt.Sprintf("%s%d.%09d", sign, s, ns) + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, ".000") + w.write(fmt.Sprintf(`"%vs"`, x)) + return nil + case "Timestamp": + // "RFC 3339, where generated output will always be Z-normalized + // and uses 0, 3, 6 or 9 fractional digits." + s := m.Get(fds.ByNumber(1)).Int() + ns := m.Get(fds.ByNumber(2)).Int() + if ns < 0 || ns >= secondInNanos { + return fmt.Errorf("ns out of range [0, %v)", secondInNanos) + } + t := time.Unix(s, ns).UTC() + // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits). + x := t.Format("2006-01-02T15:04:05.000000000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, ".000") + w.write(fmt.Sprintf(`"%vZ"`, x)) + return nil + case "Value": + // JSON value; which is a null, number, string, bool, object, or array. + od := md.Oneofs().Get(0) + fd := m.WhichOneof(od) + if fd == nil { + return errors.New("nil Value") + } + return w.marshalValue(fd, m.Get(fd), indent) + case "Struct", "ListValue": + // JSON object or array. + fd := fds.ByNumber(1) + return w.marshalValue(fd, m.Get(fd), indent) + } + + w.write("{") + if w.Indent != "" { + w.write("\n") + } + + firstField := true + if typeURL != "" { + if err := w.marshalTypeURL(indent, typeURL); err != nil { + return err + } + firstField = false + } + + for i := 0; i < fds.Len(); { + fd := fds.Get(i) + if od := fd.ContainingOneof(); od != nil { + fd = m.WhichOneof(od) + i += od.Fields().Len() + if fd == nil { + continue + } + } else { + i++ + } + + v := m.Get(fd) + + if !m.Has(fd) { + if !w.EmitDefaults || fd.ContainingOneof() != nil { + continue + } + if fd.Cardinality() != protoreflect.Repeated && (fd.Message() != nil || fd.Syntax() == protoreflect.Proto2) { + v = protoreflect.Value{} // use "null" for singular messages or proto2 scalars + } + } + + if !firstField { + w.writeComma() + } + if err := w.marshalField(fd, v, indent); err != nil { + return err + } + firstField = false + } + + // Handle proto2 extensions. + if md.ExtensionRanges().Len() > 0 { + // Collect a sorted list of all extension descriptor and values. + type ext struct { + desc protoreflect.FieldDescriptor + val protoreflect.Value + } + var exts []ext + m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { + if fd.IsExtension() { + exts = append(exts, ext{fd, v}) + } + return true + }) + sort.Slice(exts, func(i, j int) bool { + return exts[i].desc.Number() < exts[j].desc.Number() + }) + + for _, ext := range exts { + if !firstField { + w.writeComma() + } + if err := w.marshalField(ext.desc, ext.val, indent); err != nil { + return err + } + firstField = false + } + } + + if w.Indent != "" { + w.write("\n") + w.write(indent) + } + w.write("}") + return nil +} + +func (w *jsonWriter) writeComma() { + if w.Indent != "" { + w.write(",\n") + } else { + w.write(",") + } +} + +func (w *jsonWriter) marshalAny(m protoreflect.Message, indent string) error { + // "If the Any contains a value that has a special JSON mapping, + // it will be converted as follows: {"@type": xxx, "value": yyy}. + // Otherwise, the value will be converted into a JSON object, + // and the "@type" field will be inserted to indicate the actual data type." + md := m.Descriptor() + typeURL := m.Get(md.Fields().ByNumber(1)).String() + rawVal := m.Get(md.Fields().ByNumber(2)).Bytes() + + var m2 protoreflect.Message + if w.AnyResolver != nil { + mi, err := w.AnyResolver.Resolve(typeURL) + if err != nil { + return err + } + m2 = proto.MessageReflect(mi) + } else { + mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) + if err != nil { + return err + } + m2 = mt.New() + } + + if err := protoV2.Unmarshal(rawVal, m2.Interface()); err != nil { + return err + } + + if wellKnownType(m2.Descriptor().FullName()) == "" { + return w.marshalMessage(m2, indent, typeURL) + } + + w.write("{") + if w.Indent != "" { + w.write("\n") + } + if err := w.marshalTypeURL(indent, typeURL); err != nil { + return err + } + w.writeComma() + if w.Indent != "" { + w.write(indent) + w.write(w.Indent) + w.write(`"value": `) + } else { + w.write(`"value":`) + } + if err := w.marshalMessage(m2, indent+w.Indent, ""); err != nil { + return err + } + if w.Indent != "" { + w.write("\n") + w.write(indent) + } + w.write("}") + return nil +} + +func (w *jsonWriter) marshalTypeURL(indent, typeURL string) error { + if w.Indent != "" { + w.write(indent) + w.write(w.Indent) + } + w.write(`"@type":`) + if w.Indent != "" { + w.write(" ") + } + b, err := json.Marshal(typeURL) + if err != nil { + return err + } + w.write(string(b)) + return nil +} + +// marshalField writes field description and value to the Writer. +func (w *jsonWriter) marshalField(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { + if w.Indent != "" { + w.write(indent) + w.write(w.Indent) + } + w.write(`"`) + switch { + case fd.IsExtension(): + // For message set, use the fname of the message as the extension name. + name := string(fd.FullName()) + if isMessageSet(fd.ContainingMessage()) { + name = strings.TrimSuffix(name, ".message_set_extension") + } + + w.write("[" + name + "]") + case w.OrigName: + name := string(fd.Name()) + if fd.Kind() == protoreflect.GroupKind { + name = string(fd.Message().Name()) + } + w.write(name) + default: + w.write(string(fd.JSONName())) + } + w.write(`":`) + if w.Indent != "" { + w.write(" ") + } + return w.marshalValue(fd, v, indent) +} + +func (w *jsonWriter) marshalValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { + switch { + case fd.IsList(): + w.write("[") + comma := "" + lv := v.List() + for i := 0; i < lv.Len(); i++ { + w.write(comma) + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + w.write(w.Indent) + } + if err := w.marshalSingularValue(fd, lv.Get(i), indent+w.Indent); err != nil { + return err + } + comma = "," + } + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + } + w.write("]") + return nil + case fd.IsMap(): + kfd := fd.MapKey() + vfd := fd.MapValue() + mv := v.Map() + + // Collect a sorted list of all map keys and values. + type entry struct{ key, val protoreflect.Value } + var entries []entry + mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { + entries = append(entries, entry{k.Value(), v}) + return true + }) + sort.Slice(entries, func(i, j int) bool { + switch kfd.Kind() { + case protoreflect.BoolKind: + return !entries[i].key.Bool() && entries[j].key.Bool() + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + return entries[i].key.Int() < entries[j].key.Int() + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + return entries[i].key.Uint() < entries[j].key.Uint() + case protoreflect.StringKind: + return entries[i].key.String() < entries[j].key.String() + default: + panic("invalid kind") + } + }) + + w.write(`{`) + comma := "" + for _, entry := range entries { + w.write(comma) + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + w.write(w.Indent) + } + + s := fmt.Sprint(entry.key.Interface()) + b, err := json.Marshal(s) + if err != nil { + return err + } + w.write(string(b)) + + w.write(`:`) + if w.Indent != "" { + w.write(` `) + } + + if err := w.marshalSingularValue(vfd, entry.val, indent+w.Indent); err != nil { + return err + } + comma = "," + } + if w.Indent != "" { + w.write("\n") + w.write(indent) + w.write(w.Indent) + } + w.write(`}`) + return nil + default: + return w.marshalSingularValue(fd, v, indent) + } +} + +func (w *jsonWriter) marshalSingularValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { + switch { + case !v.IsValid(): + w.write("null") + return nil + case fd.Message() != nil: + return w.marshalMessage(v.Message(), indent+w.Indent, "") + case fd.Enum() != nil: + if fd.Enum().FullName() == "google.protobuf.NullValue" { + w.write("null") + return nil + } + + vd := fd.Enum().Values().ByNumber(v.Enum()) + if vd == nil || w.EnumsAsInts { + w.write(strconv.Itoa(int(v.Enum()))) + } else { + w.write(`"` + string(vd.Name()) + `"`) + } + return nil + default: + switch v.Interface().(type) { + case float32, float64: + switch { + case math.IsInf(v.Float(), +1): + w.write(`"Infinity"`) + return nil + case math.IsInf(v.Float(), -1): + w.write(`"-Infinity"`) + return nil + case math.IsNaN(v.Float()): + w.write(`"NaN"`) + return nil + } + case int64, uint64: + w.write(fmt.Sprintf(`"%d"`, v.Interface())) + return nil + } + + b, err := json.Marshal(v.Interface()) + if err != nil { + return err + } + w.write(string(b)) + return nil + } +} diff --git a/vendor/github.com/golang/protobuf/jsonpb/json.go b/vendor/github.com/golang/protobuf/jsonpb/json.go new file mode 100644 index 000000000..480e2448d --- /dev/null +++ b/vendor/github.com/golang/protobuf/jsonpb/json.go @@ -0,0 +1,69 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package jsonpb provides functionality to marshal and unmarshal between a +// protocol buffer message and JSON. It follows the specification at +// https://developers.google.com/protocol-buffers/docs/proto3#json. +// +// Do not rely on the default behavior of the standard encoding/json package +// when called on generated message types as it does not operate correctly. +// +// Deprecated: Use the "google.golang.org/protobuf/encoding/protojson" +// package instead. +package jsonpb + +import ( + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/runtime/protoimpl" +) + +// AnyResolver takes a type URL, present in an Any message, +// and resolves it into an instance of the associated message. +type AnyResolver interface { + Resolve(typeURL string) (proto.Message, error) +} + +type anyResolver struct{ AnyResolver } + +func (r anyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { + return r.FindMessageByURL(string(message)) +} + +func (r anyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { + m, err := r.Resolve(url) + if err != nil { + return nil, err + } + return protoimpl.X.MessageTypeOf(m), nil +} + +func (r anyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { + return protoregistry.GlobalTypes.FindExtensionByName(field) +} + +func (r anyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { + return protoregistry.GlobalTypes.FindExtensionByNumber(message, field) +} + +func wellKnownType(s protoreflect.FullName) string { + if s.Parent() == "google.protobuf" { + switch s.Name() { + case "Empty", "Any", + "BoolValue", "BytesValue", "StringValue", + "Int32Value", "UInt32Value", "FloatValue", + "Int64Value", "UInt64Value", "DoubleValue", + "Duration", "Timestamp", + "NullValue", "Struct", "Value", "ListValue": + return string(s.Name()) + } + } + return "" +} + +func isMessageSet(md protoreflect.MessageDescriptor) bool { + ms, ok := md.(interface{ IsMessageSet() bool }) + return ok && ms.IsMessageSet() +} diff --git a/vendor/github.com/google/go-cmp/cmp/compare.go b/vendor/github.com/google/go-cmp/cmp/compare.go index 2a5446762..fd2b3a42b 100644 --- a/vendor/github.com/google/go-cmp/cmp/compare.go +++ b/vendor/github.com/google/go-cmp/cmp/compare.go @@ -40,6 +40,8 @@ import ( "github.com/google/go-cmp/cmp/internal/value" ) +// TODO(≥go1.18): Use any instead of interface{}. + // Equal reports whether x and y are equal by recursively applying the // following rules in the given order to x and y and all of their sub-values: // diff --git a/vendor/github.com/google/go-cmp/cmp/report_compare.go b/vendor/github.com/google/go-cmp/cmp/report_compare.go index 104bb3053..1ef65ac1d 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -116,7 +116,10 @@ func (opts formatOptions) FormatDiff(v *valueNode, ptrs *pointerReferences) (out } // For leaf nodes, format the value based on the reflect.Values alone. - if v.MaxDepth == 0 { + // As a special case, treat equal []byte as a leaf nodes. + isBytes := v.Type.Kind() == reflect.Slice && v.Type.Elem() == reflect.TypeOf(byte(0)) + isEqualBytes := isBytes && v.NumDiff+v.NumIgnored+v.NumTransformed == 0 + if v.MaxDepth == 0 || isEqualBytes { switch opts.DiffMode { case diffUnknown, diffIdentical: // Format Equal. diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 76c04fdbd..287b89358 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -211,7 +211,7 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, if len(b) > 0 && utf8.Valid(b) && len(bytes.TrimFunc(b, isPrintSpace)) == 0 { out = opts.formatString("", string(b)) skipType = true - return opts.WithTypeMode(emitType).FormatType(t, out) + return opts.FormatType(t, out) } } @@ -282,7 +282,12 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } defer ptrs.Pop() - skipType = true // Let the underlying value print the type instead + // Skip the name only if this is an unnamed pointer type. + // Otherwise taking the address of a value does not reproduce + // the named pointer type. + if v.Type().Name() == "" { + skipType = true // Let the underlying value print the type instead + } out = opts.FormatValue(v.Elem(), t.Kind(), ptrs) out = wrapTrunkReference(ptrRef, opts.PrintAddresses, out) out = &textWrap{Prefix: "&", Value: out} @@ -293,7 +298,6 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } // Interfaces accept different concrete types, // so configure the underlying value to explicitly print the type. - skipType = true // Print the concrete type instead return opts.WithTypeMode(emitType).FormatValue(v.Elem(), t.Kind(), ptrs) default: panic(fmt.Sprintf("%v kind not handled", v.Kind())) diff --git a/vendor/github.com/hashicorp/go-plugin/README.md b/vendor/github.com/hashicorp/go-plugin/README.md index 46ee09fc0..39391f24f 100644 --- a/vendor/github.com/hashicorp/go-plugin/README.md +++ b/vendor/github.com/hashicorp/go-plugin/README.md @@ -3,8 +3,9 @@ `go-plugin` is a Go (golang) plugin system over RPC. It is the plugin system that has been in use by HashiCorp tooling for over 4 years. While initially created for [Packer](https://www.packer.io), it is additionally in use by -[Terraform](https://www.terraform.io), [Nomad](https://www.nomadproject.io), and -[Vault](https://www.vaultproject.io). +[Terraform](https://www.terraform.io), [Nomad](https://www.nomadproject.io), +[Vault](https://www.vaultproject.io), and +[Boundary](https://www.boundaryproject.io). While the plugin system is over RPC, it is currently only designed to work over a local [reliable] network. Plugins over a real network are not supported diff --git a/vendor/github.com/hashicorp/go-plugin/client.go b/vendor/github.com/hashicorp/go-plugin/client.go index 67dca8835..e0bee88a1 100644 --- a/vendor/github.com/hashicorp/go-plugin/client.go +++ b/vendor/github.com/hashicorp/go-plugin/client.go @@ -574,6 +574,8 @@ func (c *Client) Start() (addr net.Addr, err error) { c.config.TLSConfig = &tls.Config{ Certificates: []tls.Certificate{cert}, + ClientAuth: tls.RequireAndVerifyClientCert, + MinVersion: tls.VersionTLS12, ServerName: "localhost", } } @@ -629,17 +631,19 @@ func (c *Client) Start() (addr net.Addr, err error) { // Wait for the command to end. err := cmd.Wait() - debugMsgArgs := []interface{}{ + msgArgs := []interface{}{ "path", path, "pid", pid, } if err != nil { - debugMsgArgs = append(debugMsgArgs, + msgArgs = append(msgArgs, []interface{}{"error", err.Error()}...) + c.logger.Error("plugin process exited", msgArgs...) + } else { + // Log and make sure to flush the logs right away + c.logger.Info("plugin process exited", msgArgs...) } - // Log and make sure to flush the logs write away - c.logger.Debug("plugin process exited", debugMsgArgs...) os.Stderr.Sync() // Set that we exited, which takes a lock @@ -774,7 +778,7 @@ func (c *Client) Start() (addr net.Addr, err error) { } // loadServerCert is used by AutoMTLS to read an x.509 cert returned by the -// server, and load it as the RootCA for the client TLSConfig. +// server, and load it as the RootCA and ClientCA for the client TLSConfig. func (c *Client) loadServerCert(cert string) error { certPool := x509.NewCertPool() @@ -791,6 +795,7 @@ func (c *Client) loadServerCert(cert string) error { certPool.AddCert(x509Cert) c.config.TLSConfig.RootCAs = certPool + c.config.TLSConfig.ClientCAs = certPool return nil } diff --git a/vendor/github.com/hashicorp/go-plugin/go.mod b/vendor/github.com/hashicorp/go-plugin/go.mod index 4e182e625..f28852215 100644 --- a/vendor/github.com/hashicorp/go-plugin/go.mod +++ b/vendor/github.com/hashicorp/go-plugin/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/go-plugin -go 1.13 +go 1.17 require ( github.com/golang/protobuf v1.3.4 @@ -9,7 +9,16 @@ require ( github.com/jhump/protoreflect v1.6.0 github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 github.com/oklog/run v1.0.0 - github.com/stretchr/testify v1.3.0 // indirect golang.org/x/net v0.0.0-20190311183353-d8887717615a google.golang.org/grpc v1.27.1 ) + +require ( + github.com/fatih/color v1.7.0 // indirect + github.com/mattn/go-colorable v0.1.4 // indirect + github.com/mattn/go-isatty v0.0.10 // indirect + github.com/stretchr/testify v1.3.0 // indirect + golang.org/x/sys v0.0.0-20191008105621-543471e840be // indirect + golang.org/x/text v0.3.0 // indirect + google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect +) diff --git a/vendor/github.com/hashicorp/go-plugin/go.sum b/vendor/github.com/hashicorp/go-plugin/go.sum index 56062044e..93d2905cd 100644 --- a/vendor/github.com/hashicorp/go-plugin/go.sum +++ b/vendor/github.com/hashicorp/go-plugin/go.sum @@ -2,7 +2,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -13,7 +12,6 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -50,7 +48,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= @@ -60,7 +57,6 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= @@ -74,7 +70,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= diff --git a/vendor/github.com/hashicorp/go-plugin/process_posix.go b/vendor/github.com/hashicorp/go-plugin/process_posix.go index 70ba546bf..185957f8d 100644 --- a/vendor/github.com/hashicorp/go-plugin/process_posix.go +++ b/vendor/github.com/hashicorp/go-plugin/process_posix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package plugin diff --git a/vendor/github.com/hashicorp/go-plugin/rpc_server.go b/vendor/github.com/hashicorp/go-plugin/rpc_server.go index 5bb18dd5d..449ba6cc1 100644 --- a/vendor/github.com/hashicorp/go-plugin/rpc_server.go +++ b/vendor/github.com/hashicorp/go-plugin/rpc_server.go @@ -45,7 +45,11 @@ func (s *RPCServer) Serve(lis net.Listener) { for { conn, err := lis.Accept() if err != nil { - log.Printf("[ERR] plugin: plugin server: %s", err) + severity := "ERR" + if errors.Is(err, net.ErrClosed) { + severity = "DEBUG" + } + log.Printf("[%s] plugin: plugin server: %s", severity, err) return } diff --git a/vendor/github.com/hashicorp/go-plugin/server.go b/vendor/github.com/hashicorp/go-plugin/server.go index 7a58cc391..e13499910 100644 --- a/vendor/github.com/hashicorp/go-plugin/server.go +++ b/vendor/github.com/hashicorp/go-plugin/server.go @@ -304,13 +304,13 @@ func Serve(opts *ServeConfig) { certPEM, keyPEM, err := generateCert() if err != nil { - logger.Error("failed to generate client certificate", "error", err) + logger.Error("failed to generate server certificate", "error", err) panic(err) } cert, err := tls.X509KeyPair(certPEM, keyPEM) if err != nil { - logger.Error("failed to parse client certificate", "error", err) + logger.Error("failed to parse server certificate", "error", err) panic(err) } @@ -319,6 +319,8 @@ func Serve(opts *ServeConfig) { ClientAuth: tls.RequireAndVerifyClientCert, ClientCAs: clientCertPool, MinVersion: tls.VersionTLS12, + RootCAs: clientCertPool, + ServerName: "localhost", } // We send back the raw leaf cert data for the client rather than the diff --git a/vendor/github.com/hashicorp/go-uuid/LICENSE b/vendor/github.com/hashicorp/go-uuid/LICENSE index e87a115e4..a320b309c 100644 --- a/vendor/github.com/hashicorp/go-uuid/LICENSE +++ b/vendor/github.com/hashicorp/go-uuid/LICENSE @@ -1,3 +1,5 @@ +Copyright © 2015-2022 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md index 02b95669b..aa6faaf2f 100644 --- a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md +++ b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md @@ -1,13 +1,25 @@ # HCL Changelog -## v2.11.1 (Dec 1, 2021) +## v2.12.0 (April 22, 2022) + +### Enhancements + +* hclsyntax: Evaluation of conditional expressions will now produce more precise error messages about inconsistencies between the types of the true and false result expressions, particularly in cases where both are of the same structural type kind but differ in their nested elements. ([#530](https://github.com/hashicorp/hcl/pull/530)) +* hclsyntax: The lexer will no longer allocate a small object on the heap for each token. Instead, in that situation it will allocate only when needed to return a diagnostic message with source location information. ([#490](https://github.com/hashicorp/hcl/pull/490)) +* hclwrite: New functions `TokensForTuple`, `TokensForObject`, and `TokensForFunctionCall` allow for more easily constructing the three constructs which are supported for static analysis and which HCL-based languages typically use in contexts where an expression is used only for its syntax, and not evaluated to produce a real value. For example, these new functions together are sufficient to construct all valid type constraint expressions from [the Type Expressions Extension](./ext/typeexpr/), which is the basis of variable type constraints in the Terraform language at the time of writing. ([#502](https://github.com/hashicorp/hcl/pull/502)) +* json: New functions `IsJSONExpression` and `IsJSONBody` to determine if a given expression or body was created by the JSON syntax parser. In normal situations it's better not to worry about what syntax a particular expression/body originated in, but this can be useful in some trickier cases where an application needs to shim for backwards-compatibility or for static analysis that needs to have special handling of the JSON syntax's embedded expression/template conventions. ([#524](https://github.com/hashicorp/hcl/pull/524)) ### Bugs Fixed -* hclsyntax: The type for an upgraded unknown value with a splat expression cannot be known ([#495](https://github.com/hashicorp/hcl/pull/495)) +* gohcl: Fix docs about supported types for blocks. ([#507](https://github.com/hashicorp/hcl/pull/507)) +## v2.11.1 (December 1, 2021) + +### Bugs Fixed + +* hclsyntax: The type for an upgraded unknown value with a splat expression cannot be known ([#495](https://github.com/hashicorp/hcl/pull/495)) -## v2.11.0 (Dec 1, 2021) +## v2.11.0 (December 1, 2021) ### Enhancements diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go index 07464a6b6..2706998f8 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go @@ -2,6 +2,7 @@ package hclsyntax import ( "fmt" + "sort" "sync" "github.com/hashicorp/hcl/v2" @@ -615,12 +616,8 @@ func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostic Severity: hcl.DiagError, Summary: "Inconsistent conditional result types", Detail: fmt.Sprintf( - // FIXME: Need a helper function for showing natural-language type diffs, - // since this will generate some useless messages in some cases, like - // "These expressions are object and object respectively" if the - // object types don't exactly match. - "The true and false result expressions must have consistent types. The given expressions are %s and %s, respectively.", - trueResult.Type().FriendlyName(), falseResult.Type().FriendlyName(), + "The true and false result expressions must have consistent types. %s.", + describeConditionalTypeMismatch(trueResult.Type(), falseResult.Type()), ), Subject: hcl.RangeBetween(e.TrueResult.Range(), e.FalseResult.Range()).Ptr(), Context: &e.SrcRange, @@ -652,7 +649,7 @@ func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostic diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect condition type", - Detail: fmt.Sprintf("The condition expression must be of type bool."), + Detail: "The condition expression must be of type bool.", Subject: e.Condition.Range().Ptr(), Context: &e.SrcRange, Expression: e.Condition, @@ -712,6 +709,144 @@ func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostic } } +// describeConditionalTypeMismatch makes a best effort to describe the +// difference between types in the true and false arms of a conditional +// expression in a way that would be useful to someone trying to understand +// why their conditional expression isn't valid. +// +// NOTE: This function is only designed to deal with situations +// where trueTy and falseTy are different. Calling it with two equal +// types will produce a nonsense result. This function also only really +// deals with situations that type unification can't resolve, so we should +// call this function only after trying type unification first. +func describeConditionalTypeMismatch(trueTy, falseTy cty.Type) string { + // The main tricky cases here are when both trueTy and falseTy are + // of the same structural type kind, such as both being object types + // or both being tuple types. In that case the "FriendlyName" method + // returns only "object" or "tuple" and so we need to do some more + // work to describe what's different inside them. + + switch { + case trueTy.IsObjectType() && falseTy.IsObjectType(): + // We'll first gather up the attribute names and sort them. In the + // event that there are multiple attributes that disagree across + // the two types, we'll prefer to report the one that sorts lexically + // least just so that our error message is consistent between + // evaluations. + var trueAttrs, falseAttrs []string + for name := range trueTy.AttributeTypes() { + trueAttrs = append(trueAttrs, name) + } + sort.Strings(trueAttrs) + for name := range falseTy.AttributeTypes() { + falseAttrs = append(falseAttrs, name) + } + sort.Strings(falseAttrs) + + for _, name := range trueAttrs { + if !falseTy.HasAttribute(name) { + return fmt.Sprintf("The 'true' value includes object attribute %q, which is absent in the 'false' value", name) + } + trueAty := trueTy.AttributeType(name) + falseAty := falseTy.AttributeType(name) + if !trueAty.Equals(falseAty) { + // For deeply-nested differences this will likely get very + // clunky quickly by nesting these messages inside one another, + // but we'll accept that for now in the interests of producing + // _some_ useful feedback, even if it isn't as concise as + // we'd prefer it to be. Deeply-nested structures in + // conditionals are thankfully not super common. + return fmt.Sprintf( + "Type mismatch for object attribute %q: %s", + name, describeConditionalTypeMismatch(trueAty, falseAty), + ) + } + } + for _, name := range falseAttrs { + if !trueTy.HasAttribute(name) { + return fmt.Sprintf("The 'false' value includes object attribute %q, which is absent in the 'true' value", name) + } + // NOTE: We don't need to check the attribute types again, because + // any attribute that both types have in common would already have + // been checked in the previous loop. + } + case trueTy.IsTupleType() && falseTy.IsTupleType(): + trueEtys := trueTy.TupleElementTypes() + falseEtys := falseTy.TupleElementTypes() + + if trueCount, falseCount := len(trueEtys), len(falseEtys); trueCount != falseCount { + return fmt.Sprintf("The 'true' tuple has length %d, but the 'false' tuple has length %d", trueCount, falseCount) + } + + // NOTE: Thanks to the condition above, we know that both tuples are + // of the same length and so they must have some differing types + // instead. + for i := range trueEtys { + trueEty := trueEtys[i] + falseEty := falseEtys[i] + + if !trueEty.Equals(falseEty) { + // For deeply-nested differences this will likely get very + // clunky quickly by nesting these messages inside one another, + // but we'll accept that for now in the interests of producing + // _some_ useful feedback, even if it isn't as concise as + // we'd prefer it to be. Deeply-nested structures in + // conditionals are thankfully not super common. + return fmt.Sprintf( + "Type mismatch for tuple element %d: %s", + i, describeConditionalTypeMismatch(trueEty, falseEty), + ) + } + } + case trueTy.IsCollectionType() && falseTy.IsCollectionType(): + // For this case we're specifically interested in the situation where: + // - both collections are of the same kind, AND + // - the element types of both are either object or tuple types. + // This is just to avoid writing a useless statement like + // "The 'true' value is list of object, but the 'false' value is list of object". + // This still doesn't account for more awkward cases like collections + // of collections of structural types, but we won't let perfect be + // the enemy of the good. + trueEty := trueTy.ElementType() + falseEty := falseTy.ElementType() + if (trueTy.IsListType() && falseTy.IsListType()) || (trueTy.IsMapType() && falseTy.IsMapType()) || (trueTy.IsSetType() && falseTy.IsSetType()) { + if (trueEty.IsObjectType() && falseEty.IsObjectType()) || (trueEty.IsTupleType() && falseEty.IsTupleType()) { + noun := "collection" + switch { // NOTE: We now know that trueTy and falseTy have the same collection kind + case trueTy.IsListType(): + noun = "list" + case trueTy.IsSetType(): + noun = "set" + case trueTy.IsMapType(): + noun = "map" + } + return fmt.Sprintf( + "Mismatched %s element types: %s", + noun, describeConditionalTypeMismatch(trueEty, falseEty), + ) + } + } + } + + // If we don't manage any more specialized message, we'll just report + // what the two types are. + trueName := trueTy.FriendlyName() + falseName := falseTy.FriendlyName() + if trueName == falseName { + // Absolute last resort for when we have no special rule above but + // we have two types with the same friendly name anyway. This is + // the most vague of all possible messages but is reserved for + // particularly awkward cases, like lists of lists of differing tuple + // types. + return "At least one deeply-nested attribute or element is not compatible across both the 'true' and the 'false' value" + } + return fmt.Sprintf( + "The 'true' value is %s, but the 'false' value is %s", + trueTy.FriendlyName(), falseTy.FriendlyName(), + ) + +} + func (e *ConditionalExpr) Range() hcl.Range { return e.SrcRange } diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go index 287e8293c..ec83d3dc2 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go @@ -167,8 +167,6 @@ func (p *parser) ParseBodyItem() (Node, hcl.Diagnostics) { }, } } - - return nil, nil } // parseSingleAttrBody is a weird variant of ParseBody that deals with the diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go index f4c6c9342..5ef093f9a 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go @@ -191,8 +191,10 @@ func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { toldBadUTF8 := 0 for _, tok := range tokens { - // copy token so it's safe to point to it - tok := tok + tokRange := func() *hcl.Range { + r := tok.Range + return &r + } switch tok.Type { case TokenBitwiseAnd, TokenBitwiseOr, TokenBitwiseXor, TokenBitwiseNot: @@ -211,7 +213,7 @@ func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { Severity: hcl.DiagError, Summary: "Unsupported operator", Detail: fmt.Sprintf("Bitwise operators are not supported.%s", suggestion), - Subject: &tok.Range, + Subject: tokRange(), }) toldBitwise++ } @@ -221,7 +223,7 @@ func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { Severity: hcl.DiagError, Summary: "Unsupported operator", Detail: "\"**\" is not a supported operator. Exponentiation is not supported as an operator.", - Subject: &tok.Range, + Subject: tokRange(), }) toldExponent++ @@ -234,7 +236,7 @@ func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { Severity: hcl.DiagError, Summary: "Invalid character", Detail: "The \"`\" character is not valid. To create a multi-line string, use the \"heredoc\" syntax, like \"<= 0 { + y := bytes.IndexByte(line[x:], ']') + if y >= 0 { + level = LogLevel(line[x+1 : x+y]) + } + } + + _, ok := f.badLevels[level] + return !ok +} + +func (f *LevelFilter) Write(p []byte) (n int, err error) { + // Note in general that io.Writer can receive any byte sequence + // to write, but the "log" package always guarantees that we only + // get a single line. We use that as a slight optimization within + // this method, assuming we're dealing with a single, complete line + // of log data. + + if !f.Check(p) { + return len(p), nil + } + + return f.Writer.Write(p) +} + +// SetMinLevel is used to update the minimum log level +func (f *LevelFilter) SetMinLevel(min LogLevel) { + f.MinLevel = min + f.init() +} + +func (f *LevelFilter) init() { + badLevels := make(map[LogLevel]struct{}) + for _, level := range f.Levels { + if level == f.MinLevel { + break + } + badLevels[level] = struct{}{} + } + f.badLevels = badLevels +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/context.go b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/context.go new file mode 100644 index 000000000..a35258a8e --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/context.go @@ -0,0 +1,82 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/go-uuid" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-log/tfsdklog" +) + +// DataSourceContext injects the data source type into logger contexts. +func DataSourceContext(ctx context.Context, dataSource string) context.Context { + ctx = tfsdklog.With(ctx, KeyDataSourceType, dataSource) + ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyDataSourceType, dataSource) + ctx = tflog.With(ctx, KeyDataSourceType, dataSource) + + return ctx +} + +// InitContext creates SDK and provider logger contexts. +func InitContext(ctx context.Context, sdkOpts tfsdklog.Options, providerOpts tflog.Options) context.Context { + ctx = tfsdklog.NewRootSDKLogger(ctx, append(tfsdklog.Options{ + tfsdklog.WithLevelFromEnv(EnvTfLogSdk), + }, sdkOpts...)...) + ctx = tfsdklog.NewSubsystem(ctx, SubsystemProto, append(tfsdklog.Options{ + // All calls are through the Protocol* helper functions + tfsdklog.WithAdditionalLocationOffset(1), + tfsdklog.WithLevelFromEnv(EnvTfLogSdkProto), + }, sdkOpts...)...) + ctx = tfsdklog.NewRootProviderLogger(ctx, providerOpts...) + + return ctx +} + +// ProtocolVersionContext injects the protocol version into logger contexts. +func ProtocolVersionContext(ctx context.Context, protocolVersion string) context.Context { + ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyProtocolVersion, protocolVersion) + + return ctx +} + +// ProviderAddressContext injects the provider address into logger contexts. +func ProviderAddressContext(ctx context.Context, providerAddress string) context.Context { + ctx = tfsdklog.With(ctx, KeyProviderAddress, providerAddress) + ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyProviderAddress, providerAddress) + ctx = tflog.With(ctx, KeyProviderAddress, providerAddress) + + return ctx +} + +// RequestIdContext injects a unique request ID into logger contexts. +func RequestIdContext(ctx context.Context) context.Context { + reqID, err := uuid.GenerateUUID() + + if err != nil { + reqID = "unable to assign request ID: " + err.Error() + } + + ctx = tfsdklog.With(ctx, KeyRequestID, reqID) + ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyRequestID, reqID) + ctx = tflog.With(ctx, KeyRequestID, reqID) + + return ctx +} + +// ResourceContext injects the resource type into logger contexts. +func ResourceContext(ctx context.Context, resource string) context.Context { + ctx = tfsdklog.With(ctx, KeyResourceType, resource) + ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyResourceType, resource) + ctx = tflog.With(ctx, KeyResourceType, resource) + + return ctx +} + +// RpcContext injects the RPC name into logger contexts. +func RpcContext(ctx context.Context, rpc string) context.Context { + ctx = tfsdklog.With(ctx, KeyRPC, rpc) + ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyRPC, rpc) + ctx = tflog.With(ctx, KeyRPC, rpc) + + return ctx +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/doc.go b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/doc.go new file mode 100644 index 000000000..cc1a033e6 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/doc.go @@ -0,0 +1,2 @@ +// Package logging contains shared environment variable and log functionality. +package logging diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/environment_variables.go b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/environment_variables.go new file mode 100644 index 000000000..49b8072c8 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/environment_variables.go @@ -0,0 +1,22 @@ +package logging + +// Environment variables. +const ( + // EnvTfLogProvider is the prefix of the environment variable that sets the + // logging level of the root provider logger for the provider being served. + // The suffix is an underscore and the parsed provider name. For example, + // registry.terraform.io/hashicorp/example becomes TF_LOG_PROVIDER_EXAMPLE. + EnvTfLogProvider = "TF_LOG_PROVIDER" + + // EnvTfLogSdk is an environment variable that sets the root logging level + // of SDK loggers. + EnvTfLogSdk = "TF_LOG_SDK" + + // EnvTfLogSdkProto is an environment variable that sets the logging level + // of SDK protocol loggers. Infers root SDK logging level, if unset. + EnvTfLogSdkProto = "TF_LOG_SDK_PROTO" + + // EnvTfLogSdkProtoDataDir is an environment variable that sets the + // directory to write raw protocol data files for debugging purposes. + EnvTfLogSdkProtoDataDir = "TF_LOG_SDK_PROTO_DATA_DIR" +) diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/keys.go b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/keys.go new file mode 100644 index 000000000..3d7af9611 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/keys.go @@ -0,0 +1,32 @@ +package logging + +// Global logging keys attached to all requests. +// +// Practitioners or tooling reading logs may be depending on these keys, so be +// conscious of that when changing them. +const ( + // Underlying error string + KeyError = "error" + + // A unique ID for the RPC request + KeyRequestID = "tf_req_id" + + // The full address of the provider, such as + // registry.terraform.io/hashicorp/random + KeyProviderAddress = "tf_provider_addr" + + // The RPC being run, such as "ApplyResourceChange" + KeyRPC = "tf_rpc" + + // The type of resource being operated on, such as "random_pet" + KeyResourceType = "tf_resource_type" + + // The type of data source being operated on, such as "archive_file" + KeyDataSourceType = "tf_data_source_type" + + // Path to protocol data file, such as "/tmp/example.json" + KeyProtocolDataFile = "tf_proto_data_file" + + // The protocol version being used, as a string, such as "6" + KeyProtocolVersion = "tf_proto_version" +) diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol.go b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol.go new file mode 100644 index 000000000..9f9c2808c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol.go @@ -0,0 +1,22 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tfsdklog" +) + +const ( + // SubsystemProto is the tfsdklog subsystem name for protocol logging. + SubsystemProto = "proto" +) + +// ProtocolError emits a protocol subsystem log at ERROR level. +func ProtocolError(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemError(ctx, SubsystemProto, msg, additionalFields...) +} + +// ProtocolTrace emits a protocol subsystem log at TRACE level. +func ProtocolTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemTrace(ctx, SubsystemProto, msg, additionalFields...) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol_data.go b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol_data.go new file mode 100644 index 000000000..630358232 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/protocol_data.go @@ -0,0 +1,108 @@ +package logging + +import ( + "context" + "fmt" + "os" + "path" + "sync" + "time" + + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" +) + +const ( + // fileExtEmpty is the file extension for empty data. + // Empty data may be expected, depending on the RPC. + fileExtEmpty = "empty" + + // fileExtJson is the file extension for JSON data. + fileExtJson = "json" + + // fileExtMsgpack is the file extension for MessagePack data. + fileExtMsgpack = "msgpack" +) + +var protocolDataSkippedLog sync.Once + +// ProtocolData emits raw protocol data to a file, if given a directory. +// +// The directory must exist and be writable, prior to invoking this function. +// +// File names are in the format: {TIME}_{RPC}_{MESSAGE}_{FIELD}.{EXT} +func ProtocolData(ctx context.Context, dataDir string, rpc string, message string, field string, data interface{}) { + if dataDir == "" { + // Write a log, only once, that explains how to enable this functionality. + protocolDataSkippedLog.Do(func() { + ProtocolTrace(ctx, "Skipping protocol data file writing because no data directory is set. "+ + fmt.Sprintf("Use the %s environment variable to enable this functionality.", EnvTfLogSdkProtoDataDir)) + }) + + return + } + + var fileContents []byte + var fileExtension string + + switch data := data.(type) { + case *tfprotov5.DynamicValue: + fileExtension, fileContents = protocolDataDynamicValue5(ctx, data) + case *tfprotov6.DynamicValue: + fileExtension, fileContents = protocolDataDynamicValue6(ctx, data) + default: + ProtocolError(ctx, fmt.Sprintf("Skipping unknown protocol data type: %T", data)) + return + } + + fileName := fmt.Sprintf("%d_%s_%s_%s.%s", time.Now().Unix(), rpc, message, field, fileExtension) + filePath := path.Join(dataDir, fileName) + logFields := map[string]interface{}{KeyProtocolDataFile: filePath} // should not be persisted using With() + + ProtocolTrace(ctx, "Writing protocol data file", logFields) + + err := os.WriteFile(filePath, fileContents, 0644) + + if err != nil { + ProtocolError(ctx, fmt.Sprintf("Unable to write protocol data file: %s", err), logFields) + return + } + + ProtocolTrace(ctx, "Wrote protocol data file", logFields) +} + +func protocolDataDynamicValue5(_ context.Context, value *tfprotov5.DynamicValue) (string, []byte) { + if value == nil { + return fileExtEmpty, nil + } + + // (tfprotov5.DynamicValue).Unmarshal() prefers JSON first, so prefer to + // output JSON if found. + if len(value.JSON) > 0 { + return fileExtJson, value.JSON + } + + if len(value.MsgPack) > 0 { + return fileExtMsgpack, value.MsgPack + } + + return fileExtEmpty, nil +} + +func protocolDataDynamicValue6(_ context.Context, value *tfprotov6.DynamicValue) (string, []byte) { + if value == nil { + return fileExtEmpty, nil + } + + // (tfprotov6.DynamicValue).Unmarshal() prefers JSON first, so prefer to + // output JSON if found. + if len(value.JSON) > 0 { + return fileExtJson, value.JSON + } + + if len(value.MsgPack) > 0 { + return fileExtMsgpack, value.MsgPack + } + + return fileExtEmpty, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/provider.go b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/provider.go new file mode 100644 index 000000000..6c68504c1 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/internal/logging/provider.go @@ -0,0 +1,19 @@ +package logging + +import ( + "log" + "strings" + + tfaddr "github.com/hashicorp/terraform-registry-address" +) + +func ProviderLoggerName(providerAddress string) string { + provider, err := tfaddr.ParseRawProviderSourceString(providerAddress) + + if err != nil { + log.Printf("[ERROR] Error parsing provider name %q: %s", providerAddress, err) + return "" + } + + return strings.ReplaceAll(provider.Type, "-", "_") +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/diagnostic.go index 04a39deb3..de0906e33 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/diagnostic.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/diagnostic.go @@ -1,6 +1,6 @@ package tfprotov5 -import "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" +import "github.com/hashicorp/terraform-plugin-go/tftypes" const ( // DiagnosticSeverityInvalid is used to indicate an invalid diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value.go index 951532cc5..71d5cc4e9 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value.go @@ -1,11 +1,9 @@ package tfprotov5 import ( - "bytes" "errors" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" - "github.com/vmihailenco/msgpack" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) // ErrUnknownDynamicValueType is returned when a DynamicValue has no MsgPack or @@ -80,12 +78,10 @@ type DynamicValue struct { // received from RPC requests. func (d DynamicValue) Unmarshal(typ tftypes.Type) (tftypes.Value, error) { if d.JSON != nil { - return jsonUnmarshal(d.JSON, typ, tftypes.AttributePath{}) + return tftypes.ValueFromJSON(d.JSON, typ) //nolint:staticcheck } if d.MsgPack != nil { - r := bytes.NewReader(d.MsgPack) - dec := msgpack.NewDecoder(r) - return msgpackUnmarshal(dec, typ, tftypes.AttributePath{}) + return tftypes.ValueFromMsgPack(d.MsgPack, typ) //nolint:staticcheck } return tftypes.Value{}, ErrUnknownDynamicValueType } diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_json.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_json.go deleted file mode 100644 index 0d3dbc259..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_json.go +++ /dev/null @@ -1,480 +0,0 @@ -package tfprotov5 - -import ( - "bytes" - "encoding/json" - "math/big" - "strings" - - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" -) - -func jsonByteDecoder(buf []byte) *json.Decoder { - r := bytes.NewReader(buf) - dec := json.NewDecoder(r) - dec.UseNumber() - return dec -} - -func jsonUnmarshal(buf []byte, typ tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - - if tok == nil { - return tftypes.NewValue(typ, nil), nil - } - - switch { - case typ.Is(tftypes.String): - return jsonUnmarshalString(buf, typ, p) - case typ.Is(tftypes.Number): - return jsonUnmarshalNumber(buf, typ, p) - case typ.Is(tftypes.Bool): - return jsonUnmarshalBool(buf, typ, p) - case typ.Is(tftypes.DynamicPseudoType): - return jsonUnmarshalDynamicPseudoType(buf, typ, p) - case typ.Is(tftypes.List{}): - return jsonUnmarshalList(buf, typ.(tftypes.List).ElementType, p) - case typ.Is(tftypes.Set{}): - return jsonUnmarshalSet(buf, typ.(tftypes.Set).ElementType, p) - - case typ.Is(tftypes.Map{}): - return jsonUnmarshalMap(buf, typ.(tftypes.Map).AttributeType, p) - case typ.Is(tftypes.Tuple{}): - return jsonUnmarshalTuple(buf, typ.(tftypes.Tuple).ElementTypes, p) - case typ.Is(tftypes.Object{}): - return jsonUnmarshalObject(buf, typ.(tftypes.Object).AttributeTypes, p) - } - return tftypes.Value{}, p.NewErrorf("unknown type %s", typ) -} - -func jsonUnmarshalString(buf []byte, typ tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - switch v := tok.(type) { - case string: - return tftypes.NewValue(tftypes.String, v), nil - case json.Number: - return tftypes.NewValue(tftypes.String, string(v)), nil - case bool: - if v { - return tftypes.NewValue(tftypes.String, "true"), nil - } - return tftypes.NewValue(tftypes.String, "false"), nil - } - return tftypes.Value{}, p.NewErrorf("unsupported type %T sent as %s", tok, tftypes.String) -} - -func jsonUnmarshalNumber(buf []byte, typ tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - switch numTok := tok.(type) { - case json.Number: - f, _, err := big.ParseFloat(string(numTok), 10, 512, big.ToNearestEven) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error parsing number: %w", err) - } - return tftypes.NewValue(typ, f), nil - case string: - f, _, err := big.ParseFloat(string(numTok), 10, 512, big.ToNearestEven) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error parsing number: %w", err) - } - return tftypes.NewValue(typ, f), nil - } - return tftypes.Value{}, p.NewErrorf("unsupported type %T sent as %s", tok, tftypes.Number) -} - -func jsonUnmarshalBool(buf []byte, typ tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - switch v := tok.(type) { - case bool: - return tftypes.NewValue(tftypes.Bool, v), nil - case string: - switch v { - case "true", "1": - return tftypes.NewValue(tftypes.Bool, true), nil - case "false", "0": - return tftypes.NewValue(tftypes.Bool, false), nil - } - switch strings.ToLower(string(v)) { - case "true": - return tftypes.Value{}, p.NewErrorf("to convert from string, use lowercase \"true\"") - case "false": - return tftypes.Value{}, p.NewErrorf("to convert from string, use lowercase \"false\"") - } - case json.Number: - switch v { - case "1": - return tftypes.NewValue(tftypes.Bool, true), nil - case "0": - return tftypes.NewValue(tftypes.Bool, false), nil - } - } - return tftypes.Value{}, p.NewErrorf("unsupported type %T sent as %s", tok, tftypes.Bool) -} - -func jsonUnmarshalDynamicPseudoType(buf []byte, typ tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('{') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('{'), tok) - } - var t tftypes.Type - var valBody []byte - for dec.More() { - tok, err = dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - key, ok := tok.(string) - if !ok { - return tftypes.Value{}, p.NewErrorf("expected key to be a string, got %T", tok) - } - var rawVal json.RawMessage - err = dec.Decode(&rawVal) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error decoding value: %w", err) - } - switch key { - case "type": - t, err = tftypes.ParseJSONType(rawVal) //nolint:staticcheck - if err != nil { - return tftypes.Value{}, p.NewErrorf("error decoding type information: %w", err) - } - case "value": - valBody = rawVal - default: - return tftypes.Value{}, p.NewErrorf("invalid key %q in dynamically-typed value", key) - } - } - tok, err = dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('}') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('}'), tok) - } - if t == nil { - return tftypes.Value{}, p.NewErrorf("missing type in dynamically-typed value") - } - if valBody == nil { - return tftypes.Value{}, p.NewErrorf("missing value in dynamically-typed value") - } - return jsonUnmarshal(valBody, t, p) -} - -func jsonUnmarshalList(buf []byte, elementType tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('[') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('['), tok) - } - - // we want to have a value for this always, even if there are no - // elements, because no elements is *technically* different than empty, - // and we want to preserve that distinction - // - // var vals []tftypes.Value - // would evaluate as nil if the list is empty - // - // while generally in Go it's undesirable to treat empty and nil slices - // separately, in this case we're surfacing a non-Go-in-origin - // distinction, so we'll allow it. - vals := []tftypes.Value{} - - var idx int64 - for dec.More() { - p.WithElementKeyInt(idx) - // update the index - idx++ - - var rawVal json.RawMessage - err = dec.Decode(&rawVal) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error decoding value: %w", err) - } - val, err := jsonUnmarshal(rawVal, elementType, p) - if err != nil { - return tftypes.Value{}, err - } - vals = append(vals, val) - p.WithoutLastStep() - } - - tok, err = dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim(']') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim(']'), tok) - } - - elTyp := elementType - if elTyp == tftypes.DynamicPseudoType { - elTyp, err = tftypes.TypeFromElements(vals) - if err != nil { - return tftypes.Value{}, p.NewErrorf("invalid elements for list: %w", err) - } - } - return tftypes.NewValue(tftypes.List{ - ElementType: elTyp, - }, vals), nil -} - -func jsonUnmarshalSet(buf []byte, elementType tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('[') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('['), tok) - } - - // we want to have a value for this always, even if there are no - // elements, because no elements is *technically* different than empty, - // and we want to preserve that distinction - // - // var vals []tftypes.Value - // would evaluate as nil if the set is empty - // - // while generally in Go it's undesirable to treat empty and nil slices - // separately, in this case we're surfacing a non-Go-in-origin - // distinction, so we'll allow it. - vals := []tftypes.Value{} - - for dec.More() { - p.WithElementKeyValue(tftypes.NewValue(elementType, tftypes.UnknownValue)) - var rawVal json.RawMessage - err = dec.Decode(&rawVal) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error decoding value: %w", err) - } - val, err := jsonUnmarshal(rawVal, elementType, p) - if err != nil { - return tftypes.Value{}, err - } - vals = append(vals, val) - p.WithoutLastStep() - } - tok, err = dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim(']') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim(']'), tok) - } - - elTyp := elementType - if elTyp == tftypes.DynamicPseudoType { - elTyp, err = tftypes.TypeFromElements(vals) - if err != nil { - return tftypes.Value{}, p.NewErrorf("invalid elements for list: %w", err) - } - } - return tftypes.NewValue(tftypes.Set{ - ElementType: elTyp, - }, vals), nil -} - -func jsonUnmarshalMap(buf []byte, attrType tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('{') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('{'), tok) - } - - vals := map[string]tftypes.Value{} - for dec.More() { - p.WithElementKeyValue(tftypes.NewValue(attrType, tftypes.UnknownValue)) - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - key, ok := tok.(string) - if !ok { - return tftypes.Value{}, p.NewErrorf("expected map key to be a string, got %T", tok) - } - - //fix the path value, we have an actual key now - p.WithoutLastStep() - p.WithElementKeyString(key) - - var rawVal json.RawMessage - err = dec.Decode(&rawVal) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error decoding value: %w", err) - } - val, err := jsonUnmarshal(rawVal, attrType, p) - if err != nil { - return tftypes.Value{}, err - } - vals[key] = val - p.WithoutLastStep() - } - tok, err = dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('}') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('}'), tok) - } - - return tftypes.NewValue(tftypes.Map{ - AttributeType: attrType, - }, vals), nil -} - -func jsonUnmarshalTuple(buf []byte, elementTypes []tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('[') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('['), tok) - } - - // we want to have a value for this always, even if there are no - // elements, because no elements is *technically* different than empty, - // and we want to preserve that distinction - // - // var vals []tftypes.Value - // would evaluate as nil if the tuple is empty - // - // while generally in Go it's undesirable to treat empty and nil slices - // separately, in this case we're surfacing a non-Go-in-origin - // distinction, so we'll allow it. - vals := []tftypes.Value{} - - var idx int64 - for dec.More() { - if idx >= int64(len(elementTypes)) { - return tftypes.Value{}, p.NewErrorf("too many tuple elements (only have types for %d)", len(elementTypes)) - } - - p.WithElementKeyInt(idx) - elementType := elementTypes[idx] - idx++ - - var rawVal json.RawMessage - err = dec.Decode(&rawVal) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error decoding value: %w", err) - } - val, err := jsonUnmarshal(rawVal, elementType, p) - if err != nil { - return tftypes.Value{}, err - } - vals = append(vals, val) - p.WithoutLastStep() - } - - tok, err = dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim(']') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim(']'), tok) - } - - if len(vals) != len(elementTypes) { - return tftypes.Value{}, p.NewErrorf("not enough tuple elements (only have %d, have types for %d)", len(vals), len(elementTypes)) - } - - return tftypes.NewValue(tftypes.Tuple{ - ElementTypes: elementTypes, - }, vals), nil -} - -func jsonUnmarshalObject(buf []byte, attrTypes map[string]tftypes.Type, p tftypes.AttributePath) (tftypes.Value, error) { - dec := jsonByteDecoder(buf) - - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('{') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('{'), tok) - } - - vals := map[string]tftypes.Value{} - for dec.More() { - p.WithElementKeyValue(tftypes.NewValue(tftypes.String, tftypes.UnknownValue)) - tok, err := dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - key, ok := tok.(string) - if !ok { - return tftypes.Value{}, p.NewErrorf("object attribute key was %T, not string", tok) - } - attrType, ok := attrTypes[key] - if !ok { - return tftypes.Value{}, p.NewErrorf("unsupported attribute %q", key) - } - p.WithoutLastStep() - p.WithAttributeName(key) - - var rawVal json.RawMessage - err = dec.Decode(&rawVal) - if err != nil { - return tftypes.Value{}, p.NewErrorf("error decoding value: %w", err) - } - val, err := jsonUnmarshal(rawVal, attrType, p) - if err != nil { - return tftypes.Value{}, err - } - vals[key] = val - p.WithoutLastStep() - } - - tok, err = dec.Token() - if err != nil { - return tftypes.Value{}, p.NewErrorf("error reading token: %w", err) - } - if tok != json.Delim('}') { - return tftypes.Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('}'), tok) - } - - // make sure we have a value for every attribute - for k, typ := range attrTypes { - if _, ok := vals[k]; !ok { - vals[k] = tftypes.NewValue(typ, nil) - } - } - - return tftypes.NewValue(tftypes.Object{ - AttributeTypes: attrTypes, - }, vals), nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_msgpack.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_msgpack.go deleted file mode 100644 index 45b78d79c..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/dynamic_value_msgpack.go +++ /dev/null @@ -1,327 +0,0 @@ -package tfprotov5 - -import ( - "math/big" - - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" - "github.com/vmihailenco/msgpack" - msgpackCodes "github.com/vmihailenco/msgpack/codes" -) - -func msgpackUnmarshal(dec *msgpack.Decoder, typ tftypes.Type, path tftypes.AttributePath) (tftypes.Value, error) { - peek, err := dec.PeekCode() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error peeking next byte: %w", err) - } - if msgpackCodes.IsExt(peek) { - // as with go-cty, assume all extensions are unknown values - err := dec.Skip() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error skipping extension byte: %w", err) - } - return tftypes.NewValue(typ, tftypes.UnknownValue), nil - } - if typ.Is(tftypes.DynamicPseudoType) { - return msgpackUnmarshalDynamic(dec, path) - } - if peek == msgpackCodes.Nil { - err := dec.Skip() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error skipping nil byte: %w", err) - } - return tftypes.NewValue(typ, nil), nil - } - - switch { - case typ.Is(tftypes.String): - rv, err := dec.DecodeString() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding string: %w", err) - } - return tftypes.NewValue(tftypes.String, rv), nil - case typ.Is(tftypes.Number): - peek, err := dec.PeekCode() - if err != nil { - return tftypes.Value{}, path.NewErrorf("couldn't peek number: %w", err) - } - if msgpackCodes.IsFixedNum(peek) { - rv, err := dec.DecodeInt64() - if err != nil { - return tftypes.Value{}, path.NewErrorf("couldn't decode number as int64: %w", err) - } - return tftypes.NewValue(tftypes.Number, big.NewFloat(float64(rv))), nil - } - switch peek { - case msgpackCodes.Int8, msgpackCodes.Int16, msgpackCodes.Int32, msgpackCodes.Int64: - rv, err := dec.DecodeInt64() - if err != nil { - return tftypes.Value{}, path.NewErrorf("couldn't decode number as int64: %w", err) - } - return tftypes.NewValue(tftypes.Number, big.NewFloat(float64(rv))), nil - case msgpackCodes.Uint8, msgpackCodes.Uint16, msgpackCodes.Uint32, msgpackCodes.Uint64: - rv, err := dec.DecodeUint64() - if err != nil { - return tftypes.Value{}, path.NewErrorf("couldn't decode number as uint64: %w", err) - } - return tftypes.NewValue(tftypes.Number, big.NewFloat(float64(rv))), nil - case msgpackCodes.Float, msgpackCodes.Double: - rv, err := dec.DecodeFloat64() - if err != nil { - return tftypes.Value{}, path.NewErrorf("couldn't decode number as float64: %w", err) - } - return tftypes.NewValue(tftypes.Number, big.NewFloat(float64(rv))), nil - default: - rv, err := dec.DecodeString() - if err != nil { - return tftypes.Value{}, path.NewErrorf("couldn't decode number as string: %w", err) - } - // according to - // https://github.com/hashicorp/go-cty/blob/85980079f637862fa8e43ddc82dd74315e2f4c85/cty/value_init.go#L49 - // Base 10, precision 512, and rounding to nearest even - // is the standard way to handle numbers arriving as - // strings. - fv, _, err := big.ParseFloat(rv, 10, 512, big.ToNearestEven) - if err != nil { - return tftypes.Value{}, path.NewErrorf("error parsing %q as number: %w", rv, err) - } - return tftypes.NewValue(tftypes.Number, fv), nil - } - case typ.Is(tftypes.Bool): - rv, err := dec.DecodeBool() - if err != nil { - return tftypes.Value{}, path.NewErrorf("couldn't decode bool: %w", err) - } - return tftypes.NewValue(tftypes.Bool, rv), nil - case typ.Is(tftypes.List{}): - return msgpackUnmarshalList(dec, typ.(tftypes.List).ElementType, path) - case typ.Is(tftypes.Set{}): - return msgpackUnmarshalSet(dec, typ.(tftypes.Set).ElementType, path) - case typ.Is(tftypes.Map{}): - return msgpackUnmarshalMap(dec, typ.(tftypes.Map).AttributeType, path) - case typ.Is(tftypes.Tuple{}): - return msgpackUnmarshalTuple(dec, typ.(tftypes.Tuple).ElementTypes, path) - case typ.Is(tftypes.Object{}): - return msgpackUnmarshalObject(dec, typ.(tftypes.Object).AttributeTypes, path) - } - return tftypes.Value{}, path.NewErrorf("unsupported type %s", typ.String()) -} - -func msgpackUnmarshalList(dec *msgpack.Decoder, typ tftypes.Type, path tftypes.AttributePath) (tftypes.Value, error) { - length, err := dec.DecodeArrayLen() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding list length: %w", err) - } - - switch { - case length < 0: - return tftypes.NewValue(tftypes.List{ - ElementType: typ, - }, nil), nil - case length == 0: - return tftypes.NewValue(tftypes.List{ - ElementType: typ, - }, []tftypes.Value{}), nil - } - - vals := make([]tftypes.Value, 0, length) - for i := 0; i < length; i++ { - path.WithElementKeyInt(int64(i)) - val, err := msgpackUnmarshal(dec, typ, path) - if err != nil { - return tftypes.Value{}, err - } - vals = append(vals, val) - path.WithoutLastStep() - } - - elTyp := typ - if elTyp == tftypes.DynamicPseudoType { - elTyp, err = tftypes.TypeFromElements(vals) - if err != nil { - return tftypes.Value{}, err - } - } - - return tftypes.NewValue(tftypes.List{ - ElementType: elTyp, - }, vals), nil -} - -func msgpackUnmarshalSet(dec *msgpack.Decoder, typ tftypes.Type, path tftypes.AttributePath) (tftypes.Value, error) { - length, err := dec.DecodeArrayLen() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding set length: %w", err) - } - - switch { - case length < 0: - return tftypes.NewValue(tftypes.Set{ - ElementType: typ, - }, nil), nil - case length == 0: - return tftypes.NewValue(tftypes.Set{ - ElementType: typ, - }, []tftypes.Value{}), nil - } - - vals := make([]tftypes.Value, 0, length) - for i := 0; i < length; i++ { - path.WithElementKeyInt(int64(i)) - val, err := msgpackUnmarshal(dec, typ, path) - if err != nil { - return tftypes.Value{}, err - } - vals = append(vals, val) - path.WithoutLastStep() - } - - elTyp, err := tftypes.TypeFromElements(vals) - if err != nil { - return tftypes.Value{}, err - } - - return tftypes.NewValue(tftypes.Set{ - ElementType: elTyp, - }, vals), nil -} - -func msgpackUnmarshalMap(dec *msgpack.Decoder, typ tftypes.Type, path tftypes.AttributePath) (tftypes.Value, error) { - length, err := dec.DecodeMapLen() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding map length: %w", err) - } - - switch { - case length < 0: - return tftypes.NewValue(tftypes.Map{ - AttributeType: typ, - }, nil), nil - case length == 0: - return tftypes.NewValue(tftypes.Map{ - AttributeType: typ, - }, map[string]tftypes.Value{}), nil - } - - vals := make(map[string]tftypes.Value, length) - for i := 0; i < length; i++ { - key, err := dec.DecodeString() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding map key: %w", err) - } - path.WithElementKeyString(key) - val, err := msgpackUnmarshal(dec, typ, path) - if err != nil { - return tftypes.Value{}, err - } - vals[key] = val - path.WithoutLastStep() - } - return tftypes.NewValue(tftypes.Map{ - AttributeType: typ, - }, vals), nil -} - -func msgpackUnmarshalTuple(dec *msgpack.Decoder, types []tftypes.Type, path tftypes.AttributePath) (tftypes.Value, error) { - length, err := dec.DecodeArrayLen() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding tuple length: %w", err) - } - - switch { - case length < 0: - return tftypes.NewValue(tftypes.Tuple{ - ElementTypes: types, - }, nil), nil - case length == 0: - return tftypes.NewValue(tftypes.Tuple{ - // no elements means no types - ElementTypes: nil, - }, []tftypes.Value{}), nil - case length != len(types): - return tftypes.Value{}, path.NewErrorf("error decoding tuple; expected %d items, got %d", len(types), length) - } - - vals := make([]tftypes.Value, 0, length) - for i := 0; i < length; i++ { - path.WithElementKeyInt(int64(i)) - typ := types[i] - val, err := msgpackUnmarshal(dec, typ, path) - if err != nil { - return tftypes.Value{}, err - } - vals = append(vals, val) - path.WithoutLastStep() - } - - return tftypes.NewValue(tftypes.Tuple{ - ElementTypes: types, - }, vals), nil -} - -func msgpackUnmarshalObject(dec *msgpack.Decoder, types map[string]tftypes.Type, path tftypes.AttributePath) (tftypes.Value, error) { - length, err := dec.DecodeMapLen() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding object length: %w", err) - } - - switch { - case length < 0: - return tftypes.NewValue(tftypes.Object{ - AttributeTypes: types, - }, nil), nil - case length == 0: - return tftypes.NewValue(tftypes.Object{ - // no attributes means no types - AttributeTypes: nil, - }, map[string]tftypes.Value{}), nil - case length != len(types): - return tftypes.Value{}, path.NewErrorf("error decoding object; expected %d attributes, got %d", len(types), length) - } - - vals := make(map[string]tftypes.Value, length) - for i := 0; i < length; i++ { - key, err := dec.DecodeString() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding object key: %w", err) - } - typ, exists := types[key] - if !exists { - return tftypes.Value{}, path.NewErrorf("unknown attribute %q", key) - } - path.WithAttributeName(key) - val, err := msgpackUnmarshal(dec, typ, path) - if err != nil { - return tftypes.Value{}, err - } - vals[key] = val - path.WithoutLastStep() - } - - return tftypes.NewValue(tftypes.Object{ - AttributeTypes: types, - }, vals), nil -} - -func msgpackUnmarshalDynamic(dec *msgpack.Decoder, path tftypes.AttributePath) (tftypes.Value, error) { - length, err := dec.DecodeArrayLen() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error checking length of DynamicPseudoType value: %w", err) - } - - switch { - case length == -1: - return tftypes.NewValue(tftypes.DynamicPseudoType, nil), nil - case length != 2: - return tftypes.Value{}, path.NewErrorf("expected %d elements in DynamicPseudoType array, got %d", 2, length) - } - - typeJSON, err := dec.DecodeBytes() - if err != nil { - return tftypes.Value{}, path.NewErrorf("error decoding bytes: %w", err) - } - typ, err := tftypes.ParseJSONType(typeJSON) //nolint:staticcheck - if err != nil { - return tftypes.Value{}, path.NewErrorf("error parsing type information: %w", err) - } - return msgpackUnmarshal(dec, typ, path) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/attribute_path.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/attribute_path.go index 6630160f8..421bfbec5 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/attribute_path.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/attribute_path.go @@ -4,7 +4,7 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) var ErrUnknownAttributePathStepType = errors.New("unknown type of AttributePath_Step") @@ -14,9 +14,7 @@ func AttributePath(in *tfplugin5.AttributePath) (*tftypes.AttributePath, error) if err != nil { return nil, err } - return &tftypes.AttributePath{ - Steps: steps, - }, nil + return tftypes.NewAttributePathWithSteps(steps), nil } func AttributePaths(in []*tfplugin5.AttributePath) ([]*tftypes.AttributePath, error) { diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/schema.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/schema.go index beff9ca31..90f2e0322 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto/schema.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func Schema(in *tfplugin5.Schema) (*tfprotov5.Schema, error) { diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/generate.sh b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/generate.sh deleted file mode 100644 index ac9ec74b3..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/generate.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# We do not run protoc under go:generate because we want to ensure that all -# dependencies of go:generate are "go get"-able for general dev environment -# usability. To compile all protobuf files in this repository, run -# "make protobuf" at the top-level. - -set -eu - -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - -cd "$DIR" - -protoc --proto_path=. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative tfplugin5.proto diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5.pb.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5.pb.go index 793eed7a8..326a58bba 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5.pb.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5.pb.go @@ -19,14 +19,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.25.0 -// protoc v3.13.0 +// protoc-gen-go v1.28.0 +// protoc v3.19.4 // source: tfplugin5.proto package tfplugin5 import ( - proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -40,10 +39,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - type StringKind int32 const ( diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go index 2a1c19ad1..ddbdea31e 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.4 +// source: tfplugin5.proto package tfplugin5 @@ -11,6 +15,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // ProviderClient is the client API for Provider service. @@ -223,8 +228,8 @@ type UnsafeProviderServer interface { mustEmbedUnimplementedProviderServer() } -func RegisterProviderServer(s *grpc.Server, srv ProviderServer) { - s.RegisterService(&_Provider_serviceDesc, srv) +func RegisterProviderServer(s grpc.ServiceRegistrar, srv ProviderServer) { + s.RegisterService(&Provider_ServiceDesc, srv) } func _Provider_GetSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -443,7 +448,10 @@ func _Provider_Stop_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -var _Provider_serviceDesc = grpc.ServiceDesc{ +// Provider_ServiceDesc is the grpc.ServiceDesc for Provider service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Provider_ServiceDesc = grpc.ServiceDesc{ ServiceName: "tfplugin5.Provider", HandlerType: (*ProviderServer)(nil), Methods: []grpc.MethodDesc{ @@ -537,7 +545,7 @@ func (c *provisionerClient) ValidateProvisionerConfig(ctx context.Context, in *V } func (c *provisionerClient) ProvisionResource(ctx context.Context, in *ProvisionResource_Request, opts ...grpc.CallOption) (Provisioner_ProvisionResourceClient, error) { - stream, err := c.cc.NewStream(ctx, &_Provisioner_serviceDesc.Streams[0], "/tfplugin5.Provisioner/ProvisionResource", opts...) + stream, err := c.cc.NewStream(ctx, &Provisioner_ServiceDesc.Streams[0], "/tfplugin5.Provisioner/ProvisionResource", opts...) if err != nil { return nil, err } @@ -613,8 +621,8 @@ type UnsafeProvisionerServer interface { mustEmbedUnimplementedProvisionerServer() } -func RegisterProvisionerServer(s *grpc.Server, srv ProvisionerServer) { - s.RegisterService(&_Provisioner_serviceDesc, srv) +func RegisterProvisionerServer(s grpc.ServiceRegistrar, srv ProvisionerServer) { + s.RegisterService(&Provisioner_ServiceDesc, srv) } func _Provisioner_GetSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -692,7 +700,10 @@ func _Provisioner_Stop_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -var _Provisioner_serviceDesc = grpc.ServiceDesc{ +// Provisioner_ServiceDesc is the grpc.ServiceDesc for Provisioner service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Provisioner_ServiceDesc = grpc.ServiceDesc{ ServiceName: "tfplugin5.Provisioner", HandlerType: (*ProvisionerServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/attribute_path.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/attribute_path.go index 7e63d59d9..58397ebdc 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/attribute_path.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/attribute_path.go @@ -4,13 +4,16 @@ import ( "errors" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) var ErrUnknownAttributePathStepType = errors.New("unknown type of AttributePath_Step") func AttributePath(in *tftypes.AttributePath) (*tfplugin5.AttributePath, error) { - steps, err := AttributePath_Steps(in.Steps) + if in == nil { + return nil, nil + } + steps, err := AttributePath_Steps(in.Steps()) if err != nil { return nil, err } diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/dynamic_value.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/dynamic_value.go index 0c0af8a8a..325e929a0 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/dynamic_value.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto/dynamic_value.go @@ -5,7 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) func DynamicValue(in *tfprotov5.DynamicValue) *tfplugin5.DynamicValue { diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/resource.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/resource.go index ea16343f7..5f9549965 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/resource.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/resource.go @@ -3,7 +3,7 @@ package tfprotov5 import ( "context" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) // ResourceServer is an interface containing the methods a resource @@ -98,6 +98,9 @@ type UpgradeResourceStateResponse struct { // // The state should be represented as a tftypes.Object, with each // attribute and nested block getting its own key and value. + // + // Terraform CLI 0.12 through 0.14 require the Msgpack field to be + // populated or an EOF error will be returned. UpgradedState *DynamicValue // Diagnostics report errors or warnings related to upgrading the diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go index a2c7426cc..b0b6dff28 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/schema.go @@ -1,6 +1,6 @@ package tfprotov5 -import "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" +import "github.com/hashicorp/terraform-plugin-go/tftypes" const ( // SchemaNestedBlockNestingModeInvalid indicates that the nesting mode @@ -29,7 +29,7 @@ const ( // SchemaNestedBlockNestingModeMap indicates that multiple instances of // the nested block should be permitted, each with a single label, and // that they should be represented in state and config values as a - // tftypes.Map, with an AttributeType of tftypes.Object. The labels on + // tftypes.Map, with an ElementType of tftypes.Object. The labels on // the blocks will be used as the map keys. It is an error, therefore, // to use the same label value on multiple block instances. SchemaNestedBlockNestingModeMap SchemaNestedBlockNestingMode = 4 @@ -68,6 +68,19 @@ type Schema struct { Block *SchemaBlock } +// ValueType returns the tftypes.Type for a Schema. +// +// If Schema is missing, an empty Object is returned. +func (s *Schema) ValueType() tftypes.Type { + if s == nil { + return tftypes.Object{ + AttributeTypes: map[string]tftypes.Type{}, + } + } + + return s.Block.ValueType() +} + // SchemaBlock represents a block in a schema. Blocks are how Terraform creates // groupings of attributes. In configurations, they don't use the equals sign // and use dynamic instead of list comprehensions. @@ -105,6 +118,51 @@ type SchemaBlock struct { Deprecated bool } +// ValueType returns the tftypes.Type for a SchemaBlock. +// +// If SchemaBlock is missing, an empty Object is returned. +func (s *SchemaBlock) ValueType() tftypes.Type { + if s == nil { + return tftypes.Object{ + AttributeTypes: map[string]tftypes.Type{}, + } + } + + attributeTypes := map[string]tftypes.Type{} + + for _, attribute := range s.Attributes { + if attribute == nil { + continue + } + + attributeType := attribute.ValueType() + + if attributeType == nil { + continue + } + + attributeTypes[attribute.Name] = attributeType + } + + for _, block := range s.BlockTypes { + if block == nil { + continue + } + + blockType := block.ValueType() + + if blockType == nil { + continue + } + + attributeTypes[block.TypeName] = blockType + } + + return tftypes.Object{ + AttributeTypes: attributeTypes, + } +} + // SchemaAttribute represents a single attribute within a schema block. // Attributes are the fields users can set in configuration using the equals // sign, can assign to variables, can interpolate, and can use list @@ -162,6 +220,17 @@ type SchemaAttribute struct { Deprecated bool } +// ValueType returns the tftypes.Type for a SchemaAttribute. +// +// If SchemaAttribute is missing, nil is returned. +func (s *SchemaAttribute) ValueType() tftypes.Type { + if s == nil { + return nil + } + + return s.Type +} + // SchemaNestedBlock is a nested block within another block. See SchemaBlock // for more information on blocks. type SchemaNestedBlock struct { @@ -198,6 +267,39 @@ type SchemaNestedBlock struct { MaxItems int64 } +// ValueType returns the tftypes.Type for a SchemaNestedBlock. +// +// If SchemaNestedBlock is missing or the Nesting mode is invalid, nil is +// returned. +func (s *SchemaNestedBlock) ValueType() tftypes.Type { + if s == nil { + return nil + } + + blockType := s.Block.ValueType() + + switch s.Nesting { + case SchemaNestedBlockNestingModeGroup: + return blockType + case SchemaNestedBlockNestingModeList: + return tftypes.List{ + ElementType: blockType, + } + case SchemaNestedBlockNestingModeMap: + return tftypes.Map{ + ElementType: blockType, + } + case SchemaNestedBlockNestingModeSet: + return tftypes.Set{ + ElementType: blockType, + } + case SchemaNestedBlockNestingModeSingle: + return blockType + default: + return nil + } +} + // SchemaNestedBlockNestingMode indicates the nesting mode for // SchemaNestedBlocks. The nesting mode determines the number of instances of // the block allowed, how many labels the block expects, and the data structure diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go deleted file mode 100644 index 34da72a4e..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go +++ /dev/null @@ -1,358 +0,0 @@ -package tf5server - -import ( - "context" - "sync" - - "github.com/hashicorp/go-hclog" - "github.com/hashicorp/go-plugin" - "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto" -) - -// ServeOpt is an interface for defining options that can be passed to the -// Serve function. Each implementation modifies the ServeConfig being -// generated. A slice of ServeOpts then, cumulatively applied, render a full -// ServeConfig. -type ServeOpt interface { - ApplyServeOpt(*ServeConfig) error -} - -// ServeConfig contains the configured options for how a provider should be -// served. -type ServeConfig struct { - logger hclog.Logger - debugCtx context.Context - debugCh chan *plugin.ReattachConfig - debugCloseCh chan struct{} -} - -type serveConfigFunc func(*ServeConfig) error - -func (s serveConfigFunc) ApplyServeOpt(in *ServeConfig) error { - return s(in) -} - -// WithDebug returns a ServeOpt that will set the server into debug mode, using -// the passed options to populate the go-plugin ServeTestConfig. -func WithDebug(ctx context.Context, config chan *plugin.ReattachConfig, closeCh chan struct{}) ServeOpt { - return serveConfigFunc(func(in *ServeConfig) error { - in.debugCtx = ctx - in.debugCh = config - in.debugCloseCh = closeCh - return nil - }) -} - -// WithGoPluginLogger returns a ServeOpt that will set the logger that -// go-plugin should use to log messages. -func WithGoPluginLogger(logger hclog.Logger) ServeOpt { - return serveConfigFunc(func(in *ServeConfig) error { - in.logger = logger - return nil - }) -} - -// Serve starts a tfprotov5.ProviderServer serving, ready for Terraform to -// connect to it. The name passed in should be the fully qualified name that -// users will enter in the source field of the required_providers block, like -// "registry.terraform.io/hashicorp/time". -// -// Zero or more options to configure the server may also be passed. The default -// invocation is sufficient, but if the provider wants to run in debug mode or -// modify the logger that go-plugin is using, ServeOpts can be specified to -// support that. -func Serve(name string, serverFactory func() tfprotov5.ProviderServer, opts ...ServeOpt) error { - var conf ServeConfig - for _, opt := range opts { - err := opt.ApplyServeOpt(&conf) - if err != nil { - return err - } - } - serveConfig := &plugin.ServeConfig{ - HandshakeConfig: plugin.HandshakeConfig{ - ProtocolVersion: 5, - MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", - MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", - }, - Plugins: plugin.PluginSet{ - "provider": &GRPCProviderPlugin{ - GRPCProvider: serverFactory, - }, - }, - GRPCServer: plugin.DefaultGRPCServer, - } - if conf.logger != nil { - serveConfig.Logger = conf.logger - } - if conf.debugCh != nil { - serveConfig.Test = &plugin.ServeTestConfig{ - Context: conf.debugCtx, - ReattachConfigCh: conf.debugCh, - CloseCh: conf.debugCloseCh, - } - } - plugin.Serve(serveConfig) - return nil -} - -type server struct { - downstream tfprotov5.ProviderServer - tfplugin5.UnimplementedProviderServer - - stopMu sync.Mutex - stopCh chan struct{} -} - -func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struct{}) { - select { - case <-ctx.Done(): - return - case <-stopCh: - cancel() - } -} - -// stoppableContext returns a context that wraps `ctx` but will be canceled -// when the server's stopCh is closed. -// -// This is used to cancel all in-flight contexts when the Stop method of the -// server is called. -func (s *server) stoppableContext(ctx context.Context) context.Context { - s.stopMu.Lock() - defer s.stopMu.Unlock() - - stoppable, cancel := context.WithCancel(ctx) - go mergeStop(stoppable, cancel, s.stopCh) - return stoppable -} - -// New converts a tfprotov5.ProviderServer into a server capable of handling -// Terraform protocol requests and issuing responses using the gRPC types. -func New(serve tfprotov5.ProviderServer) tfplugin5.ProviderServer { - return &server{ - downstream: serve, - stopCh: make(chan struct{}), - } -} - -func (s *server) GetSchema(ctx context.Context, req *tfplugin5.GetProviderSchema_Request) (*tfplugin5.GetProviderSchema_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.GetProviderSchemaRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.GetProviderSchema(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.GetProviderSchema_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) PrepareProviderConfig(ctx context.Context, req *tfplugin5.PrepareProviderConfig_Request) (*tfplugin5.PrepareProviderConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.PrepareProviderConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.PrepareProviderConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.PrepareProviderConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) Configure(ctx context.Context, req *tfplugin5.Configure_Request) (*tfplugin5.Configure_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ConfigureProviderRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ConfigureProvider(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.Configure_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -// stop closes the stopCh associated with the server and replaces it with a new -// one. -// -// This causes all in-flight requests for the server to have their contexts -// canceled. -func (s *server) stop() { - s.stopMu.Lock() - defer s.stopMu.Unlock() - - close(s.stopCh) - s.stopCh = make(chan struct{}) -} - -func (s *server) Stop(ctx context.Context, req *tfplugin5.Stop_Request) (*tfplugin5.Stop_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.StopProviderRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.StopProvider(ctx, r) - if err != nil { - return nil, err - } - s.stop() - ret, err := toproto.Stop_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ValidateDataSourceConfig(ctx context.Context, req *tfplugin5.ValidateDataSourceConfig_Request) (*tfplugin5.ValidateDataSourceConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ValidateDataSourceConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ValidateDataSourceConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ValidateDataSourceConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ReadDataSource(ctx context.Context, req *tfplugin5.ReadDataSource_Request) (*tfplugin5.ReadDataSource_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ReadDataSourceRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ReadDataSource(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ReadDataSource_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ValidateResourceTypeConfig(ctx context.Context, req *tfplugin5.ValidateResourceTypeConfig_Request) (*tfplugin5.ValidateResourceTypeConfig_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ValidateResourceTypeConfigRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ValidateResourceTypeConfig(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ValidateResourceTypeConfig_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) UpgradeResourceState(ctx context.Context, req *tfplugin5.UpgradeResourceState_Request) (*tfplugin5.UpgradeResourceState_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.UpgradeResourceStateRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.UpgradeResourceState(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.UpgradeResourceState_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ReadResource(ctx context.Context, req *tfplugin5.ReadResource_Request) (*tfplugin5.ReadResource_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ReadResourceRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ReadResource(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ReadResource_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) PlanResourceChange(ctx context.Context, req *tfplugin5.PlanResourceChange_Request) (*tfplugin5.PlanResourceChange_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.PlanResourceChangeRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.PlanResourceChange(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.PlanResourceChange_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ApplyResourceChange(ctx context.Context, req *tfplugin5.ApplyResourceChange_Request) (*tfplugin5.ApplyResourceChange_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ApplyResourceChangeRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ApplyResourceChange(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ApplyResourceChange_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} - -func (s *server) ImportResourceState(ctx context.Context, req *tfplugin5.ImportResourceState_Request) (*tfplugin5.ImportResourceState_Response, error) { - ctx = s.stoppableContext(ctx) - r, err := fromproto.ImportResourceStateRequest(req) - if err != nil { - return nil, err - } - resp, err := s.downstream.ImportResourceState(ctx, r) - if err != nil { - return nil, err - } - ret, err := toproto.ImportResourceState_Response(resp) - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/state.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/state.go index d66ed5c5d..7b7de2f75 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/state.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/state.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" ) // ErrUnknownRawStateType is returned when a RawState has no Flatmap or JSON @@ -70,7 +70,7 @@ type RawState struct { // cannot be unmarshaled, and must have their Flatmap property read directly. func (s RawState) Unmarshal(typ tftypes.Type) (tftypes.Value, error) { if s.JSON != nil { - return jsonUnmarshal(s.JSON, typ, tftypes.AttributePath{}) + return tftypes.ValueFromJSON(s.JSON, typ) //nolint:staticcheck } if s.Flatmap != nil { return tftypes.Value{}, fmt.Errorf("flatmap states cannot be unmarshaled, only states written by Terraform 0.12 and higher can be unmarshaled") diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/doc.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/doc.go similarity index 73% rename from vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/doc.go rename to vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/doc.go index 0d545c2b1..d8360a7fb 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/doc.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/doc.go @@ -1,4 +1,4 @@ -// Package tf5server implementations a server implementation for running +// Package tf5server implements a server implementation to run // tfprotov5.ProviderServers as gRPC servers. // // Providers will likely be calling tf5server.Serve from their main function to diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/plugin.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/plugin.go similarity index 92% rename from vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/plugin.go rename to vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/plugin.go index efa32947d..a33afd84c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/plugin.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/plugin.go @@ -17,6 +17,8 @@ import ( // serve tfprotov5.ProviderServers as gRPC plugins for go-plugin. type GRPCProviderPlugin struct { GRPCProvider func() tfprotov5.ProviderServer + Opts []ServeOpt + Name string } // Server always returns an error; we're only implementing the GRPCPlugin @@ -40,6 +42,6 @@ func (p *GRPCProviderPlugin) GRPCClient(context.Context, *plugin.GRPCBroker, *gr // GRPCServer registers the gRPC provider server with the gRPC server that // go-plugin is standing up. func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { - tfplugin5.RegisterProviderServer(s, New(p.GRPCProvider())) + tfplugin5.RegisterProviderServer(s, New(p.Name, p.GRPCProvider(), p.Opts...)) return nil } diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go new file mode 100644 index 000000000..9ec7abefb --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go @@ -0,0 +1,856 @@ +package tf5server + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "os" + "os/signal" + "regexp" + "runtime" + "strings" + "sync" + "time" + + "github.com/hashicorp/terraform-plugin-go/internal/logging" + "github.com/hashicorp/terraform-plugin-go/tfprotov5" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto" + "google.golang.org/grpc" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/go-plugin" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-log/tfsdklog" + testing "github.com/mitchellh/go-testing-interface" +) + +const ( + // protocolVersionMajor represents the major version number of the protocol + // being served. This is used during the plugin handshake to validate the + // server and client are compatible. + // + // In the future, it may be possible to include this information directly + // in the protocol buffers rather than recreating a constant here. + protocolVersionMajor uint = 5 + + // protocolVersionMinor represents the minor version number of the protocol + // being served. Backwards compatible additions are possible in the + // protocol definitions, which is when this may be increased. While it is + // not used in plugin negotiation, it can be helpful to include this value + // for debugging, such as in logs. + // + // In the future, it may be possible to include this information directly + // in the protocol buffers rather than recreating a constant here. + protocolVersionMinor uint = 2 +) + +// protocolVersion represents the combined major and minor version numbers of +// the protocol being served. +var protocolVersion string = fmt.Sprintf("%d.%d", protocolVersionMajor, protocolVersionMinor) + +const ( + // envTfReattachProviders is the environment variable used by Terraform CLI + // to directly connect to already running provider processes, such as those + // being inspected by debugging processes. When connecting to providers in + // this manner, Terraform CLI disables certain plugin handshake checks and + // will not stop the provider process. + envTfReattachProviders = "TF_REATTACH_PROVIDERS" +) + +const ( + // grpcMaxMessageSize is the maximum gRPC send and receive message sizes + // for the server. + // + // This 256MB value is arbitrarily raised from the default message sizes of + // 4MB to account for advanced use cases, but arbitrarily lowered from + // MaxInt32 (or similar) to prevent incorrect server implementations from + // exhausting resources in common execution environments. Receiving a gRPC + // message size error is preferable for troubleshooting over determining + // why an execution environment may have terminated the process via its + // memory management processes, such as oom-killer on Linux. + // + // This value is kept as constant over allowing server configurability + // since there are many factors that influence message size, such as + // Terraform configuration and state data. If larger message size use + // cases appear, other gRPC options should be explored, such as + // implementing streaming RPCs and messages. + grpcMaxMessageSize = 256 << 20 +) + +// ServeOpt is an interface for defining options that can be passed to the +// Serve function. Each implementation modifies the ServeConfig being +// generated. A slice of ServeOpts then, cumulatively applied, render a full +// ServeConfig. +type ServeOpt interface { + ApplyServeOpt(*ServeConfig) error +} + +// ServeConfig contains the configured options for how a provider should be +// served. +type ServeConfig struct { + logger hclog.Logger + debugCtx context.Context + debugCh chan *plugin.ReattachConfig + debugCloseCh chan struct{} + + managedDebug bool + managedDebugReattachConfigTimeout time.Duration + managedDebugStopSignals []os.Signal + + disableLogInitStderr bool + disableLogLocation bool + useLoggingSink testing.T + envVar string +} + +type serveConfigFunc func(*ServeConfig) error + +func (s serveConfigFunc) ApplyServeOpt(in *ServeConfig) error { + return s(in) +} + +// WithDebug returns a ServeOpt that will set the server into debug mode, using +// the passed options to populate the go-plugin ServeTestConfig. +// +// This is an advanced ServeOpt that assumes the caller will fully manage the +// reattach configuration and server lifecycle. Refer to WithManagedDebug for a +// ServeOpt that handles common use cases, such as implementing provider main +// functions. +func WithDebug(ctx context.Context, config chan *plugin.ReattachConfig, closeCh chan struct{}) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if in.managedDebug { + return errors.New("cannot set both WithDebug and WithManagedDebug") + } + + in.debugCtx = ctx + in.debugCh = config + in.debugCloseCh = closeCh + return nil + }) +} + +// WithManagedDebug returns a ServeOpt that will start the server in debug +// mode, managing the reattach configuration handling and server lifecycle. +// Reattach configuration is output to stdout with human friendly instructions. +// By default, the server can be stopped with os.Interrupt (SIGINT; ctrl-c). +// +// Refer to the optional WithManagedDebugStopSignals and +// WithManagedDebugReattachConfigTimeout ServeOpt for additional configuration. +// +// The reattach configuration output of this handling is not protected by +// compatibility guarantees. Use the WithDebug ServeOpt for advanced use cases. +func WithManagedDebug() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if in.debugCh != nil { + return errors.New("cannot set both WithDebug and WithManagedDebug") + } + + in.managedDebug = true + return nil + }) +} + +// WithManagedDebugStopSignals returns a ServeOpt that will set the stop signals for a +// debug managed process (WithManagedDebug). When not configured, os.Interrupt +// (SIGINT; Ctrl-c) will stop the process. +func WithManagedDebugStopSignals(signals []os.Signal) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.managedDebugStopSignals = signals + return nil + }) +} + +// WithManagedDebugReattachConfigTimeout returns a ServeOpt that will set the timeout +// for a debug managed process to start and return its reattach configuration. +// When not configured, 2 seconds is the default. +func WithManagedDebugReattachConfigTimeout(timeout time.Duration) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.managedDebugReattachConfigTimeout = timeout + return nil + }) +} + +// WithGoPluginLogger returns a ServeOpt that will set the logger that +// go-plugin should use to log messages. +func WithGoPluginLogger(logger hclog.Logger) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.logger = logger + return nil + }) +} + +// WithLoggingSink returns a ServeOpt that will enable the logging sink, which +// is used in test frameworks to control where terraform-plugin-log output is +// written and at what levels, mimicking Terraform's logging sink behaviors. +func WithLoggingSink(t testing.T) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.useLoggingSink = t + return nil + }) +} + +// WithoutLogStderrOverride returns a ServeOpt that will disable the +// terraform-plugin-log behavior of logging to the stderr that existed at +// startup, not the stderr that exists when the logging statement is called. +func WithoutLogStderrOverride() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogInitStderr = true + return nil + }) +} + +// WithoutLogLocation returns a ServeOpt that will exclude file names and line +// numbers from log output for the terraform-plugin-log logs generated by the +// SDKs and provider. +func WithoutLogLocation() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogLocation = true + return nil + }) +} + +// WithLogEnvVarName sets the name of the provider for the purposes of the +// logging environment variable that controls the provider's log level. It is +// the part following TF_LOG_PROVIDER_ and defaults to the name part of the +// provider's registry address, or disabled if it can't parse the provider's +// registry address. Name must only contain letters, numbers, and hyphens. +func WithLogEnvVarName(name string) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if !regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString(name) { + return errors.New("environment variable names can only contain a-z, A-Z, 0-9, and -") + } + in.envVar = name + return nil + }) +} + +// Serve starts a tfprotov5.ProviderServer serving, ready for Terraform to +// connect to it. The name passed in should be the fully qualified name that +// users will enter in the source field of the required_providers block, like +// "registry.terraform.io/hashicorp/time". +// +// Zero or more options to configure the server may also be passed. The default +// invocation is sufficient, but if the provider wants to run in debug mode or +// modify the logger that go-plugin is using, ServeOpts can be specified to +// support that. +func Serve(name string, serverFactory func() tfprotov5.ProviderServer, opts ...ServeOpt) error { + // Defaults + conf := ServeConfig{ + managedDebugReattachConfigTimeout: 2 * time.Second, + managedDebugStopSignals: []os.Signal{os.Interrupt}, + } + + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + return err + } + } + + serveConfig := &plugin.ServeConfig{ + HandshakeConfig: plugin.HandshakeConfig{ + ProtocolVersion: protocolVersionMajor, + MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", + MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", + }, + Plugins: plugin.PluginSet{ + "provider": &GRPCProviderPlugin{ + Name: name, + Opts: opts, + GRPCProvider: serverFactory, + }, + }, + GRPCServer: func(opts []grpc.ServerOption) *grpc.Server { + opts = append(opts, grpc.MaxRecvMsgSize(grpcMaxMessageSize)) + opts = append(opts, grpc.MaxSendMsgSize(grpcMaxMessageSize)) + + return grpc.NewServer(opts...) + }, + } + + if conf.logger != nil { + serveConfig.Logger = conf.logger + } + + if conf.managedDebug { + ctx, cancel := context.WithCancel(context.Background()) + signalCh := make(chan os.Signal, len(conf.managedDebugStopSignals)) + + signal.Notify(signalCh, conf.managedDebugStopSignals...) + + defer func() { + signal.Stop(signalCh) + cancel() + }() + + go func() { + select { + case <-signalCh: + cancel() + case <-ctx.Done(): + } + }() + + conf.debugCh = make(chan *plugin.ReattachConfig) + conf.debugCloseCh = make(chan struct{}) + conf.debugCtx = ctx + } + + if conf.debugCh != nil { + serveConfig.Test = &plugin.ServeTestConfig{ + Context: conf.debugCtx, + ReattachConfigCh: conf.debugCh, + CloseCh: conf.debugCloseCh, + } + } + + if !conf.managedDebug { + plugin.Serve(serveConfig) + return nil + } + + go plugin.Serve(serveConfig) + + var pluginReattachConfig *plugin.ReattachConfig + + select { + case pluginReattachConfig = <-conf.debugCh: + case <-time.After(conf.managedDebugReattachConfigTimeout): + return errors.New("timeout waiting on reattach configuration") + } + + if pluginReattachConfig == nil { + return errors.New("nil reattach configuration received") + } + + // Duplicate implementation is required because the go-plugin + // ReattachConfig.Addr implementation is not friendly for JSON encoding + // and to avoid importing terraform-exec. + type reattachConfigAddr struct { + Network string + String string + } + + type reattachConfig struct { + Protocol string + ProtocolVersion int + Pid int + Test bool + Addr reattachConfigAddr + } + + reattachBytes, err := json.Marshal(map[string]reattachConfig{ + name: { + Protocol: string(pluginReattachConfig.Protocol), + ProtocolVersion: pluginReattachConfig.ProtocolVersion, + Pid: pluginReattachConfig.Pid, + Test: pluginReattachConfig.Test, + Addr: reattachConfigAddr{ + Network: pluginReattachConfig.Addr.Network(), + String: pluginReattachConfig.Addr.String(), + }, + }, + }) + + if err != nil { + return fmt.Errorf("Error building reattach string: %w", err) + } + + reattachStr := string(reattachBytes) + + // This is currently intended to be executed via provider main function and + // human friendly, so output directly to stdout. + fmt.Printf("Provider started. To attach Terraform CLI, set the %s environment variable with the following:\n\n", envTfReattachProviders) + + switch runtime.GOOS { + case "windows": + fmt.Printf("\tCommand Prompt:\tset \"%s=%s\"\n", envTfReattachProviders, reattachStr) + fmt.Printf("\tPowerShell:\t$env:%s='%s'\n", envTfReattachProviders, strings.ReplaceAll(reattachStr, `'`, `''`)) + default: + fmt.Printf("\t%s='%s'\n", envTfReattachProviders, strings.ReplaceAll(reattachStr, `'`, `'"'"'`)) + } + + fmt.Println("") + + // Wait for the server to be done. + <-conf.debugCloseCh + + return nil +} + +type server struct { + downstream tfprotov5.ProviderServer + tfplugin5.UnimplementedProviderServer + + stopMu sync.Mutex + stopCh chan struct{} + + tflogSDKOpts tfsdklog.Options + tflogOpts tflog.Options + useTFLogSink bool + testHandle testing.T + name string + + // protocolDataDir is a directory to store raw protocol data files for + // debugging purposes. + protocolDataDir string + + // protocolVersion is the protocol version for the server. + protocolVersion string +} + +func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struct{}) { + select { + case <-ctx.Done(): + return + case <-stopCh: + cancel() + } +} + +// stoppableContext returns a context that wraps `ctx` but will be canceled +// when the server's stopCh is closed. +// +// This is used to cancel all in-flight contexts when the Stop method of the +// server is called. +func (s *server) stoppableContext(ctx context.Context) context.Context { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + stoppable, cancel := context.WithCancel(ctx) + go mergeStop(stoppable, cancel, s.stopCh) + return stoppable +} + +// loggingContext returns a context that wraps `ctx` and has +// terraform-plugin-log loggers injected. +func (s *server) loggingContext(ctx context.Context) context.Context { + if s.useTFLogSink { + ctx = tfsdklog.RegisterTestSink(ctx, s.testHandle) + } + + ctx = logging.InitContext(ctx, s.tflogSDKOpts, s.tflogOpts) + ctx = logging.RequestIdContext(ctx) + ctx = logging.ProviderAddressContext(ctx, s.name) + ctx = logging.ProtocolVersionContext(ctx, s.protocolVersion) + + return ctx +} + +// New converts a tfprotov5.ProviderServer into a server capable of handling +// Terraform protocol requests and issuing responses using the gRPC types. +func New(name string, serve tfprotov5.ProviderServer, opts ...ServeOpt) tfplugin5.ProviderServer { + var conf ServeConfig + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + // this should never happen, we already executed all + // this code as part of Serve + panic(err) + } + } + var sdkOptions tfsdklog.Options + var options tflog.Options + if !conf.disableLogInitStderr { + sdkOptions = append(sdkOptions, tfsdklog.WithStderrFromInit()) + options = append(options, tfsdklog.WithStderrFromInit()) + } + if conf.disableLogLocation { + sdkOptions = append(sdkOptions, tfsdklog.WithoutLocation()) + options = append(options, tflog.WithoutLocation()) + } + envVar := conf.envVar + if envVar == "" { + envVar = logging.ProviderLoggerName(name) + } + if envVar != "" { + options = append(options, tfsdklog.WithLogName(envVar), tflog.WithLevelFromEnv(logging.EnvTfLogProvider, envVar)) + } + return &server{ + downstream: serve, + stopCh: make(chan struct{}), + tflogOpts: options, + tflogSDKOpts: sdkOptions, + name: name, + useTFLogSink: conf.useLoggingSink != nil, + testHandle: conf.useLoggingSink, + protocolDataDir: os.Getenv(logging.EnvTfLogSdkProtoDataDir), + protocolVersion: protocolVersion, + } +} + +func (s *server) GetSchema(ctx context.Context, req *tfplugin5.GetProviderSchema_Request) (*tfplugin5.GetProviderSchema_Response, error) { + rpc := "GetProviderSchema" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.GetProviderSchemaRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.GetProviderSchema(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.GetProviderSchema_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) PrepareProviderConfig(ctx context.Context, req *tfplugin5.PrepareProviderConfig_Request) (*tfplugin5.PrepareProviderConfig_Response, error) { + rpc := "PrepareProviderConfig" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.PrepareProviderConfigRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.PrepareProviderConfig(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "PreparedConfig", resp.PreparedConfig) + ret, err := toproto.PrepareProviderConfig_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) Configure(ctx context.Context, req *tfplugin5.Configure_Request) (*tfplugin5.Configure_Response, error) { + rpc := "Configure" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ConfigureProviderRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ConfigureProvider(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.Configure_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +// stop closes the stopCh associated with the server and replaces it with a new +// one. +// +// This causes all in-flight requests for the server to have their contexts +// canceled. +func (s *server) stop() { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + close(s.stopCh) + s.stopCh = make(chan struct{}) +} + +func (s *server) Stop(ctx context.Context, req *tfplugin5.Stop_Request) (*tfplugin5.Stop_Response, error) { + rpc := "Stop" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.StopProviderRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.StopProvider(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolTrace(ctx, "Closing all our contexts") + s.stop() + logging.ProtocolTrace(ctx, "Closed all our contexts") + ret, err := toproto.Stop_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateDataSourceConfig(ctx context.Context, req *tfplugin5.ValidateDataSourceConfig_Request) (*tfplugin5.ValidateDataSourceConfig_Response, error) { + rpc := "ValidateDataSourceConfig" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.DataSourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ValidateDataSourceConfigRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ValidateDataSourceConfig(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.ValidateDataSourceConfig_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ReadDataSource(ctx context.Context, req *tfplugin5.ReadDataSource_Request) (*tfplugin5.ReadDataSource_Response, error) { + rpc := "ReadDataSource" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.DataSourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ReadDataSourceRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProviderMeta", r.ProviderMeta) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ReadDataSource(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "State", resp.State) + ret, err := toproto.ReadDataSource_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateResourceTypeConfig(ctx context.Context, req *tfplugin5.ValidateResourceTypeConfig_Request) (*tfplugin5.ValidateResourceTypeConfig_Response, error) { + rpc := "ValidateResourceTypeConfig" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ValidateResourceTypeConfigRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ValidateResourceTypeConfig(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.ValidateResourceTypeConfig_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) UpgradeResourceState(ctx context.Context, req *tfplugin5.UpgradeResourceState_Request) (*tfplugin5.UpgradeResourceState_Response, error) { + rpc := "UpgradeResourceState" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.UpgradeResourceStateRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.UpgradeResourceState(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "UpgradedState", resp.UpgradedState) + ret, err := toproto.UpgradeResourceState_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ReadResource(ctx context.Context, req *tfplugin5.ReadResource_Request) (*tfplugin5.ReadResource_Response, error) { + rpc := "ReadResource" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ReadResourceRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "CurrentState", r.CurrentState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProviderMeta", r.ProviderMeta) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ReadResource(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "NewState", resp.NewState) + ret, err := toproto.ReadResource_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) PlanResourceChange(ctx context.Context, req *tfplugin5.PlanResourceChange_Request) (*tfplugin5.PlanResourceChange_Response, error) { + rpc := "PlanResourceChange" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.PlanResourceChangeRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "PriorState", r.PriorState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProposedNewState", r.ProposedNewState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProviderMeta", r.ProviderMeta) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.PlanResourceChange(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "PlannedState", resp.PlannedState) + ret, err := toproto.PlanResourceChange_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ApplyResourceChange(ctx context.Context, req *tfplugin5.ApplyResourceChange_Request) (*tfplugin5.ApplyResourceChange_Response, error) { + rpc := "ApplyResourceChange" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ApplyResourceChangeRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "PlannedState", r.PlannedState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ApplyResourceChange(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "NewState", resp.NewState) + ret, err := toproto.ApplyResourceChange_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ImportResourceState(ctx context.Context, req *tfplugin5.ImportResourceState_Request) (*tfplugin5.ImportResourceState_Response, error) { + rpc := "ImportResourceState" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ImportResourceStateRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ImportResourceState(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + for _, importedResource := range resp.ImportedResources { + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response_ImportedResource", "State", importedResource.State) + } + ret, err := toproto.ImportResourceState_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/attribute_path_error.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/attribute_path_error.go deleted file mode 100644 index b2d8bbd0a..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/attribute_path_error.go +++ /dev/null @@ -1,6 +0,0 @@ -package tftypes - -type attributePathError struct { - path AttributePath - error -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/list.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/list.go deleted file mode 100644 index 266327c9a..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/list.go +++ /dev/null @@ -1,42 +0,0 @@ -package tftypes - -import "fmt" - -// List is a Terraform type representing an ordered collection of elements, all -// of the same type. -type List struct { - ElementType Type -} - -// Is returns whether `t` is a List type or not. If `t` is an instance of the -// List type and its ElementType property is nil, it will return true. If `t`'s -// ElementType property is not nil, it will only return true if its ElementType -// is considered the same type as `l`'s ElementType. -func (l List) Is(t Type) bool { - v, ok := t.(List) - if !ok { - return false - } - if v.ElementType != nil { - return l.ElementType.Is(v.ElementType) - } - return ok -} - -func (l List) String() string { - return "tftypes.List" -} - -func (l List) private() {} - -// MarshalJSON returns a JSON representation of the full type signature of `l`, -// including its ElementType. -// -// Deprecated: this is not meant to be called by third-party code. -func (l List) MarshalJSON() ([]byte, error) { - elementType, err := l.ElementType.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("error marshaling tftypes.List's element type %T to JSON: %w", l.ElementType, err) - } - return []byte(`["list",` + string(elementType) + `]`), nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/map.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/map.go deleted file mode 100644 index 73d4d0428..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/map.go +++ /dev/null @@ -1,41 +0,0 @@ -package tftypes - -import "fmt" - -// Map is a Terraform type representing an unordered collection of elements, -// all of the same type, each identifiable with a unique string key. -type Map struct { - AttributeType Type -} - -// Is returns whether `t` is a Map type or not. If `t` is an instance of the -// Map type and its AttributeType property is not nil, it will only return true -// if its AttributeType is considered the same type as `m`'s AttributeType. -func (m Map) Is(t Type) bool { - v, ok := t.(Map) - if !ok { - return false - } - if v.AttributeType != nil { - return m.AttributeType.Is(v.AttributeType) - } - return ok -} - -func (m Map) String() string { - return "tftypes.Map" -} - -func (m Map) private() {} - -// MarshalJSON returns a JSON representation of the full type signature of `m`, -// including its AttributeType. -// -// Deprecated: this is not meant to be called by third-party code. -func (m Map) MarshalJSON() ([]byte, error) { - attributeType, err := m.AttributeType.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("error marshaling tftypes.Map's attribute type %T to JSON: %w", m.AttributeType, err) - } - return []byte(`["map",` + string(attributeType) + `]`), nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/object.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/object.go deleted file mode 100644 index 7b18c9ec7..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/object.go +++ /dev/null @@ -1,56 +0,0 @@ -package tftypes - -import "encoding/json" - -// Object is a Terraform type representing an unordered collection of -// attributes, potentially of differing types, each identifiable with a unique -// string name. The number of attributes, their names, and their types are part -// of the type signature for the Object, and so two Objects with different -// attribute names or types are considered to be distinct types. -type Object struct { - AttributeTypes map[string]Type -} - -// Is returns whether `t` is an Object type or not. If `t` is an instance of -// the Object type and its AttributeTypes property is not nil, it will only -// return true the AttributeTypes are considered the same. To be considered -// equal, the same set of keys must be present in each, and each key's value -// needs to be considered the same type between the two Objects. -func (o Object) Is(t Type) bool { - v, ok := t.(Object) - if !ok { - return false - } - if v.AttributeTypes != nil { - if len(o.AttributeTypes) != len(v.AttributeTypes) { - return false - } - for k, typ := range o.AttributeTypes { - if _, ok := v.AttributeTypes[k]; !ok { - return false - } - if !typ.Is(v.AttributeTypes[k]) { - return false - } - } - } - return ok -} - -func (o Object) String() string { - return "tftypes.Object" -} - -func (o Object) private() {} - -// MarshalJSON returns a JSON representation of the full type signature of `o`, -// including the AttributeTypes. -// -// Deprecated: this is not meant to be called by third-party code. -func (o Object) MarshalJSON() ([]byte, error) { - attrs, err := json.Marshal(o.AttributeTypes) - if err != nil { - return nil, err - } - return []byte(`["object",` + string(attrs) + `]`), nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/primitive.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/primitive.go deleted file mode 100644 index 39da56f36..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/primitive.go +++ /dev/null @@ -1,56 +0,0 @@ -package tftypes - -import "fmt" - -const ( - // DynamicPseudoType is a pseudo-type in Terraform's type system that - // is used as a wildcard type. It indicates that any Terraform type can - // be used. - DynamicPseudoType = primitive("DynamicPseudoType") - - // String is a primitive type in Terraform that represents a UTF-8 - // string of bytes. - String = primitive("String") - - // Number is a primitive type in Terraform that represents a real - // number. - Number = primitive("Number") - - // Bool is a primitive type in Terraform that represents a true or - // false boolean value. - Bool = primitive("Bool") -) - -var ( - _ Type = primitive("test") -) - -type primitive string - -func (p primitive) Is(t Type) bool { - v, ok := t.(primitive) - if !ok { - return false - } - return p == v -} - -func (p primitive) String() string { - return "tftypes." + string(p) -} - -func (p primitive) private() {} - -func (p primitive) MarshalJSON() ([]byte, error) { - switch p { - case String: - return []byte(`"string"`), nil - case Number: - return []byte(`"number"`), nil - case Bool: - return []byte(`"bool"`), nil - case DynamicPseudoType: - return []byte(`"dynamic"`), nil - } - return nil, fmt.Errorf("unknown primitive type %q", p) -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/set.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/set.go deleted file mode 100644 index 8ebdc96ab..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/set.go +++ /dev/null @@ -1,42 +0,0 @@ -package tftypes - -import "fmt" - -// Set is a Terraform type representing an unordered collection of unique -// elements, all of the same type. -type Set struct { - ElementType Type -} - -// Is returns whether `t` is a Set type or not. If `t` is an instance of the -// Set type and its ElementType property is nil, it will return true. If `t`'s -// ElementType property is not nil, it will only return true if its ElementType -// is considered the same type as `s`'s ElementType. -func (s Set) Is(t Type) bool { - v, ok := t.(Set) - if !ok { - return false - } - if v.ElementType != nil { - return s.ElementType.Is(v.ElementType) - } - return ok -} - -func (s Set) String() string { - return "tftypes.Set" -} - -func (s Set) private() {} - -// MarshalJSON returns a JSON representation of the full type signature of `s`, -// including its ElementType. -// -// Deprecated: this is not meant to be called by third-party code. -func (s Set) MarshalJSON() ([]byte, error) { - elementType, err := s.ElementType.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("error marshaling tftypes.Set's element type %T to JSON: %w", s.ElementType, err) - } - return []byte(`["set",` + string(elementType) + `]`), nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/tuple.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/tuple.go deleted file mode 100644 index 2603729b3..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/tuple.go +++ /dev/null @@ -1,53 +0,0 @@ -package tftypes - -import "encoding/json" - -// Tuple is a Terraform type representing an ordered collection of elements, -// potentially of differing types. The number of elements and their types are -// part of the type signature for the Tuple, and so two Tuples with different -// numbers or types of elements are considered to be distinct types. -type Tuple struct { - ElementTypes []Type -} - -// Is returns whether `t` is a Tuple type or not. If `t` is an instance of the -// Tuple type and its ElementTypes property is not nil, it will only return -// true if the ElementTypes are considered the same. To be considered the same, -// there must be the same number of ElementTypes, arranged in the same order, -// and the types in each position must be considered the same as the type in -// the same position in the other Tuple. -func (tu Tuple) Is(t Type) bool { - v, ok := t.(Tuple) - if !ok { - return false - } - if v.ElementTypes != nil { - if len(v.ElementTypes) != len(tu.ElementTypes) { - return false - } - for pos, typ := range tu.ElementTypes { - if !typ.Is(v.ElementTypes[pos]) { - return false - } - } - } - return ok -} - -func (tu Tuple) String() string { - return "tftypes.Tuple" -} - -func (tu Tuple) private() {} - -// MarshalJSON returns a JSON representation of the full type signature of -// `tu`, including the ElementTypes. -// -// Deprecated: this is not meant to be called by third-party code. -func (tu Tuple) MarshalJSON() ([]byte, error) { - elements, err := json.Marshal(tu.ElementTypes) - if err != nil { - return nil, err - } - return []byte(`["tuple",` + string(elements) + `]`), nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/value_msgpack.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/value_msgpack.go deleted file mode 100644 index 09b3b1171..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/value_msgpack.go +++ /dev/null @@ -1,253 +0,0 @@ -package tftypes - -import ( - "fmt" - "math" - "math/big" - "sort" - - "github.com/vmihailenco/msgpack" -) - -func marshalMsgPack(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - if typ.Is(DynamicPseudoType) && !val.Is(DynamicPseudoType) { - return marshalMsgPackDynamicPseudoType(val, typ, p, enc) - - } - if !val.IsKnown() { - err := enc.Encode(msgPackUnknownVal) - if err != nil { - return p.NewErrorf("error encoding UnknownValue: %w", err) - } - return nil - } - if val.IsNull() { - err := enc.EncodeNil() - if err != nil { - return p.NewErrorf("error encoding null value: %w", err) - } - return nil - } - switch { - case typ.Is(String): - return marshalMsgPackString(val, typ, p, enc) - case typ.Is(Number): - return marshalMsgPackNumber(val, typ, p, enc) - case typ.Is(Bool): - return marshalMsgPackBool(val, typ, p, enc) - case typ.Is(List{}): - return marshalMsgPackList(val, typ, p, enc) - case typ.Is(Set{}): - return marshalMsgPackSet(val, typ, p, enc) - case typ.Is(Map{}): - return marshalMsgPackMap(val, typ, p, enc) - case typ.Is(Tuple{}): - return marshalMsgPackTuple(val, typ, p, enc) - case typ.Is(Object{}): - return marshalMsgPackObject(val, typ, p, enc) - } - return fmt.Errorf("unknown type %s", typ) -} - -func marshalMsgPackDynamicPseudoType(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - typeJSON, err := val.typ.MarshalJSON() - if err != nil { - return p.NewErrorf("error generating JSON for type %s: %w", val.typ, err) - } - err = enc.EncodeArrayLen(2) - if err != nil { - return p.NewErrorf("error encoding array length: %w", err) - } - err = enc.EncodeBytes(typeJSON) - if err != nil { - return p.NewErrorf("error encoding JSON type info: %w", err) - } - err = marshalMsgPack(val, val.typ, p, enc) - if err != nil { - return p.NewErrorf("error marshaling DynamicPseudoType value: %w", err) - } - return nil -} - -func marshalMsgPackString(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - s, ok := val.value.(string) - if !ok { - return unexpectedValueTypeError(p, s, val.value, typ) - } - err := enc.EncodeString(s) - if err != nil { - return p.NewErrorf("error encoding string value: %w", err) - } - return nil -} - -func marshalMsgPackNumber(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - n, ok := val.value.(*big.Float) - if !ok { - return unexpectedValueTypeError(p, n, val.value, typ) - } - if n.IsInf() { - if n.Sign() == -1 { - err := enc.EncodeFloat64(math.Inf(-1)) - if err != nil { - return p.NewErrorf("error encoding negative infinity: %w", err) - } - } else if n.Sign() == 1 { - err := enc.EncodeFloat64(math.Inf(1)) - if err != nil { - return p.NewErrorf("error encoding positive infinity: %w", err) - } - } else { - return p.NewErrorf("error encoding unknown infiniy: sign %d is unknown", n.Sign()) - } - } else if iv, acc := n.Int64(); acc == big.Exact { - err := enc.EncodeInt(iv) - if err != nil { - return p.NewErrorf("error encoding int value: %w", err) - } - } else if fv, acc := n.Float64(); acc == big.Exact { - err := enc.EncodeFloat64(fv) - if err != nil { - return p.NewErrorf("error encoding float value: %w", err) - } - } else { - err := enc.EncodeString(n.Text('f', -1)) - if err != nil { - return p.NewErrorf("error encoding number string value: %w", err) - } - } - return nil -} - -func marshalMsgPackBool(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - b, ok := val.value.(bool) - if !ok { - return unexpectedValueTypeError(p, b, val.value, typ) - } - err := enc.EncodeBool(b) - if err != nil { - return p.NewErrorf("error encoding bool value: %w", err) - } - return nil -} - -func marshalMsgPackList(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - l, ok := val.value.([]Value) - if !ok { - return unexpectedValueTypeError(p, l, val.value, typ) - } - err := enc.EncodeArrayLen(len(l)) - if err != nil { - return p.NewErrorf("error encoding list length: %w", err) - } - for pos, i := range l { - p.WithElementKeyInt(int64(pos)) - err := marshalMsgPack(i, typ.(List).ElementType, p, enc) - if err != nil { - return err - } - p.WithoutLastStep() - } - return nil -} - -func marshalMsgPackSet(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - s, ok := val.value.([]Value) - if !ok { - return unexpectedValueTypeError(p, s, val.value, typ) - } - err := enc.EncodeArrayLen(len(s)) - if err != nil { - return p.NewErrorf("error encoding set length: %w", err) - } - for _, i := range s { - p.WithElementKeyValue(i) - err := marshalMsgPack(i, typ.(Set).ElementType, p, enc) - if err != nil { - return err - } - p.WithoutLastStep() - } - return nil -} - -func marshalMsgPackMap(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - m, ok := val.value.(map[string]Value) - if !ok { - return unexpectedValueTypeError(p, m, val.value, typ) - } - err := enc.EncodeMapLen(len(m)) - if err != nil { - return p.NewErrorf("error encoding map length: %w", err) - } - for k, v := range m { - p.WithElementKeyString(k) - err := marshalMsgPack(NewValue(String, k), String, p, enc) - if err != nil { - return p.NewErrorf("error encoding map key: %w", err) - } - err = marshalMsgPack(v, typ.(Map).AttributeType, p, enc) - if err != nil { - return err - } - p.WithoutLastStep() - } - return nil -} - -func marshalMsgPackTuple(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - t, ok := val.value.([]Value) - if !ok { - return unexpectedValueTypeError(p, t, val.value, typ) - } - types := typ.(Tuple).ElementTypes - err := enc.EncodeArrayLen(len(types)) - if err != nil { - return p.NewErrorf("error encoding tuple length: %w", err) - } - for pos, v := range t { - p.WithElementKeyInt(int64(pos)) - ty := types[pos] - err := marshalMsgPack(v, ty, p, enc) - if err != nil { - return err - } - p.WithoutLastStep() - } - return nil -} - -func marshalMsgPackObject(val Value, typ Type, p AttributePath, enc *msgpack.Encoder) error { - o, ok := val.value.(map[string]Value) - if !ok { - return unexpectedValueTypeError(p, o, val.value, typ) - } - types := typ.(Object).AttributeTypes - keys := make([]string, 0, len(types)) - for k := range types { - keys = append(keys, k) - } - sort.Strings(keys) - err := enc.EncodeMapLen(len(keys)) - if err != nil { - return p.NewErrorf("error encoding object length: %w", err) - } - for _, k := range keys { - p.WithAttributeName(k) - ty := types[k] - v, ok := o[k] - if !ok { - return p.NewErrorf("no value set") - } - err := marshalMsgPack(NewValue(String, k), String, p, enc) - if err != nil { - return err - } - err = marshalMsgPack(v, ty, p, enc) - if err != nil { - return err - } - p.WithoutLastStep() - } - return nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/data_source.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/data_source.go new file mode 100644 index 000000000..1feb2cf34 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/data_source.go @@ -0,0 +1,98 @@ +package tfprotov6 + +import ( + "context" +) + +// DataSourceServer is an interface containing the methods a data source +// implementation needs to fill. +type DataSourceServer interface { + // ValidateDataResourceConfig is called when Terraform is checking that a + // data source's configuration is valid. It is guaranteed to have types + // conforming to your schema, but it is not guaranteed that all values + // will be known. This is your opportunity to do custom or advanced + // validation prior to a plan being generated. + ValidateDataResourceConfig(context.Context, *ValidateDataResourceConfigRequest) (*ValidateDataResourceConfigResponse, error) + + // ReadDataSource is called when Terraform is refreshing a data + // source's state. + ReadDataSource(context.Context, *ReadDataSourceRequest) (*ReadDataSourceResponse, error) +} + +// ValidateDataResourceConfigRequest is the request Terraform sends when it wants +// to validate a data source's configuration. +type ValidateDataResourceConfigRequest struct { + // TypeName is the type of data source Terraform is validating. + TypeName string + + // Config is the configuration the user supplied for that data source. + // See the documentation on `DynamicValue` for more information about + // safely accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration may contain unknown values if a user uses + // interpolation or other functionality that would prevent Terraform + // from knowing the value at request time. + Config *DynamicValue +} + +// ValidateDataResourceConfigResponse is the response from the provider about the +// validity of a data source's configuration. +type ValidateDataResourceConfigResponse struct { + // Diagnostics report errors or warnings related to the given + // configuration. Returning an empty slice indicates a successful + // validation with no warnings or errors generated. + Diagnostics []*Diagnostic +} + +// ReadDataSourceRequest is the request Terraform sends when it wants to get +// the latest state for a data source. +type ReadDataSourceRequest struct { + // TypeName is the type of data source Terraform is requesting an + // updated state for. + TypeName string + + // Config is the configuration the user supplied for that data source. + // See the documentation on `DynamicValue` for information about safely + // accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration may have unknown values. + Config *DynamicValue + + // ProviderMeta supplies the provider metadata configuration for the + // module this data source is in. Module-specific provider metadata is + // an advanced feature and usage of it should be coordinated with the + // Terraform Core team by raising an issue at + // https://github.com/hashicorp/terraform/issues/new/choose. See the + // documentation on `DynamicValue` for information about safely + // accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration will have known values for all fields. + ProviderMeta *DynamicValue +} + +// ReadDataSourceResponse is the response from the provider about the current +// state of the requested data source. +type ReadDataSourceResponse struct { + // State is the current state of the data source, represented as a + // `DynamicValue`. See the documentation on `DynamicValue` for + // information about safely creating the `DynamicValue`. + // + // The state should be represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + State *DynamicValue + + // Diagnostics report errors or warnings related to retrieving the + // current state of the requested data source. Returning an empty slice + // indicates a successful validation with no warnings or errors + // generated. + Diagnostics []*Diagnostic +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/diagnostic.go new file mode 100644 index 000000000..c40d52ad0 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/diagnostic.go @@ -0,0 +1,58 @@ +package tfprotov6 + +import "github.com/hashicorp/terraform-plugin-go/tftypes" + +const ( + // DiagnosticSeverityInvalid is used to indicate an invalid + // `DiagnosticSeverity`. Provider developers should not use it. + DiagnosticSeverityInvalid DiagnosticSeverity = 0 + + // DiagnosticSeverityError is used to indicate that a `Diagnostic` + // represents an error and should halt Terraform execution. + DiagnosticSeverityError DiagnosticSeverity = 1 + + // DiagnosticSeverityWarning is used to indicate that a `Diagnostic` + // represents a warning and should not halt Terraform's execution, but + // it should be surfaced to the user. + DiagnosticSeverityWarning DiagnosticSeverity = 2 +) + +// Diagnostic is used to convey information back the user running Terraform. +type Diagnostic struct { + // Severity indicates how Terraform should handle the Diagnostic. + Severity DiagnosticSeverity + + // Summary is a brief description of the problem, roughly + // sentence-sized, and should provide a concise description of what + // went wrong. For example, a Summary could be as simple as "Invalid + // value.". + Summary string + + // Detail is a lengthier, more complete description of the problem. + // Detail should provide enough information that a user can resolve the + // problem entirely. For example, a Detail could be "Values must be + // alphanumeric and lowercase only." + Detail string + + // Attribute indicates which field, specifically, has the problem. Not + // setting this will indicate the entire resource; setting it will + // indicate that the problem is with a certain field in the resource, + // which helps users find the source of the problem. + Attribute *tftypes.AttributePath +} + +// DiagnosticSeverity represents different classes of Diagnostic which affect +// how Terraform handles the Diagnostics. +type DiagnosticSeverity int32 + +func (d DiagnosticSeverity) String() string { + switch d { + case 0: + return "INVALID" + case 1: + return "ERROR" + case 2: + return "WARNING" + } + return "UNKNOWN" +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/doc.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/doc.go new file mode 100644 index 000000000..875120cba --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/doc.go @@ -0,0 +1,29 @@ +// Package tfprotov6 provides the interfaces and types needed to build a +// Terraform provider server. +// +// All Terraform provider servers should be built on +// these types, to take advantage of the ecosystem and tooling built around +// them. +// +// These types are small wrappers around the Terraform protocol. It is assumed +// that developers using tfprotov6 are familiar with the protocol, its +// requirements, and its semantics. Developers not comfortable working with the +// raw protocol should use the github.com/hashicorp/terraform-plugin-sdk/v2 Go +// module instead, which offers a less verbose, safer way to develop a +// Terraform provider, albeit with less flexibility and power. +// +// Provider developers should start by defining a type that implements the +// `ProviderServer` interface. A struct is recommended, as it will allow you to +// store the configuration information attached to your provider for use in +// requests, but any type is technically possible. +// +// `ProviderServer` implementations will need to implement the composed +// interfaces, `ResourceServer` and `DataSourceServer`. It is recommended, but +// not required, to use an embedded `ResourceRouter` and `DataSourceRouter` in +// your `ProviderServer` to achieve this, which will let you handle requests +// for each resource and data source in a resource-specific or data +// source-specific function. +// +// To serve the `ProviderServer` implementation as a gRPC server that Terraform +// can connect to, use the `tfprotov6/server.Serve` function. +package tfprotov6 diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/dynamic_value.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/dynamic_value.go new file mode 100644 index 000000000..a9fd78420 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/dynamic_value.go @@ -0,0 +1,87 @@ +package tfprotov6 + +import ( + "errors" + + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +// ErrUnknownDynamicValueType is returned when a DynamicValue has no MsgPack or +// JSON bytes set. This should never be returned during the normal operation of +// a provider, and indicates one of the following: +// +// 1. terraform-plugin-go is out of sync with the protocol and should be +// updated. +// +// 2. terrafrom-plugin-go has a bug. +// +// 3. The `DynamicValue` was generated or modified by something other than +// terraform-plugin-go and is no longer a valid value. +var ErrUnknownDynamicValueType = errors.New("DynamicValue had no JSON or msgpack data set") + +// NewDynamicValue creates a DynamicValue from a tftypes.Value. You must +// specify the tftype.Type you want to send the value as, and it must be a type +// that is compatible with the Type of the Value. Usually it should just be the +// Type of the Value, but it can also be the DynamicPseudoType. +func NewDynamicValue(t tftypes.Type, v tftypes.Value) (DynamicValue, error) { + b, err := v.MarshalMsgPack(t) //nolint:staticcheck + if err != nil { + return DynamicValue{}, err + } + return DynamicValue{ + MsgPack: b, + }, nil +} + +// DynamicValue represents a nested encoding value that came from the protocol. +// The only way providers should ever interact with it is by calling its +// `Unmarshal` method to retrive a `tftypes.Value`. Although the type system +// allows for other interactions, they are explicitly not supported, and will +// not be considered when evaluating for breaking changes. Treat this type as +// an opaque value, and *only* call its `Unmarshal` method. +type DynamicValue struct { + MsgPack []byte + JSON []byte +} + +// Unmarshal returns a `tftypes.Value` that represents the information +// contained in the DynamicValue in an easy-to-interact-with way. It is the +// main purpose of the DynamicValue type, and is how provider developers should +// obtain config, state, and other values from the protocol. +// +// Pass in the type you want the `Value` to be interpreted as. Terraform's type +// system encodes in a lossy manner, meaning the type information is not +// preserved losslessly when going over the wire. Sets, lists, and tuples all +// look the same, as do user-specified values when the provider has a +// DynamicPseudoType in its schema. Objects and maps all look the same, as +// well, as do DynamicPseudoType values sometimes. Fortunately, the provider +// should already know the type; it should be the type of the schema, or +// PseudoDynamicType if that's what's in the schema. `Unmarshal` will then +// parse the value as though it belongs to that type, if possible, and return a +// `tftypes.Value` with the appropriate information. If the data can't be +// interpreted as that type, an error will be returned saying so. In these +// cases, double check to make sure the schema is declaring the same type being +// passed into `Unmarshal`. +// +// In the event an ErrUnknownDynamicValueType is returned, one of three things +// has happened: +// +// 1. terraform-plugin-go is out of date and out of sync with the protocol, and +// an issue should be opened on its repo to get it updated. +// +// 2. terraform-plugin-go has a bug somewhere, and an issue should be opened on +// its repo to get it fixed. +// +// 3. The provider or a dependency has modified the `DynamicValue` in an +// unsupported way, or has created one from scratch, and should treat it as +// opaque and not modify it, only calling `Unmarshal` on `DynamicValue`s +// received from RPC requests. +func (d DynamicValue) Unmarshal(typ tftypes.Type) (tftypes.Value, error) { + if d.JSON != nil { + return tftypes.ValueFromJSON(d.JSON, typ) //nolint:staticcheck + } + if d.MsgPack != nil { + return tftypes.ValueFromMsgPack(d.MsgPack, typ) //nolint:staticcheck + } + return tftypes.Value{}, ErrUnknownDynamicValueType +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/attribute_path.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/attribute_path.go new file mode 100644 index 000000000..c25c3cb0d --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/attribute_path.go @@ -0,0 +1,63 @@ +package fromproto + +import ( + "errors" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +var ErrUnknownAttributePathStepType = errors.New("unknown type of AttributePath_Step") + +func AttributePath(in *tfplugin6.AttributePath) (*tftypes.AttributePath, error) { + steps, err := AttributePathSteps(in.Steps) + if err != nil { + return nil, err + } + return tftypes.NewAttributePathWithSteps(steps), nil +} + +func AttributePaths(in []*tfplugin6.AttributePath) ([]*tftypes.AttributePath, error) { + resp := make([]*tftypes.AttributePath, 0, len(in)) + for _, a := range in { + if a == nil { + resp = append(resp, nil) + continue + } + attr, err := AttributePath(a) + if err != nil { + return resp, err + } + resp = append(resp, attr) + } + return resp, nil +} + +func AttributePathStep(step *tfplugin6.AttributePath_Step) (tftypes.AttributePathStep, error) { + selector := step.GetSelector() + if v, ok := selector.(*tfplugin6.AttributePath_Step_AttributeName); ok { + return tftypes.AttributeName(v.AttributeName), nil + } + if v, ok := selector.(*tfplugin6.AttributePath_Step_ElementKeyString); ok { + return tftypes.ElementKeyString(v.ElementKeyString), nil + } + if v, ok := selector.(*tfplugin6.AttributePath_Step_ElementKeyInt); ok { + return tftypes.ElementKeyInt(v.ElementKeyInt), nil + } + return nil, ErrUnknownAttributePathStepType +} + +func AttributePathSteps(in []*tfplugin6.AttributePath_Step) ([]tftypes.AttributePathStep, error) { + resp := make([]tftypes.AttributePathStep, 0, len(in)) + for _, step := range in { + if step == nil { + continue + } + s, err := AttributePathStep(step) + if err != nil { + return resp, err + } + resp = append(resp, s) + } + return resp, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/data_source.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/data_source.go new file mode 100644 index 000000000..130f6a821 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/data_source.go @@ -0,0 +1,53 @@ +package fromproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func ValidateDataResourceConfigRequest(in *tfplugin6.ValidateDataResourceConfig_Request) (*tfprotov6.ValidateDataResourceConfigRequest, error) { + resp := &tfprotov6.ValidateDataResourceConfigRequest{ + TypeName: in.TypeName, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return resp, nil +} + +func ValidateDataResourceConfigResponse(in *tfplugin6.ValidateDataResourceConfig_Response) (*tfprotov6.ValidateDataResourceConfigResponse, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfprotov6.ValidateDataResourceConfigResponse{ + Diagnostics: diags, + }, nil +} + +func ReadDataSourceRequest(in *tfplugin6.ReadDataSource_Request) (*tfprotov6.ReadDataSourceRequest, error) { + resp := &tfprotov6.ReadDataSourceRequest{ + TypeName: in.TypeName, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func ReadDataSourceResponse(in *tfplugin6.ReadDataSource_Response) (*tfprotov6.ReadDataSourceResponse, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + resp := &tfprotov6.ReadDataSourceResponse{ + Diagnostics: diags, + } + if in.State != nil { + resp.State = DynamicValue(in.State) + } + return resp, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/diagnostic.go new file mode 100644 index 000000000..ac92796fb --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/diagnostic.go @@ -0,0 +1,42 @@ +package fromproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func Diagnostic(in *tfplugin6.Diagnostic) (*tfprotov6.Diagnostic, error) { + diag := &tfprotov6.Diagnostic{ + Severity: DiagnosticSeverity(in.Severity), + Summary: in.Summary, + Detail: in.Detail, + } + if in.Attribute != nil { + attr, err := AttributePath(in.Attribute) + if err != nil { + return diag, err + } + diag.Attribute = attr + } + return diag, nil +} + +func DiagnosticSeverity(in tfplugin6.Diagnostic_Severity) tfprotov6.DiagnosticSeverity { + return tfprotov6.DiagnosticSeverity(in) +} + +func Diagnostics(in []*tfplugin6.Diagnostic) ([]*tfprotov6.Diagnostic, error) { + diagnostics := make([]*tfprotov6.Diagnostic, 0, len(in)) + for _, diag := range in { + if diag == nil { + diagnostics = append(diagnostics, nil) + continue + } + d, err := Diagnostic(diag) + if err != nil { + return diagnostics, err + } + diagnostics = append(diagnostics, d) + } + return diagnostics, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/provider.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/provider.go new file mode 100644 index 000000000..2000b9bb0 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/provider.go @@ -0,0 +1,106 @@ +package fromproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func GetProviderSchemaRequest(in *tfplugin6.GetProviderSchema_Request) (*tfprotov6.GetProviderSchemaRequest, error) { + return &tfprotov6.GetProviderSchemaRequest{}, nil +} + +func GetProviderSchemaResponse(in *tfplugin6.GetProviderSchema_Response) (*tfprotov6.GetProviderSchemaResponse, error) { + var resp tfprotov6.GetProviderSchemaResponse + if in.Provider != nil { + schema, err := Schema(in.Provider) + if err != nil { + return &resp, err + } + resp.Provider = schema + } + if in.ProviderMeta != nil { + schema, err := Schema(in.ProviderMeta) + if err != nil { + return &resp, err + } + resp.ProviderMeta = schema + } + resp.ResourceSchemas = make(map[string]*tfprotov6.Schema, len(in.ResourceSchemas)) + for k, v := range in.ResourceSchemas { + if v == nil { + resp.ResourceSchemas[k] = nil + continue + } + schema, err := Schema(v) + if err != nil { + return &resp, err + } + resp.ResourceSchemas[k] = schema + } + resp.DataSourceSchemas = make(map[string]*tfprotov6.Schema, len(in.DataSourceSchemas)) + for k, v := range in.DataSourceSchemas { + if v == nil { + resp.DataSourceSchemas[k] = nil + continue + } + schema, err := Schema(v) + if err != nil { + return &resp, err + } + resp.DataSourceSchemas[k] = schema + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return &resp, err + } + resp.Diagnostics = diags + return &resp, nil +} + +func ValidateProviderConfigRequest(in *tfplugin6.ValidateProviderConfig_Request) (*tfprotov6.ValidateProviderConfigRequest, error) { + var resp tfprotov6.ValidateProviderConfigRequest + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return &resp, nil +} + +func ValidateProviderConfigResponse(in *tfplugin6.ValidateProviderConfig_Response) (*tfprotov6.ValidateProviderConfigResponse, error) { + var resp tfprotov6.ValidateProviderConfigResponse + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + resp.Diagnostics = diags + return &resp, nil +} + +func ConfigureProviderRequest(in *tfplugin6.ConfigureProvider_Request) (*tfprotov6.ConfigureProviderRequest, error) { + resp := &tfprotov6.ConfigureProviderRequest{ + TerraformVersion: in.TerraformVersion, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return resp, nil +} + +func ConfigureProviderResponse(in *tfplugin6.ConfigureProvider_Response) (*tfprotov6.ConfigureProviderResponse, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfprotov6.ConfigureProviderResponse{ + Diagnostics: diags, + }, nil +} + +func StopProviderRequest(in *tfplugin6.StopProvider_Request) (*tfprotov6.StopProviderRequest, error) { + return &tfprotov6.StopProviderRequest{}, nil +} + +func StopProviderResponse(in *tfplugin6.StopProvider_Response) (*tfprotov6.StopProviderResponse, error) { + return &tfprotov6.StopProviderResponse{ + Error: in.Error, + }, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/resource.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/resource.go new file mode 100644 index 000000000..94addd801 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/resource.go @@ -0,0 +1,208 @@ +package fromproto + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func ValidateResourceConfigRequest(in *tfplugin6.ValidateResourceConfig_Request) (*tfprotov6.ValidateResourceConfigRequest, error) { + resp := &tfprotov6.ValidateResourceConfigRequest{ + TypeName: in.TypeName, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return resp, nil +} + +func ValidateResourceConfigResponse(in *tfplugin6.ValidateResourceConfig_Response) (*tfprotov6.ValidateResourceConfigResponse, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfprotov6.ValidateResourceConfigResponse{ + Diagnostics: diags, + }, nil +} + +func UpgradeResourceStateRequest(in *tfplugin6.UpgradeResourceState_Request) (*tfprotov6.UpgradeResourceStateRequest, error) { + resp := &tfprotov6.UpgradeResourceStateRequest{ + TypeName: in.TypeName, + Version: in.Version, + } + if in.RawState != nil { + resp.RawState = RawState(in.RawState) + } + return resp, nil +} + +func UpgradeResourceStateResponse(in *tfplugin6.UpgradeResourceState_Response) (*tfprotov6.UpgradeResourceStateResponse, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + resp := &tfprotov6.UpgradeResourceStateResponse{ + Diagnostics: diags, + } + if in.UpgradedState != nil { + resp.UpgradedState = DynamicValue(in.UpgradedState) + } + return resp, nil +} + +func ReadResourceRequest(in *tfplugin6.ReadResource_Request) (*tfprotov6.ReadResourceRequest, error) { + resp := &tfprotov6.ReadResourceRequest{ + TypeName: in.TypeName, + Private: in.Private, + } + if in.CurrentState != nil { + resp.CurrentState = DynamicValue(in.CurrentState) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func ReadResourceResponse(in *tfplugin6.ReadResource_Response) (*tfprotov6.ReadResourceResponse, error) { + resp := &tfprotov6.ReadResourceResponse{ + Private: in.Private, + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return resp, err + } + resp.Diagnostics = diags + if in.NewState != nil { + resp.NewState = DynamicValue(in.NewState) + } + return resp, nil +} + +func PlanResourceChangeRequest(in *tfplugin6.PlanResourceChange_Request) (*tfprotov6.PlanResourceChangeRequest, error) { + resp := &tfprotov6.PlanResourceChangeRequest{ + TypeName: in.TypeName, + PriorPrivate: in.PriorPrivate, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + if in.PriorState != nil { + resp.PriorState = DynamicValue(in.PriorState) + } + if in.ProposedNewState != nil { + resp.ProposedNewState = DynamicValue(in.ProposedNewState) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func PlanResourceChangeResponse(in *tfplugin6.PlanResourceChange_Response) (*tfprotov6.PlanResourceChangeResponse, error) { + resp := &tfprotov6.PlanResourceChangeResponse{ + PlannedPrivate: in.PlannedPrivate, + UnsafeToUseLegacyTypeSystem: in.LegacyTypeSystem, + } + attributePaths, err := AttributePaths(in.RequiresReplace) + if err != nil { + return resp, err + } + resp.RequiresReplace = attributePaths + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return resp, err + } + resp.Diagnostics = diags + if in.PlannedState != nil { + resp.PlannedState = DynamicValue(in.PlannedState) + } + return resp, nil +} + +func ApplyResourceChangeRequest(in *tfplugin6.ApplyResourceChange_Request) (*tfprotov6.ApplyResourceChangeRequest, error) { + resp := &tfprotov6.ApplyResourceChangeRequest{ + TypeName: in.TypeName, + PlannedPrivate: in.PlannedPrivate, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + if in.PriorState != nil { + resp.PriorState = DynamicValue(in.PriorState) + } + if in.PlannedState != nil { + resp.PlannedState = DynamicValue(in.PlannedState) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func ApplyResourceChangeResponse(in *tfplugin6.ApplyResourceChange_Response) (*tfprotov6.ApplyResourceChangeResponse, error) { + resp := &tfprotov6.ApplyResourceChangeResponse{ + Private: in.Private, + UnsafeToUseLegacyTypeSystem: in.LegacyTypeSystem, + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return resp, err + } + resp.Diagnostics = diags + if in.NewState != nil { + resp.NewState = DynamicValue(in.NewState) + } + return resp, nil +} + +func ImportResourceStateRequest(in *tfplugin6.ImportResourceState_Request) (*tfprotov6.ImportResourceStateRequest, error) { + return &tfprotov6.ImportResourceStateRequest{ + TypeName: in.TypeName, + ID: in.Id, + }, nil +} + +func ImportResourceStateResponse(in *tfplugin6.ImportResourceState_Response) (*tfprotov6.ImportResourceStateResponse, error) { + imported, err := ImportedResources(in.ImportedResources) + if err != nil { + return nil, err + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfprotov6.ImportResourceStateResponse{ + ImportedResources: imported, + Diagnostics: diags, + }, nil +} + +func ImportedResource(in *tfplugin6.ImportResourceState_ImportedResource) (*tfprotov6.ImportedResource, error) { + resp := &tfprotov6.ImportedResource{ + TypeName: in.TypeName, + Private: in.Private, + } + if in.State != nil { + resp.State = DynamicValue(in.State) + } + return resp, nil +} + +func ImportedResources(in []*tfplugin6.ImportResourceState_ImportedResource) ([]*tfprotov6.ImportedResource, error) { + resp := make([]*tfprotov6.ImportedResource, 0, len(in)) + for pos, i := range in { + if i == nil { + resp = append(resp, nil) + continue + } + r, err := ImportedResource(i) + if err != nil { + return resp, fmt.Errorf("Error converting imported resource %d/%d: %w", pos+1, len(in), err) + } + resp = append(resp, r) + } + return resp, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/schema.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/schema.go new file mode 100644 index 000000000..db720246f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/schema.go @@ -0,0 +1,144 @@ +package fromproto + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +func Schema(in *tfplugin6.Schema) (*tfprotov6.Schema, error) { + var resp tfprotov6.Schema + resp.Version = in.Version + if in.Block != nil { + block, err := SchemaBlock(in.Block) + if err != nil { + return &resp, err + } + resp.Block = block + } + return &resp, nil +} + +func SchemaBlock(in *tfplugin6.Schema_Block) (*tfprotov6.SchemaBlock, error) { + resp := &tfprotov6.SchemaBlock{ + Version: in.Version, + Description: in.Description, + DescriptionKind: StringKind(in.DescriptionKind), + Deprecated: in.Deprecated, + } + attrs, err := SchemaAttributes(in.Attributes) + if err != nil { + return resp, err + } + resp.Attributes = attrs + blocks, err := SchemaNestedBlocks(in.BlockTypes) + if err != nil { + return resp, err + } + resp.BlockTypes = blocks + return resp, nil +} + +func SchemaAttribute(in *tfplugin6.Schema_Attribute) (*tfprotov6.SchemaAttribute, error) { + resp := &tfprotov6.SchemaAttribute{ + Name: in.Name, + Description: in.Description, + Required: in.Required, + Optional: in.Optional, + Computed: in.Computed, + Sensitive: in.Sensitive, + DescriptionKind: StringKind(in.DescriptionKind), + Deprecated: in.Deprecated, + } + + if in.Type != nil { + typ, err := tftypes.ParseJSONType(in.Type) //nolint:staticcheck + if err != nil { + return resp, err + } + resp.Type = typ + } + + if in.NestedType != nil { + nb, err := SchemaObject(in.NestedType) + if err != nil { + return resp, err + } + resp.NestedType = nb + } + + return resp, nil +} + +func SchemaAttributes(in []*tfplugin6.Schema_Attribute) ([]*tfprotov6.SchemaAttribute, error) { + resp := make([]*tfprotov6.SchemaAttribute, 0, len(in)) + for pos, a := range in { + if a == nil { + resp = append(resp, nil) + continue + } + attr, err := SchemaAttribute(a) + if err != nil { + return resp, fmt.Errorf("error converting schema attribute %d: %w", pos, err) + } + resp = append(resp, attr) + } + return resp, nil +} + +func SchemaNestedBlock(in *tfplugin6.Schema_NestedBlock) (*tfprotov6.SchemaNestedBlock, error) { + resp := &tfprotov6.SchemaNestedBlock{ + TypeName: in.TypeName, + Nesting: SchemaNestedBlockNestingMode(in.Nesting), + MinItems: in.MinItems, + MaxItems: in.MaxItems, + } + if in.Block != nil { + block, err := SchemaBlock(in.Block) + if err != nil { + return resp, err + } + resp.Block = block + } + return resp, nil +} + +func SchemaNestedBlocks(in []*tfplugin6.Schema_NestedBlock) ([]*tfprotov6.SchemaNestedBlock, error) { + resp := make([]*tfprotov6.SchemaNestedBlock, 0, len(in)) + for pos, b := range in { + if b == nil { + resp = append(resp, nil) + continue + } + block, err := SchemaNestedBlock(b) + if err != nil { + return resp, fmt.Errorf("error converting nested block %d: %w", pos, err) + } + resp = append(resp, block) + } + return resp, nil +} + +func SchemaNestedBlockNestingMode(in tfplugin6.Schema_NestedBlock_NestingMode) tfprotov6.SchemaNestedBlockNestingMode { + return tfprotov6.SchemaNestedBlockNestingMode(in) +} + +func SchemaObjectNestingMode(in tfplugin6.Schema_Object_NestingMode) tfprotov6.SchemaObjectNestingMode { + return tfprotov6.SchemaObjectNestingMode(in) +} + +func SchemaObject(in *tfplugin6.Schema_Object) (*tfprotov6.SchemaObject, error) { + resp := &tfprotov6.SchemaObject{ + Nesting: SchemaObjectNestingMode(in.Nesting), + } + + attrs, err := SchemaAttributes(in.Attributes) + if err != nil { + return nil, err + } + + resp.Attributes = attrs + return resp, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/state.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/state.go new file mode 100644 index 000000000..0aa2a5a6a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/state.go @@ -0,0 +1,13 @@ +package fromproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func RawState(in *tfplugin6.RawState) *tfprotov6.RawState { + return &tfprotov6.RawState{ + JSON: in.Json, + Flatmap: in.Flatmap, + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/string_kind.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/string_kind.go new file mode 100644 index 000000000..f2b110753 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/string_kind.go @@ -0,0 +1,10 @@ +package fromproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func StringKind(in tfplugin6.StringKind) tfprotov6.StringKind { + return tfprotov6.StringKind(in) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/types.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/types.go new file mode 100644 index 000000000..87127f4a6 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto/types.go @@ -0,0 +1,13 @@ +package fromproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func DynamicValue(in *tfplugin6.DynamicValue) *tfprotov6.DynamicValue { + return &tfprotov6.DynamicValue{ + MsgPack: in.Msgpack, + JSON: in.Json, + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.pb.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.pb.go new file mode 100644 index 000000000..a61e1875c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.pb.go @@ -0,0 +1,4169 @@ +// Terraform Plugin RPC protocol version 6.2 +// +// This file defines version 6.2 of the RPC protocol. To implement a plugin +// against this protocol, copy this definition into your own codebase and +// use protoc to generate stubs for your target language. +// +// This file will not be updated. Any minor versions of protocol 6 to follow +// should copy this file and modify the copy while maintaing backwards +// compatibility. Breaking changes, if any are required, will come +// in a subsequent major version with its own separate proto definition. +// +// Note that only the proto files included in a release tag of Terraform are +// official protocol releases. Proto files taken from other commits may include +// incomplete changes or features that did not make it into a final release. +// In all reasonable cases, plugin developers should take the proto file from +// the tag of the most recent release of Terraform, and not from the main +// branch or any other development branch. +// + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.19.4 +// source: tfplugin6.proto + +package tfplugin6 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StringKind int32 + +const ( + StringKind_PLAIN StringKind = 0 + StringKind_MARKDOWN StringKind = 1 +) + +// Enum value maps for StringKind. +var ( + StringKind_name = map[int32]string{ + 0: "PLAIN", + 1: "MARKDOWN", + } + StringKind_value = map[string]int32{ + "PLAIN": 0, + "MARKDOWN": 1, + } +) + +func (x StringKind) Enum() *StringKind { + p := new(StringKind) + *p = x + return p +} + +func (x StringKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (StringKind) Descriptor() protoreflect.EnumDescriptor { + return file_tfplugin6_proto_enumTypes[0].Descriptor() +} + +func (StringKind) Type() protoreflect.EnumType { + return &file_tfplugin6_proto_enumTypes[0] +} + +func (x StringKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use StringKind.Descriptor instead. +func (StringKind) EnumDescriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{0} +} + +type Diagnostic_Severity int32 + +const ( + Diagnostic_INVALID Diagnostic_Severity = 0 + Diagnostic_ERROR Diagnostic_Severity = 1 + Diagnostic_WARNING Diagnostic_Severity = 2 +) + +// Enum value maps for Diagnostic_Severity. +var ( + Diagnostic_Severity_name = map[int32]string{ + 0: "INVALID", + 1: "ERROR", + 2: "WARNING", + } + Diagnostic_Severity_value = map[string]int32{ + "INVALID": 0, + "ERROR": 1, + "WARNING": 2, + } +) + +func (x Diagnostic_Severity) Enum() *Diagnostic_Severity { + p := new(Diagnostic_Severity) + *p = x + return p +} + +func (x Diagnostic_Severity) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Diagnostic_Severity) Descriptor() protoreflect.EnumDescriptor { + return file_tfplugin6_proto_enumTypes[1].Descriptor() +} + +func (Diagnostic_Severity) Type() protoreflect.EnumType { + return &file_tfplugin6_proto_enumTypes[1] +} + +func (x Diagnostic_Severity) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Diagnostic_Severity.Descriptor instead. +func (Diagnostic_Severity) EnumDescriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{1, 0} +} + +type Schema_NestedBlock_NestingMode int32 + +const ( + Schema_NestedBlock_INVALID Schema_NestedBlock_NestingMode = 0 + Schema_NestedBlock_SINGLE Schema_NestedBlock_NestingMode = 1 + Schema_NestedBlock_LIST Schema_NestedBlock_NestingMode = 2 + Schema_NestedBlock_SET Schema_NestedBlock_NestingMode = 3 + Schema_NestedBlock_MAP Schema_NestedBlock_NestingMode = 4 + Schema_NestedBlock_GROUP Schema_NestedBlock_NestingMode = 5 +) + +// Enum value maps for Schema_NestedBlock_NestingMode. +var ( + Schema_NestedBlock_NestingMode_name = map[int32]string{ + 0: "INVALID", + 1: "SINGLE", + 2: "LIST", + 3: "SET", + 4: "MAP", + 5: "GROUP", + } + Schema_NestedBlock_NestingMode_value = map[string]int32{ + "INVALID": 0, + "SINGLE": 1, + "LIST": 2, + "SET": 3, + "MAP": 4, + "GROUP": 5, + } +) + +func (x Schema_NestedBlock_NestingMode) Enum() *Schema_NestedBlock_NestingMode { + p := new(Schema_NestedBlock_NestingMode) + *p = x + return p +} + +func (x Schema_NestedBlock_NestingMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Schema_NestedBlock_NestingMode) Descriptor() protoreflect.EnumDescriptor { + return file_tfplugin6_proto_enumTypes[2].Descriptor() +} + +func (Schema_NestedBlock_NestingMode) Type() protoreflect.EnumType { + return &file_tfplugin6_proto_enumTypes[2] +} + +func (x Schema_NestedBlock_NestingMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Schema_NestedBlock_NestingMode.Descriptor instead. +func (Schema_NestedBlock_NestingMode) EnumDescriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{5, 2, 0} +} + +type Schema_Object_NestingMode int32 + +const ( + Schema_Object_INVALID Schema_Object_NestingMode = 0 + Schema_Object_SINGLE Schema_Object_NestingMode = 1 + Schema_Object_LIST Schema_Object_NestingMode = 2 + Schema_Object_SET Schema_Object_NestingMode = 3 + Schema_Object_MAP Schema_Object_NestingMode = 4 +) + +// Enum value maps for Schema_Object_NestingMode. +var ( + Schema_Object_NestingMode_name = map[int32]string{ + 0: "INVALID", + 1: "SINGLE", + 2: "LIST", + 3: "SET", + 4: "MAP", + } + Schema_Object_NestingMode_value = map[string]int32{ + "INVALID": 0, + "SINGLE": 1, + "LIST": 2, + "SET": 3, + "MAP": 4, + } +) + +func (x Schema_Object_NestingMode) Enum() *Schema_Object_NestingMode { + p := new(Schema_Object_NestingMode) + *p = x + return p +} + +func (x Schema_Object_NestingMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Schema_Object_NestingMode) Descriptor() protoreflect.EnumDescriptor { + return file_tfplugin6_proto_enumTypes[3].Descriptor() +} + +func (Schema_Object_NestingMode) Type() protoreflect.EnumType { + return &file_tfplugin6_proto_enumTypes[3] +} + +func (x Schema_Object_NestingMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Schema_Object_NestingMode.Descriptor instead. +func (Schema_Object_NestingMode) EnumDescriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{5, 3, 0} +} + +// DynamicValue is an opaque encoding of terraform data, with the field name +// indicating the encoding scheme used. +type DynamicValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msgpack []byte `protobuf:"bytes,1,opt,name=msgpack,proto3" json:"msgpack,omitempty"` + Json []byte `protobuf:"bytes,2,opt,name=json,proto3" json:"json,omitempty"` +} + +func (x *DynamicValue) Reset() { + *x = DynamicValue{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DynamicValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DynamicValue) ProtoMessage() {} + +func (x *DynamicValue) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DynamicValue.ProtoReflect.Descriptor instead. +func (*DynamicValue) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{0} +} + +func (x *DynamicValue) GetMsgpack() []byte { + if x != nil { + return x.Msgpack + } + return nil +} + +func (x *DynamicValue) GetJson() []byte { + if x != nil { + return x.Json + } + return nil +} + +type Diagnostic struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Severity Diagnostic_Severity `protobuf:"varint,1,opt,name=severity,proto3,enum=tfplugin6.Diagnostic_Severity" json:"severity,omitempty"` + Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` + Detail string `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"` + Attribute *AttributePath `protobuf:"bytes,4,opt,name=attribute,proto3" json:"attribute,omitempty"` +} + +func (x *Diagnostic) Reset() { + *x = Diagnostic{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Diagnostic) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Diagnostic) ProtoMessage() {} + +func (x *Diagnostic) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Diagnostic.ProtoReflect.Descriptor instead. +func (*Diagnostic) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{1} +} + +func (x *Diagnostic) GetSeverity() Diagnostic_Severity { + if x != nil { + return x.Severity + } + return Diagnostic_INVALID +} + +func (x *Diagnostic) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +func (x *Diagnostic) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +func (x *Diagnostic) GetAttribute() *AttributePath { + if x != nil { + return x.Attribute + } + return nil +} + +type AttributePath struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Steps []*AttributePath_Step `protobuf:"bytes,1,rep,name=steps,proto3" json:"steps,omitempty"` +} + +func (x *AttributePath) Reset() { + *x = AttributePath{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AttributePath) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AttributePath) ProtoMessage() {} + +func (x *AttributePath) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AttributePath.ProtoReflect.Descriptor instead. +func (*AttributePath) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{2} +} + +func (x *AttributePath) GetSteps() []*AttributePath_Step { + if x != nil { + return x.Steps + } + return nil +} + +type StopProvider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StopProvider) Reset() { + *x = StopProvider{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopProvider) ProtoMessage() {} + +func (x *StopProvider) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopProvider.ProtoReflect.Descriptor instead. +func (*StopProvider) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{3} +} + +// RawState holds the stored state for a resource to be upgraded by the +// provider. It can be in one of two formats, the current json encoded format +// in bytes, or the legacy flatmap format as a map of strings. +type RawState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Json []byte `protobuf:"bytes,1,opt,name=json,proto3" json:"json,omitempty"` + Flatmap map[string]string `protobuf:"bytes,2,rep,name=flatmap,proto3" json:"flatmap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RawState) Reset() { + *x = RawState{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RawState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RawState) ProtoMessage() {} + +func (x *RawState) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RawState.ProtoReflect.Descriptor instead. +func (*RawState) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{4} +} + +func (x *RawState) GetJson() []byte { + if x != nil { + return x.Json + } + return nil +} + +func (x *RawState) GetFlatmap() map[string]string { + if x != nil { + return x.Flatmap + } + return nil +} + +// Schema is the configuration schema for a Resource or Provider. +type Schema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The version of the schema. + // Schemas are versioned, so that providers can upgrade a saved resource + // state when the schema is changed. + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // Block is the top level configuration block for this schema. + Block *Schema_Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` +} + +func (x *Schema) Reset() { + *x = Schema{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema) ProtoMessage() {} + +func (x *Schema) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema.ProtoReflect.Descriptor instead. +func (*Schema) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{5} +} + +func (x *Schema) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *Schema) GetBlock() *Schema_Block { + if x != nil { + return x.Block + } + return nil +} + +type GetProviderSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetProviderSchema) Reset() { + *x = GetProviderSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProviderSchema) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProviderSchema) ProtoMessage() {} + +func (x *GetProviderSchema) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProviderSchema.ProtoReflect.Descriptor instead. +func (*GetProviderSchema) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{6} +} + +type ValidateProviderConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ValidateProviderConfig) Reset() { + *x = ValidateProviderConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateProviderConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateProviderConfig) ProtoMessage() {} + +func (x *ValidateProviderConfig) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateProviderConfig.ProtoReflect.Descriptor instead. +func (*ValidateProviderConfig) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{7} +} + +type UpgradeResourceState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpgradeResourceState) Reset() { + *x = UpgradeResourceState{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpgradeResourceState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpgradeResourceState) ProtoMessage() {} + +func (x *UpgradeResourceState) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpgradeResourceState.ProtoReflect.Descriptor instead. +func (*UpgradeResourceState) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{8} +} + +type ValidateResourceConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ValidateResourceConfig) Reset() { + *x = ValidateResourceConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateResourceConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateResourceConfig) ProtoMessage() {} + +func (x *ValidateResourceConfig) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateResourceConfig.ProtoReflect.Descriptor instead. +func (*ValidateResourceConfig) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{9} +} + +type ValidateDataResourceConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ValidateDataResourceConfig) Reset() { + *x = ValidateDataResourceConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateDataResourceConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateDataResourceConfig) ProtoMessage() {} + +func (x *ValidateDataResourceConfig) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateDataResourceConfig.ProtoReflect.Descriptor instead. +func (*ValidateDataResourceConfig) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{10} +} + +type ConfigureProvider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ConfigureProvider) Reset() { + *x = ConfigureProvider{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigureProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigureProvider) ProtoMessage() {} + +func (x *ConfigureProvider) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigureProvider.ProtoReflect.Descriptor instead. +func (*ConfigureProvider) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{11} +} + +type ReadResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ReadResource) Reset() { + *x = ReadResource{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResource) ProtoMessage() {} + +func (x *ReadResource) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadResource.ProtoReflect.Descriptor instead. +func (*ReadResource) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{12} +} + +type PlanResourceChange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PlanResourceChange) Reset() { + *x = PlanResourceChange{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlanResourceChange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlanResourceChange) ProtoMessage() {} + +func (x *PlanResourceChange) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlanResourceChange.ProtoReflect.Descriptor instead. +func (*PlanResourceChange) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{13} +} + +type ApplyResourceChange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ApplyResourceChange) Reset() { + *x = ApplyResourceChange{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyResourceChange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyResourceChange) ProtoMessage() {} + +func (x *ApplyResourceChange) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyResourceChange.ProtoReflect.Descriptor instead. +func (*ApplyResourceChange) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{14} +} + +type ImportResourceState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ImportResourceState) Reset() { + *x = ImportResourceState{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportResourceState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportResourceState) ProtoMessage() {} + +func (x *ImportResourceState) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportResourceState.ProtoReflect.Descriptor instead. +func (*ImportResourceState) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{15} +} + +type ReadDataSource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ReadDataSource) Reset() { + *x = ReadDataSource{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadDataSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadDataSource) ProtoMessage() {} + +func (x *ReadDataSource) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadDataSource.ProtoReflect.Descriptor instead. +func (*ReadDataSource) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{16} +} + +type AttributePath_Step struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Selector: + // *AttributePath_Step_AttributeName + // *AttributePath_Step_ElementKeyString + // *AttributePath_Step_ElementKeyInt + Selector isAttributePath_Step_Selector `protobuf_oneof:"selector"` +} + +func (x *AttributePath_Step) Reset() { + *x = AttributePath_Step{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AttributePath_Step) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AttributePath_Step) ProtoMessage() {} + +func (x *AttributePath_Step) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AttributePath_Step.ProtoReflect.Descriptor instead. +func (*AttributePath_Step) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{2, 0} +} + +func (m *AttributePath_Step) GetSelector() isAttributePath_Step_Selector { + if m != nil { + return m.Selector + } + return nil +} + +func (x *AttributePath_Step) GetAttributeName() string { + if x, ok := x.GetSelector().(*AttributePath_Step_AttributeName); ok { + return x.AttributeName + } + return "" +} + +func (x *AttributePath_Step) GetElementKeyString() string { + if x, ok := x.GetSelector().(*AttributePath_Step_ElementKeyString); ok { + return x.ElementKeyString + } + return "" +} + +func (x *AttributePath_Step) GetElementKeyInt() int64 { + if x, ok := x.GetSelector().(*AttributePath_Step_ElementKeyInt); ok { + return x.ElementKeyInt + } + return 0 +} + +type isAttributePath_Step_Selector interface { + isAttributePath_Step_Selector() +} + +type AttributePath_Step_AttributeName struct { + // Set "attribute_name" to represent looking up an attribute + // in the current object value. + AttributeName string `protobuf:"bytes,1,opt,name=attribute_name,json=attributeName,proto3,oneof"` +} + +type AttributePath_Step_ElementKeyString struct { + // Set "element_key_*" to represent looking up an element in + // an indexable collection type. + ElementKeyString string `protobuf:"bytes,2,opt,name=element_key_string,json=elementKeyString,proto3,oneof"` +} + +type AttributePath_Step_ElementKeyInt struct { + ElementKeyInt int64 `protobuf:"varint,3,opt,name=element_key_int,json=elementKeyInt,proto3,oneof"` +} + +func (*AttributePath_Step_AttributeName) isAttributePath_Step_Selector() {} + +func (*AttributePath_Step_ElementKeyString) isAttributePath_Step_Selector() {} + +func (*AttributePath_Step_ElementKeyInt) isAttributePath_Step_Selector() {} + +type StopProvider_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StopProvider_Request) Reset() { + *x = StopProvider_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopProvider_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopProvider_Request) ProtoMessage() {} + +func (x *StopProvider_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopProvider_Request.ProtoReflect.Descriptor instead. +func (*StopProvider_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{3, 0} +} + +type StopProvider_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error string `protobuf:"bytes,1,opt,name=Error,proto3" json:"Error,omitempty"` +} + +func (x *StopProvider_Response) Reset() { + *x = StopProvider_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopProvider_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopProvider_Response) ProtoMessage() {} + +func (x *StopProvider_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopProvider_Response.ProtoReflect.Descriptor instead. +func (*StopProvider_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *StopProvider_Response) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +type Schema_Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Attributes []*Schema_Attribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"` + BlockTypes []*Schema_NestedBlock `protobuf:"bytes,3,rep,name=block_types,json=blockTypes,proto3" json:"block_types,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + DescriptionKind StringKind `protobuf:"varint,5,opt,name=description_kind,json=descriptionKind,proto3,enum=tfplugin6.StringKind" json:"description_kind,omitempty"` + Deprecated bool `protobuf:"varint,6,opt,name=deprecated,proto3" json:"deprecated,omitempty"` +} + +func (x *Schema_Block) Reset() { + *x = Schema_Block{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema_Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema_Block) ProtoMessage() {} + +func (x *Schema_Block) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema_Block.ProtoReflect.Descriptor instead. +func (*Schema_Block) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *Schema_Block) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *Schema_Block) GetAttributes() []*Schema_Attribute { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Schema_Block) GetBlockTypes() []*Schema_NestedBlock { + if x != nil { + return x.BlockTypes + } + return nil +} + +func (x *Schema_Block) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Schema_Block) GetDescriptionKind() StringKind { + if x != nil { + return x.DescriptionKind + } + return StringKind_PLAIN +} + +func (x *Schema_Block) GetDeprecated() bool { + if x != nil { + return x.Deprecated + } + return false +} + +type Schema_Attribute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type []byte `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + NestedType *Schema_Object `protobuf:"bytes,10,opt,name=nested_type,json=nestedType,proto3" json:"nested_type,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` + Optional bool `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"` + Computed bool `protobuf:"varint,6,opt,name=computed,proto3" json:"computed,omitempty"` + Sensitive bool `protobuf:"varint,7,opt,name=sensitive,proto3" json:"sensitive,omitempty"` + DescriptionKind StringKind `protobuf:"varint,8,opt,name=description_kind,json=descriptionKind,proto3,enum=tfplugin6.StringKind" json:"description_kind,omitempty"` + Deprecated bool `protobuf:"varint,9,opt,name=deprecated,proto3" json:"deprecated,omitempty"` +} + +func (x *Schema_Attribute) Reset() { + *x = Schema_Attribute{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema_Attribute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema_Attribute) ProtoMessage() {} + +func (x *Schema_Attribute) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema_Attribute.ProtoReflect.Descriptor instead. +func (*Schema_Attribute) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *Schema_Attribute) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Schema_Attribute) GetType() []byte { + if x != nil { + return x.Type + } + return nil +} + +func (x *Schema_Attribute) GetNestedType() *Schema_Object { + if x != nil { + return x.NestedType + } + return nil +} + +func (x *Schema_Attribute) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Schema_Attribute) GetRequired() bool { + if x != nil { + return x.Required + } + return false +} + +func (x *Schema_Attribute) GetOptional() bool { + if x != nil { + return x.Optional + } + return false +} + +func (x *Schema_Attribute) GetComputed() bool { + if x != nil { + return x.Computed + } + return false +} + +func (x *Schema_Attribute) GetSensitive() bool { + if x != nil { + return x.Sensitive + } + return false +} + +func (x *Schema_Attribute) GetDescriptionKind() StringKind { + if x != nil { + return x.DescriptionKind + } + return StringKind_PLAIN +} + +func (x *Schema_Attribute) GetDeprecated() bool { + if x != nil { + return x.Deprecated + } + return false +} + +type Schema_NestedBlock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + Block *Schema_Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Nesting Schema_NestedBlock_NestingMode `protobuf:"varint,3,opt,name=nesting,proto3,enum=tfplugin6.Schema_NestedBlock_NestingMode" json:"nesting,omitempty"` + MinItems int64 `protobuf:"varint,4,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + MaxItems int64 `protobuf:"varint,5,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` +} + +func (x *Schema_NestedBlock) Reset() { + *x = Schema_NestedBlock{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema_NestedBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema_NestedBlock) ProtoMessage() {} + +func (x *Schema_NestedBlock) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema_NestedBlock.ProtoReflect.Descriptor instead. +func (*Schema_NestedBlock) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{5, 2} +} + +func (x *Schema_NestedBlock) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *Schema_NestedBlock) GetBlock() *Schema_Block { + if x != nil { + return x.Block + } + return nil +} + +func (x *Schema_NestedBlock) GetNesting() Schema_NestedBlock_NestingMode { + if x != nil { + return x.Nesting + } + return Schema_NestedBlock_INVALID +} + +func (x *Schema_NestedBlock) GetMinItems() int64 { + if x != nil { + return x.MinItems + } + return 0 +} + +func (x *Schema_NestedBlock) GetMaxItems() int64 { + if x != nil { + return x.MaxItems + } + return 0 +} + +type Schema_Object struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attributes []*Schema_Attribute `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty"` + Nesting Schema_Object_NestingMode `protobuf:"varint,3,opt,name=nesting,proto3,enum=tfplugin6.Schema_Object_NestingMode" json:"nesting,omitempty"` + // MinItems and MaxItems were never used in the protocol, and have no + // effect on validation. + // + // Deprecated: Do not use. + MinItems int64 `protobuf:"varint,4,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` + // Deprecated: Do not use. + MaxItems int64 `protobuf:"varint,5,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` +} + +func (x *Schema_Object) Reset() { + *x = Schema_Object{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Schema_Object) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Schema_Object) ProtoMessage() {} + +func (x *Schema_Object) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Schema_Object.ProtoReflect.Descriptor instead. +func (*Schema_Object) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{5, 3} +} + +func (x *Schema_Object) GetAttributes() []*Schema_Attribute { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Schema_Object) GetNesting() Schema_Object_NestingMode { + if x != nil { + return x.Nesting + } + return Schema_Object_INVALID +} + +// Deprecated: Do not use. +func (x *Schema_Object) GetMinItems() int64 { + if x != nil { + return x.MinItems + } + return 0 +} + +// Deprecated: Do not use. +func (x *Schema_Object) GetMaxItems() int64 { + if x != nil { + return x.MaxItems + } + return 0 +} + +type GetProviderSchema_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetProviderSchema_Request) Reset() { + *x = GetProviderSchema_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProviderSchema_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProviderSchema_Request) ProtoMessage() {} + +func (x *GetProviderSchema_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProviderSchema_Request.ProtoReflect.Descriptor instead. +func (*GetProviderSchema_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{6, 0} +} + +type GetProviderSchema_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Provider *Schema `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + ResourceSchemas map[string]*Schema `protobuf:"bytes,2,rep,name=resource_schemas,json=resourceSchemas,proto3" json:"resource_schemas,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + DataSourceSchemas map[string]*Schema `protobuf:"bytes,3,rep,name=data_source_schemas,json=dataSourceSchemas,proto3" json:"data_source_schemas,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Diagnostics []*Diagnostic `protobuf:"bytes,4,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` + ProviderMeta *Schema `protobuf:"bytes,5,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` +} + +func (x *GetProviderSchema_Response) Reset() { + *x = GetProviderSchema_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetProviderSchema_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProviderSchema_Response) ProtoMessage() {} + +func (x *GetProviderSchema_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProviderSchema_Response.ProtoReflect.Descriptor instead. +func (*GetProviderSchema_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{6, 1} +} + +func (x *GetProviderSchema_Response) GetProvider() *Schema { + if x != nil { + return x.Provider + } + return nil +} + +func (x *GetProviderSchema_Response) GetResourceSchemas() map[string]*Schema { + if x != nil { + return x.ResourceSchemas + } + return nil +} + +func (x *GetProviderSchema_Response) GetDataSourceSchemas() map[string]*Schema { + if x != nil { + return x.DataSourceSchemas + } + return nil +} + +func (x *GetProviderSchema_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +func (x *GetProviderSchema_Response) GetProviderMeta() *Schema { + if x != nil { + return x.ProviderMeta + } + return nil +} + +type ValidateProviderConfig_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config *DynamicValue `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *ValidateProviderConfig_Request) Reset() { + *x = ValidateProviderConfig_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateProviderConfig_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateProviderConfig_Request) ProtoMessage() {} + +func (x *ValidateProviderConfig_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateProviderConfig_Request.ProtoReflect.Descriptor instead. +func (*ValidateProviderConfig_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *ValidateProviderConfig_Request) GetConfig() *DynamicValue { + if x != nil { + return x.Config + } + return nil +} + +type ValidateProviderConfig_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *ValidateProviderConfig_Response) Reset() { + *x = ValidateProviderConfig_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateProviderConfig_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateProviderConfig_Response) ProtoMessage() {} + +func (x *ValidateProviderConfig_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateProviderConfig_Response.ProtoReflect.Descriptor instead. +func (*ValidateProviderConfig_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{7, 1} +} + +func (x *ValidateProviderConfig_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +type UpgradeResourceState_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + // version is the schema_version number recorded in the state file + Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // raw_state is the raw states as stored for the resource. Core does + // not have access to the schema of prior_version, so it's the + // provider's responsibility to interpret this value using the + // appropriate older schema. The raw_state will be the json encoded + // state, or a legacy flat-mapped format. + RawState *RawState `protobuf:"bytes,3,opt,name=raw_state,json=rawState,proto3" json:"raw_state,omitempty"` +} + +func (x *UpgradeResourceState_Request) Reset() { + *x = UpgradeResourceState_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpgradeResourceState_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpgradeResourceState_Request) ProtoMessage() {} + +func (x *UpgradeResourceState_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpgradeResourceState_Request.ProtoReflect.Descriptor instead. +func (*UpgradeResourceState_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *UpgradeResourceState_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *UpgradeResourceState_Request) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *UpgradeResourceState_Request) GetRawState() *RawState { + if x != nil { + return x.RawState + } + return nil +} + +type UpgradeResourceState_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // new_state is a msgpack-encoded data structure that, when interpreted with + // the _current_ schema for this resource type, is functionally equivalent to + // that which was given in prior_state_raw. + UpgradedState *DynamicValue `protobuf:"bytes,1,opt,name=upgraded_state,json=upgradedState,proto3" json:"upgraded_state,omitempty"` + // diagnostics describes any errors encountered during migration that could not + // be safely resolved, and warnings about any possibly-risky assumptions made + // in the upgrade process. + Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *UpgradeResourceState_Response) Reset() { + *x = UpgradeResourceState_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpgradeResourceState_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpgradeResourceState_Response) ProtoMessage() {} + +func (x *UpgradeResourceState_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpgradeResourceState_Response.ProtoReflect.Descriptor instead. +func (*UpgradeResourceState_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{8, 1} +} + +func (x *UpgradeResourceState_Response) GetUpgradedState() *DynamicValue { + if x != nil { + return x.UpgradedState + } + return nil +} + +func (x *UpgradeResourceState_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +type ValidateResourceConfig_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *ValidateResourceConfig_Request) Reset() { + *x = ValidateResourceConfig_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateResourceConfig_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateResourceConfig_Request) ProtoMessage() {} + +func (x *ValidateResourceConfig_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateResourceConfig_Request.ProtoReflect.Descriptor instead. +func (*ValidateResourceConfig_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *ValidateResourceConfig_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *ValidateResourceConfig_Request) GetConfig() *DynamicValue { + if x != nil { + return x.Config + } + return nil +} + +type ValidateResourceConfig_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *ValidateResourceConfig_Response) Reset() { + *x = ValidateResourceConfig_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateResourceConfig_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateResourceConfig_Response) ProtoMessage() {} + +func (x *ValidateResourceConfig_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateResourceConfig_Response.ProtoReflect.Descriptor instead. +func (*ValidateResourceConfig_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{9, 1} +} + +func (x *ValidateResourceConfig_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +type ValidateDataResourceConfig_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *ValidateDataResourceConfig_Request) Reset() { + *x = ValidateDataResourceConfig_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateDataResourceConfig_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateDataResourceConfig_Request) ProtoMessage() {} + +func (x *ValidateDataResourceConfig_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateDataResourceConfig_Request.ProtoReflect.Descriptor instead. +func (*ValidateDataResourceConfig_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *ValidateDataResourceConfig_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *ValidateDataResourceConfig_Request) GetConfig() *DynamicValue { + if x != nil { + return x.Config + } + return nil +} + +type ValidateDataResourceConfig_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *ValidateDataResourceConfig_Response) Reset() { + *x = ValidateDataResourceConfig_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateDataResourceConfig_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateDataResourceConfig_Response) ProtoMessage() {} + +func (x *ValidateDataResourceConfig_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateDataResourceConfig_Response.ProtoReflect.Descriptor instead. +func (*ValidateDataResourceConfig_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{10, 1} +} + +func (x *ValidateDataResourceConfig_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +type ConfigureProvider_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TerraformVersion string `protobuf:"bytes,1,opt,name=terraform_version,json=terraformVersion,proto3" json:"terraform_version,omitempty"` + Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *ConfigureProvider_Request) Reset() { + *x = ConfigureProvider_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigureProvider_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigureProvider_Request) ProtoMessage() {} + +func (x *ConfigureProvider_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigureProvider_Request.ProtoReflect.Descriptor instead. +func (*ConfigureProvider_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *ConfigureProvider_Request) GetTerraformVersion() string { + if x != nil { + return x.TerraformVersion + } + return "" +} + +func (x *ConfigureProvider_Request) GetConfig() *DynamicValue { + if x != nil { + return x.Config + } + return nil +} + +type ConfigureProvider_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Diagnostics []*Diagnostic `protobuf:"bytes,1,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *ConfigureProvider_Response) Reset() { + *x = ConfigureProvider_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigureProvider_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigureProvider_Response) ProtoMessage() {} + +func (x *ConfigureProvider_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigureProvider_Response.ProtoReflect.Descriptor instead. +func (*ConfigureProvider_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{11, 1} +} + +func (x *ConfigureProvider_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +type ReadResource_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + CurrentState *DynamicValue `protobuf:"bytes,2,opt,name=current_state,json=currentState,proto3" json:"current_state,omitempty"` + Private []byte `protobuf:"bytes,3,opt,name=private,proto3" json:"private,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,4,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` +} + +func (x *ReadResource_Request) Reset() { + *x = ReadResource_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResource_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResource_Request) ProtoMessage() {} + +func (x *ReadResource_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadResource_Request.ProtoReflect.Descriptor instead. +func (*ReadResource_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *ReadResource_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *ReadResource_Request) GetCurrentState() *DynamicValue { + if x != nil { + return x.CurrentState + } + return nil +} + +func (x *ReadResource_Request) GetPrivate() []byte { + if x != nil { + return x.Private + } + return nil +} + +func (x *ReadResource_Request) GetProviderMeta() *DynamicValue { + if x != nil { + return x.ProviderMeta + } + return nil +} + +type ReadResource_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewState *DynamicValue `protobuf:"bytes,1,opt,name=new_state,json=newState,proto3" json:"new_state,omitempty"` + Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` + Private []byte `protobuf:"bytes,3,opt,name=private,proto3" json:"private,omitempty"` +} + +func (x *ReadResource_Response) Reset() { + *x = ReadResource_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResource_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResource_Response) ProtoMessage() {} + +func (x *ReadResource_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadResource_Response.ProtoReflect.Descriptor instead. +func (*ReadResource_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{12, 1} +} + +func (x *ReadResource_Response) GetNewState() *DynamicValue { + if x != nil { + return x.NewState + } + return nil +} + +func (x *ReadResource_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +func (x *ReadResource_Response) GetPrivate() []byte { + if x != nil { + return x.Private + } + return nil +} + +type PlanResourceChange_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + PriorState *DynamicValue `protobuf:"bytes,2,opt,name=prior_state,json=priorState,proto3" json:"prior_state,omitempty"` + ProposedNewState *DynamicValue `protobuf:"bytes,3,opt,name=proposed_new_state,json=proposedNewState,proto3" json:"proposed_new_state,omitempty"` + Config *DynamicValue `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` + PriorPrivate []byte `protobuf:"bytes,5,opt,name=prior_private,json=priorPrivate,proto3" json:"prior_private,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,6,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` +} + +func (x *PlanResourceChange_Request) Reset() { + *x = PlanResourceChange_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlanResourceChange_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlanResourceChange_Request) ProtoMessage() {} + +func (x *PlanResourceChange_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlanResourceChange_Request.ProtoReflect.Descriptor instead. +func (*PlanResourceChange_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{13, 0} +} + +func (x *PlanResourceChange_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *PlanResourceChange_Request) GetPriorState() *DynamicValue { + if x != nil { + return x.PriorState + } + return nil +} + +func (x *PlanResourceChange_Request) GetProposedNewState() *DynamicValue { + if x != nil { + return x.ProposedNewState + } + return nil +} + +func (x *PlanResourceChange_Request) GetConfig() *DynamicValue { + if x != nil { + return x.Config + } + return nil +} + +func (x *PlanResourceChange_Request) GetPriorPrivate() []byte { + if x != nil { + return x.PriorPrivate + } + return nil +} + +func (x *PlanResourceChange_Request) GetProviderMeta() *DynamicValue { + if x != nil { + return x.ProviderMeta + } + return nil +} + +type PlanResourceChange_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlannedState *DynamicValue `protobuf:"bytes,1,opt,name=planned_state,json=plannedState,proto3" json:"planned_state,omitempty"` + RequiresReplace []*AttributePath `protobuf:"bytes,2,rep,name=requires_replace,json=requiresReplace,proto3" json:"requires_replace,omitempty"` + PlannedPrivate []byte `protobuf:"bytes,3,opt,name=planned_private,json=plannedPrivate,proto3" json:"planned_private,omitempty"` + Diagnostics []*Diagnostic `protobuf:"bytes,4,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` + // This may be set only by the helper/schema "SDK" in the main Terraform + // repository, to request that Terraform Core >=0.12 permit additional + // inconsistencies that can result from the legacy SDK type system + // and its imprecise mapping to the >=0.12 type system. + // The change in behavior implied by this flag makes sense only for the + // specific details of the legacy SDK type system, and are not a general + // mechanism to avoid proper type handling in providers. + // + // ==== DO NOT USE THIS ==== + // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== + // ==== DO NOT USE THIS ==== + LegacyTypeSystem bool `protobuf:"varint,5,opt,name=legacy_type_system,json=legacyTypeSystem,proto3" json:"legacy_type_system,omitempty"` +} + +func (x *PlanResourceChange_Response) Reset() { + *x = PlanResourceChange_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlanResourceChange_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlanResourceChange_Response) ProtoMessage() {} + +func (x *PlanResourceChange_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlanResourceChange_Response.ProtoReflect.Descriptor instead. +func (*PlanResourceChange_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{13, 1} +} + +func (x *PlanResourceChange_Response) GetPlannedState() *DynamicValue { + if x != nil { + return x.PlannedState + } + return nil +} + +func (x *PlanResourceChange_Response) GetRequiresReplace() []*AttributePath { + if x != nil { + return x.RequiresReplace + } + return nil +} + +func (x *PlanResourceChange_Response) GetPlannedPrivate() []byte { + if x != nil { + return x.PlannedPrivate + } + return nil +} + +func (x *PlanResourceChange_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +func (x *PlanResourceChange_Response) GetLegacyTypeSystem() bool { + if x != nil { + return x.LegacyTypeSystem + } + return false +} + +type ApplyResourceChange_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + PriorState *DynamicValue `protobuf:"bytes,2,opt,name=prior_state,json=priorState,proto3" json:"prior_state,omitempty"` + PlannedState *DynamicValue `protobuf:"bytes,3,opt,name=planned_state,json=plannedState,proto3" json:"planned_state,omitempty"` + Config *DynamicValue `protobuf:"bytes,4,opt,name=config,proto3" json:"config,omitempty"` + PlannedPrivate []byte `protobuf:"bytes,5,opt,name=planned_private,json=plannedPrivate,proto3" json:"planned_private,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,6,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` +} + +func (x *ApplyResourceChange_Request) Reset() { + *x = ApplyResourceChange_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyResourceChange_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyResourceChange_Request) ProtoMessage() {} + +func (x *ApplyResourceChange_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyResourceChange_Request.ProtoReflect.Descriptor instead. +func (*ApplyResourceChange_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *ApplyResourceChange_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *ApplyResourceChange_Request) GetPriorState() *DynamicValue { + if x != nil { + return x.PriorState + } + return nil +} + +func (x *ApplyResourceChange_Request) GetPlannedState() *DynamicValue { + if x != nil { + return x.PlannedState + } + return nil +} + +func (x *ApplyResourceChange_Request) GetConfig() *DynamicValue { + if x != nil { + return x.Config + } + return nil +} + +func (x *ApplyResourceChange_Request) GetPlannedPrivate() []byte { + if x != nil { + return x.PlannedPrivate + } + return nil +} + +func (x *ApplyResourceChange_Request) GetProviderMeta() *DynamicValue { + if x != nil { + return x.ProviderMeta + } + return nil +} + +type ApplyResourceChange_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewState *DynamicValue `protobuf:"bytes,1,opt,name=new_state,json=newState,proto3" json:"new_state,omitempty"` + Private []byte `protobuf:"bytes,2,opt,name=private,proto3" json:"private,omitempty"` + Diagnostics []*Diagnostic `protobuf:"bytes,3,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` + // This may be set only by the helper/schema "SDK" in the main Terraform + // repository, to request that Terraform Core >=0.12 permit additional + // inconsistencies that can result from the legacy SDK type system + // and its imprecise mapping to the >=0.12 type system. + // The change in behavior implied by this flag makes sense only for the + // specific details of the legacy SDK type system, and are not a general + // mechanism to avoid proper type handling in providers. + // + // ==== DO NOT USE THIS ==== + // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== + // ==== DO NOT USE THIS ==== + LegacyTypeSystem bool `protobuf:"varint,4,opt,name=legacy_type_system,json=legacyTypeSystem,proto3" json:"legacy_type_system,omitempty"` +} + +func (x *ApplyResourceChange_Response) Reset() { + *x = ApplyResourceChange_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplyResourceChange_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplyResourceChange_Response) ProtoMessage() {} + +func (x *ApplyResourceChange_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplyResourceChange_Response.ProtoReflect.Descriptor instead. +func (*ApplyResourceChange_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{14, 1} +} + +func (x *ApplyResourceChange_Response) GetNewState() *DynamicValue { + if x != nil { + return x.NewState + } + return nil +} + +func (x *ApplyResourceChange_Response) GetPrivate() []byte { + if x != nil { + return x.Private + } + return nil +} + +func (x *ApplyResourceChange_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +func (x *ApplyResourceChange_Response) GetLegacyTypeSystem() bool { + if x != nil { + return x.LegacyTypeSystem + } + return false +} + +type ImportResourceState_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ImportResourceState_Request) Reset() { + *x = ImportResourceState_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportResourceState_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportResourceState_Request) ProtoMessage() {} + +func (x *ImportResourceState_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[45] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportResourceState_Request.ProtoReflect.Descriptor instead. +func (*ImportResourceState_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *ImportResourceState_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *ImportResourceState_Request) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ImportResourceState_ImportedResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + State *DynamicValue `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` + Private []byte `protobuf:"bytes,3,opt,name=private,proto3" json:"private,omitempty"` +} + +func (x *ImportResourceState_ImportedResource) Reset() { + *x = ImportResourceState_ImportedResource{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportResourceState_ImportedResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportResourceState_ImportedResource) ProtoMessage() {} + +func (x *ImportResourceState_ImportedResource) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[46] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportResourceState_ImportedResource.ProtoReflect.Descriptor instead. +func (*ImportResourceState_ImportedResource) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{15, 1} +} + +func (x *ImportResourceState_ImportedResource) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *ImportResourceState_ImportedResource) GetState() *DynamicValue { + if x != nil { + return x.State + } + return nil +} + +func (x *ImportResourceState_ImportedResource) GetPrivate() []byte { + if x != nil { + return x.Private + } + return nil +} + +type ImportResourceState_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImportedResources []*ImportResourceState_ImportedResource `protobuf:"bytes,1,rep,name=imported_resources,json=importedResources,proto3" json:"imported_resources,omitempty"` + Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *ImportResourceState_Response) Reset() { + *x = ImportResourceState_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportResourceState_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportResourceState_Response) ProtoMessage() {} + +func (x *ImportResourceState_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[47] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportResourceState_Response.ProtoReflect.Descriptor instead. +func (*ImportResourceState_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{15, 2} +} + +func (x *ImportResourceState_Response) GetImportedResources() []*ImportResourceState_ImportedResource { + if x != nil { + return x.ImportedResources + } + return nil +} + +func (x *ImportResourceState_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +type ReadDataSource_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` + Config *DynamicValue `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + ProviderMeta *DynamicValue `protobuf:"bytes,3,opt,name=provider_meta,json=providerMeta,proto3" json:"provider_meta,omitempty"` +} + +func (x *ReadDataSource_Request) Reset() { + *x = ReadDataSource_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadDataSource_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadDataSource_Request) ProtoMessage() {} + +func (x *ReadDataSource_Request) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[48] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadDataSource_Request.ProtoReflect.Descriptor instead. +func (*ReadDataSource_Request) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *ReadDataSource_Request) GetTypeName() string { + if x != nil { + return x.TypeName + } + return "" +} + +func (x *ReadDataSource_Request) GetConfig() *DynamicValue { + if x != nil { + return x.Config + } + return nil +} + +func (x *ReadDataSource_Request) GetProviderMeta() *DynamicValue { + if x != nil { + return x.ProviderMeta + } + return nil +} + +type ReadDataSource_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State *DynamicValue `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Diagnostics []*Diagnostic `protobuf:"bytes,2,rep,name=diagnostics,proto3" json:"diagnostics,omitempty"` +} + +func (x *ReadDataSource_Response) Reset() { + *x = ReadDataSource_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_tfplugin6_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadDataSource_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadDataSource_Response) ProtoMessage() {} + +func (x *ReadDataSource_Response) ProtoReflect() protoreflect.Message { + mi := &file_tfplugin6_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadDataSource_Response.ProtoReflect.Descriptor instead. +func (*ReadDataSource_Response) Descriptor() ([]byte, []int) { + return file_tfplugin6_proto_rawDescGZIP(), []int{16, 1} +} + +func (x *ReadDataSource_Response) GetState() *DynamicValue { + if x != nil { + return x.State + } + return nil +} + +func (x *ReadDataSource_Response) GetDiagnostics() []*Diagnostic { + if x != nil { + return x.Diagnostics + } + return nil +} + +var File_tfplugin6_proto protoreflect.FileDescriptor + +var file_tfplugin6_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x09, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x22, 0x3c, 0x0a, 0x0c, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x73, 0x67, 0x70, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, + 0x73, 0x67, 0x70, 0x61, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0xe3, 0x01, 0x0a, 0x0a, 0x44, + 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x12, 0x3a, 0x0a, 0x08, 0x73, 0x65, 0x76, + 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x74, 0x66, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, + 0x69, 0x63, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x73, 0x65, 0x76, + 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x66, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x50, 0x61, 0x74, 0x68, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, + 0x2f, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, + 0x22, 0xdc, 0x01, 0x0a, 0x0d, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x50, 0x61, + 0x74, 0x68, 0x12, 0x33, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x50, 0x61, 0x74, 0x68, 0x2e, 0x53, 0x74, 0x65, 0x70, + 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x1a, 0x95, 0x01, 0x0a, 0x04, 0x53, 0x74, 0x65, 0x70, + 0x12, 0x27, 0x0a, 0x0e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x10, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x4b, 0x65, 0x79, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x49, 0x6e, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, + 0x3b, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x1a, + 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x96, 0x01, 0x0a, + 0x08, 0x52, 0x61, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6a, 0x73, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, + 0x07, 0x66, 0x6c, 0x61, 0x74, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x52, 0x61, 0x77, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x07, 0x66, 0x6c, 0x61, 0x74, 0x6d, 0x61, 0x70, 0x1a, 0x3a, 0x0a, 0x0c, 0x46, 0x6c, 0x61, + 0x74, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x95, 0x0a, 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x05, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0xa2, 0x02, 0x0a, 0x05, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0b, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x10, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x69, 0x6e, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x36, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0f, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x1a, 0xe4, + 0x02, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, + 0x70, 0x75, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, + 0x70, 0x75, 0x74, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, + 0x76, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x12, 0x40, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, + 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, + 0x63, 0x61, 0x74, 0x65, 0x64, 0x1a, 0xa7, 0x02, 0x0a, 0x0b, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x43, 0x0a, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x6e, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, + 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, + 0x22, 0x4d, 0x0a, 0x0b, 0x4e, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, + 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x53, 0x54, + 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x4d, + 0x41, 0x50, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x05, 0x1a, + 0x8b, 0x02, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x3b, 0x0a, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x07, + 0x6e, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x18, 0x01, 0x52, 0x08, + 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1f, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x02, 0x18, 0x01, 0x52, + 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x42, 0x0a, 0x0b, 0x4e, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x10, + 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, + 0x45, 0x54, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x41, 0x50, 0x10, 0x04, 0x22, 0xd0, 0x04, + 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0xaf, + 0x04, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x10, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x73, 0x12, 0x6c, 0x0a, 0x13, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, + 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x64, 0x61, + 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x12, + 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, + 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, + 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x36, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, + 0x1a, 0x55, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x57, 0x0a, 0x16, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x99, 0x01, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x3a, 0x0a, 0x07, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x43, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, + 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x90, 0x02, 0x0a, + 0x14, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x72, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, 0x66, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x52, 0x61, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x08, 0x72, 0x61, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x83, 0x01, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, + 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, + 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, + 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, + 0xb6, 0x01, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x57, 0x0a, 0x07, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x1a, 0x43, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, + 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, + 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x1a, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x57, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x1a, 0x43, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0b, + 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x1a, 0x67, 0x0a, 0x07, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x65, 0x72, 0x72, 0x61, 0x66, + 0x6f, 0x72, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x74, 0x65, 0x72, 0x72, 0x61, 0x66, 0x6f, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x43, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x36, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x0c, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0xbc, 0x01, 0x0a, 0x07, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x1a, 0x93, 0x01, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x0b, + 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x22, + 0xf2, 0x04, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x1a, 0xbb, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x38, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, + 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x70, + 0x72, 0x69, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x12, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x64, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x4e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, + 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x4d, 0x65, 0x74, 0x61, 0x1a, 0x9d, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x0c, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x43, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x50, + 0x61, 0x74, 0x68, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, + 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, + 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, + 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, + 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x10, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x22, 0x92, 0x04, 0x0a, 0x13, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x1a, 0xb6, 0x02, 0x0a, + 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x3c, 0x0a, 0x0d, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0c, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, + 0x0a, 0x0f, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, + 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x1a, 0xc1, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, + 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, + 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x54, + 0x79, 0x70, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0xed, 0x02, 0x0a, 0x13, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x1a, 0x36, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, + 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x78, 0x0a, 0x10, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x1a, 0xa3, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x5e, 0x0a, 0x12, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, + 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x11, 0x69, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x12, 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x36, 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x9c, 0x02, 0x0a, 0x0e, 0x52, 0x65, + 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x95, 0x01, 0x0a, + 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x4d, 0x65, 0x74, 0x61, 0x1a, 0x72, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x44, 0x79, 0x6e, 0x61, + 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x37, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, + 0x2e, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x52, 0x0b, 0x64, 0x69, 0x61, + 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2a, 0x25, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, + 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, 0x52, 0x4b, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x32, + 0xcc, 0x09, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x60, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x12, 0x24, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x47, 0x65, + 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x36, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, + 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6f, 0x0a, 0x16, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x7b, 0x0a, 0x1a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2d, + 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, + 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, + 0x14, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x27, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x36, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, + 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, + 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x74, 0x66, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x74, 0x66, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, + 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, + 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x74, 0x66, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x66, 0x0a, 0x13, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x13, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x26, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x74, 0x66, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0e, 0x52, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, + 0x2e, 0x52, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x36, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x53, + 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x74, 0x66, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x74, + 0x66, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x36, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, + 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, + 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x74, 0x65, 0x72, 0x72, 0x61, 0x66, 0x6f, 0x72, 0x6d, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x66, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x36, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_tfplugin6_proto_rawDescOnce sync.Once + file_tfplugin6_proto_rawDescData = file_tfplugin6_proto_rawDesc +) + +func file_tfplugin6_proto_rawDescGZIP() []byte { + file_tfplugin6_proto_rawDescOnce.Do(func() { + file_tfplugin6_proto_rawDescData = protoimpl.X.CompressGZIP(file_tfplugin6_proto_rawDescData) + }) + return file_tfplugin6_proto_rawDescData +} + +var file_tfplugin6_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_tfplugin6_proto_msgTypes = make([]protoimpl.MessageInfo, 50) +var file_tfplugin6_proto_goTypes = []interface{}{ + (StringKind)(0), // 0: tfplugin6.StringKind + (Diagnostic_Severity)(0), // 1: tfplugin6.Diagnostic.Severity + (Schema_NestedBlock_NestingMode)(0), // 2: tfplugin6.Schema.NestedBlock.NestingMode + (Schema_Object_NestingMode)(0), // 3: tfplugin6.Schema.Object.NestingMode + (*DynamicValue)(nil), // 4: tfplugin6.DynamicValue + (*Diagnostic)(nil), // 5: tfplugin6.Diagnostic + (*AttributePath)(nil), // 6: tfplugin6.AttributePath + (*StopProvider)(nil), // 7: tfplugin6.StopProvider + (*RawState)(nil), // 8: tfplugin6.RawState + (*Schema)(nil), // 9: tfplugin6.Schema + (*GetProviderSchema)(nil), // 10: tfplugin6.GetProviderSchema + (*ValidateProviderConfig)(nil), // 11: tfplugin6.ValidateProviderConfig + (*UpgradeResourceState)(nil), // 12: tfplugin6.UpgradeResourceState + (*ValidateResourceConfig)(nil), // 13: tfplugin6.ValidateResourceConfig + (*ValidateDataResourceConfig)(nil), // 14: tfplugin6.ValidateDataResourceConfig + (*ConfigureProvider)(nil), // 15: tfplugin6.ConfigureProvider + (*ReadResource)(nil), // 16: tfplugin6.ReadResource + (*PlanResourceChange)(nil), // 17: tfplugin6.PlanResourceChange + (*ApplyResourceChange)(nil), // 18: tfplugin6.ApplyResourceChange + (*ImportResourceState)(nil), // 19: tfplugin6.ImportResourceState + (*ReadDataSource)(nil), // 20: tfplugin6.ReadDataSource + (*AttributePath_Step)(nil), // 21: tfplugin6.AttributePath.Step + (*StopProvider_Request)(nil), // 22: tfplugin6.StopProvider.Request + (*StopProvider_Response)(nil), // 23: tfplugin6.StopProvider.Response + nil, // 24: tfplugin6.RawState.FlatmapEntry + (*Schema_Block)(nil), // 25: tfplugin6.Schema.Block + (*Schema_Attribute)(nil), // 26: tfplugin6.Schema.Attribute + (*Schema_NestedBlock)(nil), // 27: tfplugin6.Schema.NestedBlock + (*Schema_Object)(nil), // 28: tfplugin6.Schema.Object + (*GetProviderSchema_Request)(nil), // 29: tfplugin6.GetProviderSchema.Request + (*GetProviderSchema_Response)(nil), // 30: tfplugin6.GetProviderSchema.Response + nil, // 31: tfplugin6.GetProviderSchema.Response.ResourceSchemasEntry + nil, // 32: tfplugin6.GetProviderSchema.Response.DataSourceSchemasEntry + (*ValidateProviderConfig_Request)(nil), // 33: tfplugin6.ValidateProviderConfig.Request + (*ValidateProviderConfig_Response)(nil), // 34: tfplugin6.ValidateProviderConfig.Response + (*UpgradeResourceState_Request)(nil), // 35: tfplugin6.UpgradeResourceState.Request + (*UpgradeResourceState_Response)(nil), // 36: tfplugin6.UpgradeResourceState.Response + (*ValidateResourceConfig_Request)(nil), // 37: tfplugin6.ValidateResourceConfig.Request + (*ValidateResourceConfig_Response)(nil), // 38: tfplugin6.ValidateResourceConfig.Response + (*ValidateDataResourceConfig_Request)(nil), // 39: tfplugin6.ValidateDataResourceConfig.Request + (*ValidateDataResourceConfig_Response)(nil), // 40: tfplugin6.ValidateDataResourceConfig.Response + (*ConfigureProvider_Request)(nil), // 41: tfplugin6.ConfigureProvider.Request + (*ConfigureProvider_Response)(nil), // 42: tfplugin6.ConfigureProvider.Response + (*ReadResource_Request)(nil), // 43: tfplugin6.ReadResource.Request + (*ReadResource_Response)(nil), // 44: tfplugin6.ReadResource.Response + (*PlanResourceChange_Request)(nil), // 45: tfplugin6.PlanResourceChange.Request + (*PlanResourceChange_Response)(nil), // 46: tfplugin6.PlanResourceChange.Response + (*ApplyResourceChange_Request)(nil), // 47: tfplugin6.ApplyResourceChange.Request + (*ApplyResourceChange_Response)(nil), // 48: tfplugin6.ApplyResourceChange.Response + (*ImportResourceState_Request)(nil), // 49: tfplugin6.ImportResourceState.Request + (*ImportResourceState_ImportedResource)(nil), // 50: tfplugin6.ImportResourceState.ImportedResource + (*ImportResourceState_Response)(nil), // 51: tfplugin6.ImportResourceState.Response + (*ReadDataSource_Request)(nil), // 52: tfplugin6.ReadDataSource.Request + (*ReadDataSource_Response)(nil), // 53: tfplugin6.ReadDataSource.Response +} +var file_tfplugin6_proto_depIdxs = []int32{ + 1, // 0: tfplugin6.Diagnostic.severity:type_name -> tfplugin6.Diagnostic.Severity + 6, // 1: tfplugin6.Diagnostic.attribute:type_name -> tfplugin6.AttributePath + 21, // 2: tfplugin6.AttributePath.steps:type_name -> tfplugin6.AttributePath.Step + 24, // 3: tfplugin6.RawState.flatmap:type_name -> tfplugin6.RawState.FlatmapEntry + 25, // 4: tfplugin6.Schema.block:type_name -> tfplugin6.Schema.Block + 26, // 5: tfplugin6.Schema.Block.attributes:type_name -> tfplugin6.Schema.Attribute + 27, // 6: tfplugin6.Schema.Block.block_types:type_name -> tfplugin6.Schema.NestedBlock + 0, // 7: tfplugin6.Schema.Block.description_kind:type_name -> tfplugin6.StringKind + 28, // 8: tfplugin6.Schema.Attribute.nested_type:type_name -> tfplugin6.Schema.Object + 0, // 9: tfplugin6.Schema.Attribute.description_kind:type_name -> tfplugin6.StringKind + 25, // 10: tfplugin6.Schema.NestedBlock.block:type_name -> tfplugin6.Schema.Block + 2, // 11: tfplugin6.Schema.NestedBlock.nesting:type_name -> tfplugin6.Schema.NestedBlock.NestingMode + 26, // 12: tfplugin6.Schema.Object.attributes:type_name -> tfplugin6.Schema.Attribute + 3, // 13: tfplugin6.Schema.Object.nesting:type_name -> tfplugin6.Schema.Object.NestingMode + 9, // 14: tfplugin6.GetProviderSchema.Response.provider:type_name -> tfplugin6.Schema + 31, // 15: tfplugin6.GetProviderSchema.Response.resource_schemas:type_name -> tfplugin6.GetProviderSchema.Response.ResourceSchemasEntry + 32, // 16: tfplugin6.GetProviderSchema.Response.data_source_schemas:type_name -> tfplugin6.GetProviderSchema.Response.DataSourceSchemasEntry + 5, // 17: tfplugin6.GetProviderSchema.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 9, // 18: tfplugin6.GetProviderSchema.Response.provider_meta:type_name -> tfplugin6.Schema + 9, // 19: tfplugin6.GetProviderSchema.Response.ResourceSchemasEntry.value:type_name -> tfplugin6.Schema + 9, // 20: tfplugin6.GetProviderSchema.Response.DataSourceSchemasEntry.value:type_name -> tfplugin6.Schema + 4, // 21: tfplugin6.ValidateProviderConfig.Request.config:type_name -> tfplugin6.DynamicValue + 5, // 22: tfplugin6.ValidateProviderConfig.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 8, // 23: tfplugin6.UpgradeResourceState.Request.raw_state:type_name -> tfplugin6.RawState + 4, // 24: tfplugin6.UpgradeResourceState.Response.upgraded_state:type_name -> tfplugin6.DynamicValue + 5, // 25: tfplugin6.UpgradeResourceState.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 26: tfplugin6.ValidateResourceConfig.Request.config:type_name -> tfplugin6.DynamicValue + 5, // 27: tfplugin6.ValidateResourceConfig.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 28: tfplugin6.ValidateDataResourceConfig.Request.config:type_name -> tfplugin6.DynamicValue + 5, // 29: tfplugin6.ValidateDataResourceConfig.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 30: tfplugin6.ConfigureProvider.Request.config:type_name -> tfplugin6.DynamicValue + 5, // 31: tfplugin6.ConfigureProvider.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 32: tfplugin6.ReadResource.Request.current_state:type_name -> tfplugin6.DynamicValue + 4, // 33: tfplugin6.ReadResource.Request.provider_meta:type_name -> tfplugin6.DynamicValue + 4, // 34: tfplugin6.ReadResource.Response.new_state:type_name -> tfplugin6.DynamicValue + 5, // 35: tfplugin6.ReadResource.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 36: tfplugin6.PlanResourceChange.Request.prior_state:type_name -> tfplugin6.DynamicValue + 4, // 37: tfplugin6.PlanResourceChange.Request.proposed_new_state:type_name -> tfplugin6.DynamicValue + 4, // 38: tfplugin6.PlanResourceChange.Request.config:type_name -> tfplugin6.DynamicValue + 4, // 39: tfplugin6.PlanResourceChange.Request.provider_meta:type_name -> tfplugin6.DynamicValue + 4, // 40: tfplugin6.PlanResourceChange.Response.planned_state:type_name -> tfplugin6.DynamicValue + 6, // 41: tfplugin6.PlanResourceChange.Response.requires_replace:type_name -> tfplugin6.AttributePath + 5, // 42: tfplugin6.PlanResourceChange.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 43: tfplugin6.ApplyResourceChange.Request.prior_state:type_name -> tfplugin6.DynamicValue + 4, // 44: tfplugin6.ApplyResourceChange.Request.planned_state:type_name -> tfplugin6.DynamicValue + 4, // 45: tfplugin6.ApplyResourceChange.Request.config:type_name -> tfplugin6.DynamicValue + 4, // 46: tfplugin6.ApplyResourceChange.Request.provider_meta:type_name -> tfplugin6.DynamicValue + 4, // 47: tfplugin6.ApplyResourceChange.Response.new_state:type_name -> tfplugin6.DynamicValue + 5, // 48: tfplugin6.ApplyResourceChange.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 49: tfplugin6.ImportResourceState.ImportedResource.state:type_name -> tfplugin6.DynamicValue + 50, // 50: tfplugin6.ImportResourceState.Response.imported_resources:type_name -> tfplugin6.ImportResourceState.ImportedResource + 5, // 51: tfplugin6.ImportResourceState.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 4, // 52: tfplugin6.ReadDataSource.Request.config:type_name -> tfplugin6.DynamicValue + 4, // 53: tfplugin6.ReadDataSource.Request.provider_meta:type_name -> tfplugin6.DynamicValue + 4, // 54: tfplugin6.ReadDataSource.Response.state:type_name -> tfplugin6.DynamicValue + 5, // 55: tfplugin6.ReadDataSource.Response.diagnostics:type_name -> tfplugin6.Diagnostic + 29, // 56: tfplugin6.Provider.GetProviderSchema:input_type -> tfplugin6.GetProviderSchema.Request + 33, // 57: tfplugin6.Provider.ValidateProviderConfig:input_type -> tfplugin6.ValidateProviderConfig.Request + 37, // 58: tfplugin6.Provider.ValidateResourceConfig:input_type -> tfplugin6.ValidateResourceConfig.Request + 39, // 59: tfplugin6.Provider.ValidateDataResourceConfig:input_type -> tfplugin6.ValidateDataResourceConfig.Request + 35, // 60: tfplugin6.Provider.UpgradeResourceState:input_type -> tfplugin6.UpgradeResourceState.Request + 41, // 61: tfplugin6.Provider.ConfigureProvider:input_type -> tfplugin6.ConfigureProvider.Request + 43, // 62: tfplugin6.Provider.ReadResource:input_type -> tfplugin6.ReadResource.Request + 45, // 63: tfplugin6.Provider.PlanResourceChange:input_type -> tfplugin6.PlanResourceChange.Request + 47, // 64: tfplugin6.Provider.ApplyResourceChange:input_type -> tfplugin6.ApplyResourceChange.Request + 49, // 65: tfplugin6.Provider.ImportResourceState:input_type -> tfplugin6.ImportResourceState.Request + 52, // 66: tfplugin6.Provider.ReadDataSource:input_type -> tfplugin6.ReadDataSource.Request + 22, // 67: tfplugin6.Provider.StopProvider:input_type -> tfplugin6.StopProvider.Request + 30, // 68: tfplugin6.Provider.GetProviderSchema:output_type -> tfplugin6.GetProviderSchema.Response + 34, // 69: tfplugin6.Provider.ValidateProviderConfig:output_type -> tfplugin6.ValidateProviderConfig.Response + 38, // 70: tfplugin6.Provider.ValidateResourceConfig:output_type -> tfplugin6.ValidateResourceConfig.Response + 40, // 71: tfplugin6.Provider.ValidateDataResourceConfig:output_type -> tfplugin6.ValidateDataResourceConfig.Response + 36, // 72: tfplugin6.Provider.UpgradeResourceState:output_type -> tfplugin6.UpgradeResourceState.Response + 42, // 73: tfplugin6.Provider.ConfigureProvider:output_type -> tfplugin6.ConfigureProvider.Response + 44, // 74: tfplugin6.Provider.ReadResource:output_type -> tfplugin6.ReadResource.Response + 46, // 75: tfplugin6.Provider.PlanResourceChange:output_type -> tfplugin6.PlanResourceChange.Response + 48, // 76: tfplugin6.Provider.ApplyResourceChange:output_type -> tfplugin6.ApplyResourceChange.Response + 51, // 77: tfplugin6.Provider.ImportResourceState:output_type -> tfplugin6.ImportResourceState.Response + 53, // 78: tfplugin6.Provider.ReadDataSource:output_type -> tfplugin6.ReadDataSource.Response + 23, // 79: tfplugin6.Provider.StopProvider:output_type -> tfplugin6.StopProvider.Response + 68, // [68:80] is the sub-list for method output_type + 56, // [56:68] is the sub-list for method input_type + 56, // [56:56] is the sub-list for extension type_name + 56, // [56:56] is the sub-list for extension extendee + 0, // [0:56] is the sub-list for field type_name +} + +func init() { file_tfplugin6_proto_init() } +func file_tfplugin6_proto_init() { + if File_tfplugin6_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_tfplugin6_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DynamicValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Diagnostic); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttributePath); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopProvider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RawState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProviderSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateProviderConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpgradeResourceState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateResourceConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateDataResourceConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigureProvider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlanResourceChange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyResourceChange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportResourceState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadDataSource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttributePath_Step); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopProvider_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopProvider_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema_Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema_Attribute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema_NestedBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Schema_Object); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProviderSchema_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetProviderSchema_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateProviderConfig_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateProviderConfig_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpgradeResourceState_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpgradeResourceState_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateResourceConfig_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateResourceConfig_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateDataResourceConfig_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateDataResourceConfig_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigureProvider_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigureProvider_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResource_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResource_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlanResourceChange_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlanResourceChange_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyResourceChange_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyResourceChange_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportResourceState_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportResourceState_ImportedResource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportResourceState_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadDataSource_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfplugin6_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadDataSource_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_tfplugin6_proto_msgTypes[17].OneofWrappers = []interface{}{ + (*AttributePath_Step_AttributeName)(nil), + (*AttributePath_Step_ElementKeyString)(nil), + (*AttributePath_Step_ElementKeyInt)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_tfplugin6_proto_rawDesc, + NumEnums: 4, + NumMessages: 50, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_tfplugin6_proto_goTypes, + DependencyIndexes: file_tfplugin6_proto_depIdxs, + EnumInfos: file_tfplugin6_proto_enumTypes, + MessageInfos: file_tfplugin6_proto_msgTypes, + }.Build() + File_tfplugin6_proto = out.File + file_tfplugin6_proto_rawDesc = nil + file_tfplugin6_proto_goTypes = nil + file_tfplugin6_proto_depIdxs = nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.proto b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.proto new file mode 100644 index 000000000..da5e58eaf --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6.proto @@ -0,0 +1,350 @@ +// Terraform Plugin RPC protocol version 6.2 +// +// This file defines version 6.2 of the RPC protocol. To implement a plugin +// against this protocol, copy this definition into your own codebase and +// use protoc to generate stubs for your target language. +// +// This file will not be updated. Any minor versions of protocol 6 to follow +// should copy this file and modify the copy while maintaing backwards +// compatibility. Breaking changes, if any are required, will come +// in a subsequent major version with its own separate proto definition. +// +// Note that only the proto files included in a release tag of Terraform are +// official protocol releases. Proto files taken from other commits may include +// incomplete changes or features that did not make it into a final release. +// In all reasonable cases, plugin developers should take the proto file from +// the tag of the most recent release of Terraform, and not from the main +// branch or any other development branch. +// +syntax = "proto3"; +option go_package = "github.com/hashicorp/terraform/internal/tfplugin6"; + +package tfplugin6; + +// DynamicValue is an opaque encoding of terraform data, with the field name +// indicating the encoding scheme used. +message DynamicValue { + bytes msgpack = 1; + bytes json = 2; +} + +message Diagnostic { + enum Severity { + INVALID = 0; + ERROR = 1; + WARNING = 2; + } + Severity severity = 1; + string summary = 2; + string detail = 3; + AttributePath attribute = 4; +} + +message AttributePath { + message Step { + oneof selector { + // Set "attribute_name" to represent looking up an attribute + // in the current object value. + string attribute_name = 1; + // Set "element_key_*" to represent looking up an element in + // an indexable collection type. + string element_key_string = 2; + int64 element_key_int = 3; + } + } + repeated Step steps = 1; +} + +message StopProvider { + message Request { + } + message Response { + string Error = 1; + } +} + +// RawState holds the stored state for a resource to be upgraded by the +// provider. It can be in one of two formats, the current json encoded format +// in bytes, or the legacy flatmap format as a map of strings. +message RawState { + bytes json = 1; + map flatmap = 2; +} + +enum StringKind { + PLAIN = 0; + MARKDOWN = 1; +} + +// Schema is the configuration schema for a Resource or Provider. +message Schema { + message Block { + int64 version = 1; + repeated Attribute attributes = 2; + repeated NestedBlock block_types = 3; + string description = 4; + StringKind description_kind = 5; + bool deprecated = 6; + } + + message Attribute { + string name = 1; + bytes type = 2; + Object nested_type = 10; + string description = 3; + bool required = 4; + bool optional = 5; + bool computed = 6; + bool sensitive = 7; + StringKind description_kind = 8; + bool deprecated = 9; + } + + message NestedBlock { + enum NestingMode { + INVALID = 0; + SINGLE = 1; + LIST = 2; + SET = 3; + MAP = 4; + GROUP = 5; + } + + string type_name = 1; + Block block = 2; + NestingMode nesting = 3; + int64 min_items = 4; + int64 max_items = 5; + } + + message Object { + enum NestingMode { + INVALID = 0; + SINGLE = 1; + LIST = 2; + SET = 3; + MAP = 4; + } + + repeated Attribute attributes = 1; + NestingMode nesting = 3; + + // MinItems and MaxItems were never used in the protocol, and have no + // effect on validation. + int64 min_items = 4 [deprecated = true]; + int64 max_items = 5 [deprecated = true]; + } + + // The version of the schema. + // Schemas are versioned, so that providers can upgrade a saved resource + // state when the schema is changed. + int64 version = 1; + + // Block is the top level configuration block for this schema. + Block block = 2; +} + +service Provider { + //////// Information about what a provider supports/expects + rpc GetProviderSchema(GetProviderSchema.Request) returns (GetProviderSchema.Response); + rpc ValidateProviderConfig(ValidateProviderConfig.Request) returns (ValidateProviderConfig.Response); + rpc ValidateResourceConfig(ValidateResourceConfig.Request) returns (ValidateResourceConfig.Response); + rpc ValidateDataResourceConfig(ValidateDataResourceConfig.Request) returns (ValidateDataResourceConfig.Response); + rpc UpgradeResourceState(UpgradeResourceState.Request) returns (UpgradeResourceState.Response); + + //////// One-time initialization, called before other functions below + rpc ConfigureProvider(ConfigureProvider.Request) returns (ConfigureProvider.Response); + + //////// Managed Resource Lifecycle + rpc ReadResource(ReadResource.Request) returns (ReadResource.Response); + rpc PlanResourceChange(PlanResourceChange.Request) returns (PlanResourceChange.Response); + rpc ApplyResourceChange(ApplyResourceChange.Request) returns (ApplyResourceChange.Response); + rpc ImportResourceState(ImportResourceState.Request) returns (ImportResourceState.Response); + + rpc ReadDataSource(ReadDataSource.Request) returns (ReadDataSource.Response); + + //////// Graceful Shutdown + rpc StopProvider(StopProvider.Request) returns (StopProvider.Response); +} + +message GetProviderSchema { + message Request { + } + message Response { + Schema provider = 1; + map resource_schemas = 2; + map data_source_schemas = 3; + repeated Diagnostic diagnostics = 4; + Schema provider_meta = 5; + } +} + +message ValidateProviderConfig { + message Request { + DynamicValue config = 1; + } + message Response { + repeated Diagnostic diagnostics = 2; + } +} + +message UpgradeResourceState { + message Request { + string type_name = 1; + + // version is the schema_version number recorded in the state file + int64 version = 2; + + // raw_state is the raw states as stored for the resource. Core does + // not have access to the schema of prior_version, so it's the + // provider's responsibility to interpret this value using the + // appropriate older schema. The raw_state will be the json encoded + // state, or a legacy flat-mapped format. + RawState raw_state = 3; + } + message Response { + // new_state is a msgpack-encoded data structure that, when interpreted with + // the _current_ schema for this resource type, is functionally equivalent to + // that which was given in prior_state_raw. + DynamicValue upgraded_state = 1; + + // diagnostics describes any errors encountered during migration that could not + // be safely resolved, and warnings about any possibly-risky assumptions made + // in the upgrade process. + repeated Diagnostic diagnostics = 2; + } +} + +message ValidateResourceConfig { + message Request { + string type_name = 1; + DynamicValue config = 2; + } + message Response { + repeated Diagnostic diagnostics = 1; + } +} + +message ValidateDataResourceConfig { + message Request { + string type_name = 1; + DynamicValue config = 2; + } + message Response { + repeated Diagnostic diagnostics = 1; + } +} + +message ConfigureProvider { + message Request { + string terraform_version = 1; + DynamicValue config = 2; + } + message Response { + repeated Diagnostic diagnostics = 1; + } +} + +message ReadResource { + message Request { + string type_name = 1; + DynamicValue current_state = 2; + bytes private = 3; + DynamicValue provider_meta = 4; + } + message Response { + DynamicValue new_state = 1; + repeated Diagnostic diagnostics = 2; + bytes private = 3; + } +} + +message PlanResourceChange { + message Request { + string type_name = 1; + DynamicValue prior_state = 2; + DynamicValue proposed_new_state = 3; + DynamicValue config = 4; + bytes prior_private = 5; + DynamicValue provider_meta = 6; + } + + message Response { + DynamicValue planned_state = 1; + repeated AttributePath requires_replace = 2; + bytes planned_private = 3; + repeated Diagnostic diagnostics = 4; + + // This may be set only by the helper/schema "SDK" in the main Terraform + // repository, to request that Terraform Core >=0.12 permit additional + // inconsistencies that can result from the legacy SDK type system + // and its imprecise mapping to the >=0.12 type system. + // The change in behavior implied by this flag makes sense only for the + // specific details of the legacy SDK type system, and are not a general + // mechanism to avoid proper type handling in providers. + // + // ==== DO NOT USE THIS ==== + // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== + // ==== DO NOT USE THIS ==== + bool legacy_type_system = 5; + } +} + +message ApplyResourceChange { + message Request { + string type_name = 1; + DynamicValue prior_state = 2; + DynamicValue planned_state = 3; + DynamicValue config = 4; + bytes planned_private = 5; + DynamicValue provider_meta = 6; + } + message Response { + DynamicValue new_state = 1; + bytes private = 2; + repeated Diagnostic diagnostics = 3; + + // This may be set only by the helper/schema "SDK" in the main Terraform + // repository, to request that Terraform Core >=0.12 permit additional + // inconsistencies that can result from the legacy SDK type system + // and its imprecise mapping to the >=0.12 type system. + // The change in behavior implied by this flag makes sense only for the + // specific details of the legacy SDK type system, and are not a general + // mechanism to avoid proper type handling in providers. + // + // ==== DO NOT USE THIS ==== + // ==== THIS MUST BE LEFT UNSET IN ALL OTHER SDKS ==== + // ==== DO NOT USE THIS ==== + bool legacy_type_system = 4; + } +} + +message ImportResourceState { + message Request { + string type_name = 1; + string id = 2; + } + + message ImportedResource { + string type_name = 1; + DynamicValue state = 2; + bytes private = 3; + } + + message Response { + repeated ImportedResource imported_resources = 1; + repeated Diagnostic diagnostics = 2; + } +} + +message ReadDataSource { + message Request { + string type_name = 1; + DynamicValue config = 2; + DynamicValue provider_meta = 3; + } + message Response { + DynamicValue state = 1; + repeated Diagnostic diagnostics = 2; + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go new file mode 100644 index 000000000..a22d32dc9 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go @@ -0,0 +1,509 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.4 +// source: tfplugin6.proto + +package tfplugin6 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ProviderClient is the client API for Provider service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ProviderClient interface { + //////// Information about what a provider supports/expects + GetProviderSchema(ctx context.Context, in *GetProviderSchema_Request, opts ...grpc.CallOption) (*GetProviderSchema_Response, error) + ValidateProviderConfig(ctx context.Context, in *ValidateProviderConfig_Request, opts ...grpc.CallOption) (*ValidateProviderConfig_Response, error) + ValidateResourceConfig(ctx context.Context, in *ValidateResourceConfig_Request, opts ...grpc.CallOption) (*ValidateResourceConfig_Response, error) + ValidateDataResourceConfig(ctx context.Context, in *ValidateDataResourceConfig_Request, opts ...grpc.CallOption) (*ValidateDataResourceConfig_Response, error) + UpgradeResourceState(ctx context.Context, in *UpgradeResourceState_Request, opts ...grpc.CallOption) (*UpgradeResourceState_Response, error) + //////// One-time initialization, called before other functions below + ConfigureProvider(ctx context.Context, in *ConfigureProvider_Request, opts ...grpc.CallOption) (*ConfigureProvider_Response, error) + //////// Managed Resource Lifecycle + ReadResource(ctx context.Context, in *ReadResource_Request, opts ...grpc.CallOption) (*ReadResource_Response, error) + PlanResourceChange(ctx context.Context, in *PlanResourceChange_Request, opts ...grpc.CallOption) (*PlanResourceChange_Response, error) + ApplyResourceChange(ctx context.Context, in *ApplyResourceChange_Request, opts ...grpc.CallOption) (*ApplyResourceChange_Response, error) + ImportResourceState(ctx context.Context, in *ImportResourceState_Request, opts ...grpc.CallOption) (*ImportResourceState_Response, error) + ReadDataSource(ctx context.Context, in *ReadDataSource_Request, opts ...grpc.CallOption) (*ReadDataSource_Response, error) + //////// Graceful Shutdown + StopProvider(ctx context.Context, in *StopProvider_Request, opts ...grpc.CallOption) (*StopProvider_Response, error) +} + +type providerClient struct { + cc grpc.ClientConnInterface +} + +func NewProviderClient(cc grpc.ClientConnInterface) ProviderClient { + return &providerClient{cc} +} + +func (c *providerClient) GetProviderSchema(ctx context.Context, in *GetProviderSchema_Request, opts ...grpc.CallOption) (*GetProviderSchema_Response, error) { + out := new(GetProviderSchema_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/GetProviderSchema", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ValidateProviderConfig(ctx context.Context, in *ValidateProviderConfig_Request, opts ...grpc.CallOption) (*ValidateProviderConfig_Response, error) { + out := new(ValidateProviderConfig_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ValidateProviderConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ValidateResourceConfig(ctx context.Context, in *ValidateResourceConfig_Request, opts ...grpc.CallOption) (*ValidateResourceConfig_Response, error) { + out := new(ValidateResourceConfig_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ValidateResourceConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ValidateDataResourceConfig(ctx context.Context, in *ValidateDataResourceConfig_Request, opts ...grpc.CallOption) (*ValidateDataResourceConfig_Response, error) { + out := new(ValidateDataResourceConfig_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ValidateDataResourceConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) UpgradeResourceState(ctx context.Context, in *UpgradeResourceState_Request, opts ...grpc.CallOption) (*UpgradeResourceState_Response, error) { + out := new(UpgradeResourceState_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/UpgradeResourceState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ConfigureProvider(ctx context.Context, in *ConfigureProvider_Request, opts ...grpc.CallOption) (*ConfigureProvider_Response, error) { + out := new(ConfigureProvider_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ConfigureProvider", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ReadResource(ctx context.Context, in *ReadResource_Request, opts ...grpc.CallOption) (*ReadResource_Response, error) { + out := new(ReadResource_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ReadResource", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) PlanResourceChange(ctx context.Context, in *PlanResourceChange_Request, opts ...grpc.CallOption) (*PlanResourceChange_Response, error) { + out := new(PlanResourceChange_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/PlanResourceChange", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ApplyResourceChange(ctx context.Context, in *ApplyResourceChange_Request, opts ...grpc.CallOption) (*ApplyResourceChange_Response, error) { + out := new(ApplyResourceChange_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ApplyResourceChange", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ImportResourceState(ctx context.Context, in *ImportResourceState_Request, opts ...grpc.CallOption) (*ImportResourceState_Response, error) { + out := new(ImportResourceState_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ImportResourceState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) ReadDataSource(ctx context.Context, in *ReadDataSource_Request, opts ...grpc.CallOption) (*ReadDataSource_Response, error) { + out := new(ReadDataSource_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/ReadDataSource", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *providerClient) StopProvider(ctx context.Context, in *StopProvider_Request, opts ...grpc.CallOption) (*StopProvider_Response, error) { + out := new(StopProvider_Response) + err := c.cc.Invoke(ctx, "/tfplugin6.Provider/StopProvider", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProviderServer is the server API for Provider service. +// All implementations must embed UnimplementedProviderServer +// for forward compatibility +type ProviderServer interface { + //////// Information about what a provider supports/expects + GetProviderSchema(context.Context, *GetProviderSchema_Request) (*GetProviderSchema_Response, error) + ValidateProviderConfig(context.Context, *ValidateProviderConfig_Request) (*ValidateProviderConfig_Response, error) + ValidateResourceConfig(context.Context, *ValidateResourceConfig_Request) (*ValidateResourceConfig_Response, error) + ValidateDataResourceConfig(context.Context, *ValidateDataResourceConfig_Request) (*ValidateDataResourceConfig_Response, error) + UpgradeResourceState(context.Context, *UpgradeResourceState_Request) (*UpgradeResourceState_Response, error) + //////// One-time initialization, called before other functions below + ConfigureProvider(context.Context, *ConfigureProvider_Request) (*ConfigureProvider_Response, error) + //////// Managed Resource Lifecycle + ReadResource(context.Context, *ReadResource_Request) (*ReadResource_Response, error) + PlanResourceChange(context.Context, *PlanResourceChange_Request) (*PlanResourceChange_Response, error) + ApplyResourceChange(context.Context, *ApplyResourceChange_Request) (*ApplyResourceChange_Response, error) + ImportResourceState(context.Context, *ImportResourceState_Request) (*ImportResourceState_Response, error) + ReadDataSource(context.Context, *ReadDataSource_Request) (*ReadDataSource_Response, error) + //////// Graceful Shutdown + StopProvider(context.Context, *StopProvider_Request) (*StopProvider_Response, error) + mustEmbedUnimplementedProviderServer() +} + +// UnimplementedProviderServer must be embedded to have forward compatible implementations. +type UnimplementedProviderServer struct { +} + +func (UnimplementedProviderServer) GetProviderSchema(context.Context, *GetProviderSchema_Request) (*GetProviderSchema_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProviderSchema not implemented") +} +func (UnimplementedProviderServer) ValidateProviderConfig(context.Context, *ValidateProviderConfig_Request) (*ValidateProviderConfig_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateProviderConfig not implemented") +} +func (UnimplementedProviderServer) ValidateResourceConfig(context.Context, *ValidateResourceConfig_Request) (*ValidateResourceConfig_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateResourceConfig not implemented") +} +func (UnimplementedProviderServer) ValidateDataResourceConfig(context.Context, *ValidateDataResourceConfig_Request) (*ValidateDataResourceConfig_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateDataResourceConfig not implemented") +} +func (UnimplementedProviderServer) UpgradeResourceState(context.Context, *UpgradeResourceState_Request) (*UpgradeResourceState_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpgradeResourceState not implemented") +} +func (UnimplementedProviderServer) ConfigureProvider(context.Context, *ConfigureProvider_Request) (*ConfigureProvider_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigureProvider not implemented") +} +func (UnimplementedProviderServer) ReadResource(context.Context, *ReadResource_Request) (*ReadResource_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReadResource not implemented") +} +func (UnimplementedProviderServer) PlanResourceChange(context.Context, *PlanResourceChange_Request) (*PlanResourceChange_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method PlanResourceChange not implemented") +} +func (UnimplementedProviderServer) ApplyResourceChange(context.Context, *ApplyResourceChange_Request) (*ApplyResourceChange_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApplyResourceChange not implemented") +} +func (UnimplementedProviderServer) ImportResourceState(context.Context, *ImportResourceState_Request) (*ImportResourceState_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportResourceState not implemented") +} +func (UnimplementedProviderServer) ReadDataSource(context.Context, *ReadDataSource_Request) (*ReadDataSource_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReadDataSource not implemented") +} +func (UnimplementedProviderServer) StopProvider(context.Context, *StopProvider_Request) (*StopProvider_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method StopProvider not implemented") +} +func (UnimplementedProviderServer) mustEmbedUnimplementedProviderServer() {} + +// UnsafeProviderServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ProviderServer will +// result in compilation errors. +type UnsafeProviderServer interface { + mustEmbedUnimplementedProviderServer() +} + +func RegisterProviderServer(s grpc.ServiceRegistrar, srv ProviderServer) { + s.RegisterService(&Provider_ServiceDesc, srv) +} + +func _Provider_GetProviderSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProviderSchema_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).GetProviderSchema(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/GetProviderSchema", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).GetProviderSchema(ctx, req.(*GetProviderSchema_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ValidateProviderConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateProviderConfig_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ValidateProviderConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ValidateProviderConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ValidateProviderConfig(ctx, req.(*ValidateProviderConfig_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ValidateResourceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateResourceConfig_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ValidateResourceConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ValidateResourceConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ValidateResourceConfig(ctx, req.(*ValidateResourceConfig_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ValidateDataResourceConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateDataResourceConfig_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ValidateDataResourceConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ValidateDataResourceConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ValidateDataResourceConfig(ctx, req.(*ValidateDataResourceConfig_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_UpgradeResourceState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpgradeResourceState_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).UpgradeResourceState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/UpgradeResourceState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).UpgradeResourceState(ctx, req.(*UpgradeResourceState_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ConfigureProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigureProvider_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ConfigureProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ConfigureProvider", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ConfigureProvider(ctx, req.(*ConfigureProvider_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ReadResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadResource_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ReadResource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ReadResource", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ReadResource(ctx, req.(*ReadResource_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_PlanResourceChange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PlanResourceChange_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).PlanResourceChange(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/PlanResourceChange", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).PlanResourceChange(ctx, req.(*PlanResourceChange_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ApplyResourceChange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApplyResourceChange_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ApplyResourceChange(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ApplyResourceChange", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ApplyResourceChange(ctx, req.(*ApplyResourceChange_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ImportResourceState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportResourceState_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ImportResourceState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ImportResourceState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ImportResourceState(ctx, req.(*ImportResourceState_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_ReadDataSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReadDataSource_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).ReadDataSource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/ReadDataSource", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).ReadDataSource(ctx, req.(*ReadDataSource_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Provider_StopProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopProvider_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderServer).StopProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tfplugin6.Provider/StopProvider", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderServer).StopProvider(ctx, req.(*StopProvider_Request)) + } + return interceptor(ctx, in, info, handler) +} + +// Provider_ServiceDesc is the grpc.ServiceDesc for Provider service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Provider_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "tfplugin6.Provider", + HandlerType: (*ProviderServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetProviderSchema", + Handler: _Provider_GetProviderSchema_Handler, + }, + { + MethodName: "ValidateProviderConfig", + Handler: _Provider_ValidateProviderConfig_Handler, + }, + { + MethodName: "ValidateResourceConfig", + Handler: _Provider_ValidateResourceConfig_Handler, + }, + { + MethodName: "ValidateDataResourceConfig", + Handler: _Provider_ValidateDataResourceConfig_Handler, + }, + { + MethodName: "UpgradeResourceState", + Handler: _Provider_UpgradeResourceState_Handler, + }, + { + MethodName: "ConfigureProvider", + Handler: _Provider_ConfigureProvider_Handler, + }, + { + MethodName: "ReadResource", + Handler: _Provider_ReadResource_Handler, + }, + { + MethodName: "PlanResourceChange", + Handler: _Provider_PlanResourceChange_Handler, + }, + { + MethodName: "ApplyResourceChange", + Handler: _Provider_ApplyResourceChange_Handler, + }, + { + MethodName: "ImportResourceState", + Handler: _Provider_ImportResourceState_Handler, + }, + { + MethodName: "ReadDataSource", + Handler: _Provider_ReadDataSource_Handler, + }, + { + MethodName: "StopProvider", + Handler: _Provider_StopProvider_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "tfplugin6.proto", +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/attribute_path.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/attribute_path.go new file mode 100644 index 000000000..0cf4daac9 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/attribute_path.go @@ -0,0 +1,98 @@ +package toproto + +import ( + "errors" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +var ErrUnknownAttributePathStepType = errors.New("unknown type of AttributePath_Step") + +func AttributePath(in *tftypes.AttributePath) (*tfplugin6.AttributePath, error) { + if in == nil { + return nil, nil + } + steps, err := AttributePath_Steps(in.Steps()) + if err != nil { + return nil, err + } + return &tfplugin6.AttributePath{ + Steps: steps, + }, nil +} + +func AttributePaths(in []*tftypes.AttributePath) ([]*tfplugin6.AttributePath, error) { + resp := make([]*tfplugin6.AttributePath, 0, len(in)) + for _, a := range in { + if a == nil { + resp = append(resp, nil) + continue + } + attr, err := AttributePath(a) + if err != nil { + return resp, err + } + resp = append(resp, attr) + } + return resp, nil +} + +func AttributePath_Step(step tftypes.AttributePathStep) (*tfplugin6.AttributePath_Step, error) { + var resp tfplugin6.AttributePath_Step + if name, ok := step.(tftypes.AttributeName); ok { + resp.Selector = &tfplugin6.AttributePath_Step_AttributeName{ + AttributeName: string(name), + } + return &resp, nil + } + if key, ok := step.(tftypes.ElementKeyString); ok { + resp.Selector = &tfplugin6.AttributePath_Step_ElementKeyString{ + ElementKeyString: string(key), + } + return &resp, nil + } + if key, ok := step.(tftypes.ElementKeyInt); ok { + resp.Selector = &tfplugin6.AttributePath_Step_ElementKeyInt{ + ElementKeyInt: int64(key), + } + return &resp, nil + } + if _, ok := step.(tftypes.ElementKeyValue); ok { + // the protocol has no equivalent of an ElementKeyValue, so we + // return nil for both the step and the error here, to signal + // that we've hit a step we can't convey back to Terraform + return nil, nil + } + return nil, ErrUnknownAttributePathStepType +} + +func AttributePath_Steps(in []tftypes.AttributePathStep) ([]*tfplugin6.AttributePath_Step, error) { + resp := make([]*tfplugin6.AttributePath_Step, 0, len(in)) + for _, step := range in { + if step == nil { + resp = append(resp, nil) + continue + } + s, err := AttributePath_Step(step) + if err != nil { + return resp, err + } + // in the face of a set, the protocol has no way to represent + // the index, so we just bail and return the prefix we can + // return. + if s == nil { + return resp, nil + } + resp = append(resp, s) + } + return resp, nil +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/data_source.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/data_source.go new file mode 100644 index 000000000..624a3bb10 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/data_source.go @@ -0,0 +1,61 @@ +package toproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func ValidateDataResourceConfig_Request(in *tfprotov6.ValidateDataResourceConfigRequest) (*tfplugin6.ValidateDataResourceConfig_Request, error) { + resp := &tfplugin6.ValidateDataResourceConfig_Request{ + TypeName: in.TypeName, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return resp, nil +} + +func ValidateDataResourceConfig_Response(in *tfprotov6.ValidateDataResourceConfigResponse) (*tfplugin6.ValidateDataResourceConfig_Response, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfplugin6.ValidateDataResourceConfig_Response{ + Diagnostics: diags, + }, nil +} + +func ReadDataSource_Request(in *tfprotov6.ReadDataSourceRequest) (*tfplugin6.ReadDataSource_Request, error) { + resp := &tfplugin6.ReadDataSource_Request{ + TypeName: in.TypeName, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func ReadDataSource_Response(in *tfprotov6.ReadDataSourceResponse) (*tfplugin6.ReadDataSource_Response, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + resp := &tfplugin6.ReadDataSource_Response{ + Diagnostics: diags, + } + if in.State != nil { + resp.State = DynamicValue(in.State) + } + return resp, nil +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go new file mode 100644 index 000000000..26ce3e9df --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/diagnostic.go @@ -0,0 +1,50 @@ +package toproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func Diagnostic(in *tfprotov6.Diagnostic) (*tfplugin6.Diagnostic, error) { + diag := &tfplugin6.Diagnostic{ + Severity: Diagnostic_Severity(in.Severity), + Summary: in.Summary, + Detail: in.Detail, + } + if in.Attribute != nil { + attr, err := AttributePath(in.Attribute) + if err != nil { + return diag, err + } + diag.Attribute = attr + } + return diag, nil +} + +func Diagnostic_Severity(in tfprotov6.DiagnosticSeverity) tfplugin6.Diagnostic_Severity { + return tfplugin6.Diagnostic_Severity(in) +} + +func Diagnostics(in []*tfprotov6.Diagnostic) ([]*tfplugin6.Diagnostic, error) { + diagnostics := make([]*tfplugin6.Diagnostic, 0, len(in)) + for _, diag := range in { + if diag == nil { + diagnostics = append(diagnostics, nil) + continue + } + d, err := Diagnostic(diag) + if err != nil { + return diagnostics, err + } + diagnostics = append(diagnostics, d) + } + return diagnostics, nil +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/dynamic_value.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/dynamic_value.go new file mode 100644 index 000000000..ef1693dae --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/dynamic_value.go @@ -0,0 +1,35 @@ +package toproto + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +func DynamicValue(in *tfprotov6.DynamicValue) *tfplugin6.DynamicValue { + return &tfplugin6.DynamicValue{ + Msgpack: in.MsgPack, + Json: in.JSON, + } +} + +func CtyType(in tftypes.Type) ([]byte, error) { + switch { + case in.Is(tftypes.String), in.Is(tftypes.Bool), in.Is(tftypes.Number), + in.Is(tftypes.List{}), in.Is(tftypes.Map{}), + in.Is(tftypes.Set{}), in.Is(tftypes.Object{}), + in.Is(tftypes.Tuple{}), in.Is(tftypes.DynamicPseudoType): + return in.MarshalJSON() //nolint:staticcheck + } + return nil, fmt.Errorf("unknown type %s", in) +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/provider.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/provider.go new file mode 100644 index 000000000..503ba4e2b --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/provider.go @@ -0,0 +1,117 @@ +package toproto + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func GetProviderSchema_Request(in *tfprotov6.GetProviderSchemaRequest) (*tfplugin6.GetProviderSchema_Request, error) { + return &tfplugin6.GetProviderSchema_Request{}, nil +} + +func GetProviderSchema_Response(in *tfprotov6.GetProviderSchemaResponse) (*tfplugin6.GetProviderSchema_Response, error) { + var resp tfplugin6.GetProviderSchema_Response + if in.Provider != nil { + schema, err := Schema(in.Provider) + if err != nil { + return &resp, fmt.Errorf("error marshaling provider schema: %w", err) + } + resp.Provider = schema + } + if in.ProviderMeta != nil { + schema, err := Schema(in.ProviderMeta) + if err != nil { + return &resp, fmt.Errorf("error marshaling provider_meta schema: %w", err) + } + resp.ProviderMeta = schema + } + resp.ResourceSchemas = make(map[string]*tfplugin6.Schema, len(in.ResourceSchemas)) + for k, v := range in.ResourceSchemas { + if v == nil { + resp.ResourceSchemas[k] = nil + continue + } + schema, err := Schema(v) + if err != nil { + return &resp, fmt.Errorf("error marshaling resource schema for %q: %w", k, err) + } + resp.ResourceSchemas[k] = schema + } + resp.DataSourceSchemas = make(map[string]*tfplugin6.Schema, len(in.DataSourceSchemas)) + for k, v := range in.DataSourceSchemas { + if v == nil { + resp.DataSourceSchemas[k] = nil + continue + } + schema, err := Schema(v) + if err != nil { + return &resp, fmt.Errorf("error marshaling data source schema for %q: %w", k, err) + } + resp.DataSourceSchemas[k] = schema + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return &resp, err + } + resp.Diagnostics = diags + return &resp, nil +} + +func ValidateProviderConfig_Request(in *tfprotov6.ValidateProviderConfigRequest) (*tfplugin6.ValidateProviderConfig_Request, error) { + resp := &tfplugin6.ValidateProviderConfig_Request{} + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return resp, nil +} + +func ValidateProviderConfig_Response(in *tfprotov6.ValidateProviderConfigResponse) (*tfplugin6.ValidateProviderConfig_Response, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + resp := &tfplugin6.ValidateProviderConfig_Response{ + Diagnostics: diags, + } + return resp, nil +} + +func Configure_Request(in *tfprotov6.ConfigureProviderRequest) (*tfplugin6.ConfigureProvider_Request, error) { + resp := &tfplugin6.ConfigureProvider_Request{ + TerraformVersion: in.TerraformVersion, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return resp, nil +} + +func Configure_Response(in *tfprotov6.ConfigureProviderResponse) (*tfplugin6.ConfigureProvider_Response, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfplugin6.ConfigureProvider_Response{ + Diagnostics: diags, + }, nil +} + +func Stop_Request(in *tfprotov6.StopProviderRequest) (*tfplugin6.StopProvider_Request, error) { + return &tfplugin6.StopProvider_Request{}, nil +} + +func Stop_Response(in *tfprotov6.StopProviderResponse) (*tfplugin6.StopProvider_Response, error) { + return &tfplugin6.StopProvider_Response{ + Error: in.Error, + }, nil +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/resource.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/resource.go new file mode 100644 index 000000000..bb0968185 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/resource.go @@ -0,0 +1,214 @@ +package toproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func ValidateResourceConfig_Request(in *tfprotov6.ValidateResourceConfigRequest) (*tfplugin6.ValidateResourceConfig_Request, error) { + resp := &tfplugin6.ValidateResourceConfig_Request{ + TypeName: in.TypeName, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + return resp, nil +} + +func ValidateResourceConfig_Response(in *tfprotov6.ValidateResourceConfigResponse) (*tfplugin6.ValidateResourceConfig_Response, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfplugin6.ValidateResourceConfig_Response{ + Diagnostics: diags, + }, nil +} + +func UpgradeResourceState_Request(in *tfprotov6.UpgradeResourceStateRequest) (*tfplugin6.UpgradeResourceState_Request, error) { + resp := &tfplugin6.UpgradeResourceState_Request{ + TypeName: in.TypeName, + Version: in.Version, + } + if in.RawState != nil { + resp.RawState = RawState(in.RawState) + } + return resp, nil +} + +func UpgradeResourceState_Response(in *tfprotov6.UpgradeResourceStateResponse) (*tfplugin6.UpgradeResourceState_Response, error) { + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + resp := &tfplugin6.UpgradeResourceState_Response{ + Diagnostics: diags, + } + if in.UpgradedState != nil { + resp.UpgradedState = DynamicValue(in.UpgradedState) + } + return resp, nil +} + +func ReadResource_Request(in *tfprotov6.ReadResourceRequest) (*tfplugin6.ReadResource_Request, error) { + resp := &tfplugin6.ReadResource_Request{ + TypeName: in.TypeName, + Private: in.Private, + } + if in.CurrentState != nil { + resp.CurrentState = DynamicValue(in.CurrentState) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func ReadResource_Response(in *tfprotov6.ReadResourceResponse) (*tfplugin6.ReadResource_Response, error) { + resp := &tfplugin6.ReadResource_Response{ + Private: in.Private, + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return resp, err + } + resp.Diagnostics = diags + if in.NewState != nil { + resp.NewState = DynamicValue(in.NewState) + } + return resp, nil +} + +func PlanResourceChange_Request(in *tfprotov6.PlanResourceChangeRequest) (*tfplugin6.PlanResourceChange_Request, error) { + resp := &tfplugin6.PlanResourceChange_Request{ + TypeName: in.TypeName, + PriorPrivate: in.PriorPrivate, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + if in.PriorState != nil { + resp.PriorState = DynamicValue(in.PriorState) + } + if in.ProposedNewState != nil { + resp.ProposedNewState = DynamicValue(in.ProposedNewState) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func PlanResourceChange_Response(in *tfprotov6.PlanResourceChangeResponse) (*tfplugin6.PlanResourceChange_Response, error) { + resp := &tfplugin6.PlanResourceChange_Response{ + PlannedPrivate: in.PlannedPrivate, + LegacyTypeSystem: in.UnsafeToUseLegacyTypeSystem, //nolint:staticcheck + } + requiresReplace, err := AttributePaths(in.RequiresReplace) + if err != nil { + return resp, err + } + resp.RequiresReplace = requiresReplace + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return resp, err + } + resp.Diagnostics = diags + if in.PlannedState != nil { + resp.PlannedState = DynamicValue(in.PlannedState) + } + return resp, nil +} + +func ApplyResourceChange_Request(in *tfprotov6.ApplyResourceChangeRequest) (*tfplugin6.ApplyResourceChange_Request, error) { + resp := &tfplugin6.ApplyResourceChange_Request{ + TypeName: in.TypeName, + PlannedPrivate: in.PlannedPrivate, + } + if in.Config != nil { + resp.Config = DynamicValue(in.Config) + } + if in.PriorState != nil { + resp.PriorState = DynamicValue(in.PriorState) + } + if in.PlannedState != nil { + resp.PlannedState = DynamicValue(in.PlannedState) + } + if in.ProviderMeta != nil { + resp.ProviderMeta = DynamicValue(in.ProviderMeta) + } + return resp, nil +} + +func ApplyResourceChange_Response(in *tfprotov6.ApplyResourceChangeResponse) (*tfplugin6.ApplyResourceChange_Response, error) { + resp := &tfplugin6.ApplyResourceChange_Response{ + Private: in.Private, + LegacyTypeSystem: in.UnsafeToUseLegacyTypeSystem, //nolint:staticcheck + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return resp, err + } + resp.Diagnostics = diags + if in.NewState != nil { + resp.NewState = DynamicValue(in.NewState) + } + return resp, nil +} + +func ImportResourceState_Request(in *tfprotov6.ImportResourceStateRequest) (*tfplugin6.ImportResourceState_Request, error) { + return &tfplugin6.ImportResourceState_Request{ + TypeName: in.TypeName, + Id: in.ID, + }, nil +} + +func ImportResourceState_Response(in *tfprotov6.ImportResourceStateResponse) (*tfplugin6.ImportResourceState_Response, error) { + importedResources, err := ImportResourceState_ImportedResources(in.ImportedResources) + if err != nil { + return nil, err + } + diags, err := Diagnostics(in.Diagnostics) + if err != nil { + return nil, err + } + return &tfplugin6.ImportResourceState_Response{ + ImportedResources: importedResources, + Diagnostics: diags, + }, nil +} + +func ImportResourceState_ImportedResource(in *tfprotov6.ImportedResource) (*tfplugin6.ImportResourceState_ImportedResource, error) { + resp := &tfplugin6.ImportResourceState_ImportedResource{ + TypeName: in.TypeName, + Private: in.Private, + } + if in.State != nil { + resp.State = DynamicValue(in.State) + } + return resp, nil +} + +func ImportResourceState_ImportedResources(in []*tfprotov6.ImportedResource) ([]*tfplugin6.ImportResourceState_ImportedResource, error) { + resp := make([]*tfplugin6.ImportResourceState_ImportedResource, 0, len(in)) + for _, i := range in { + if i == nil { + resp = append(resp, nil) + continue + } + r, err := ImportResourceState_ImportedResource(i) + if err != nil { + return resp, err + } + resp = append(resp, r) + } + return resp, nil +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/schema.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/schema.go new file mode 100644 index 000000000..f3dfcb97d --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/schema.go @@ -0,0 +1,147 @@ +package toproto + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func Schema(in *tfprotov6.Schema) (*tfplugin6.Schema, error) { + var resp tfplugin6.Schema + resp.Version = in.Version + if in.Block != nil { + block, err := Schema_Block(in.Block) + if err != nil { + return &resp, fmt.Errorf("error marshalling block: %w", err) + } + resp.Block = block + } + return &resp, nil +} + +func Schema_Block(in *tfprotov6.SchemaBlock) (*tfplugin6.Schema_Block, error) { + resp := &tfplugin6.Schema_Block{ + Version: in.Version, + Description: in.Description, + DescriptionKind: StringKind(in.DescriptionKind), + Deprecated: in.Deprecated, + } + attrs, err := Schema_Attributes(in.Attributes) + if err != nil { + return resp, err + } + resp.Attributes = attrs + blocks, err := Schema_NestedBlocks(in.BlockTypes) + if err != nil { + return resp, err + } + resp.BlockTypes = blocks + return resp, nil +} + +func Schema_Attribute(in *tfprotov6.SchemaAttribute) (*tfplugin6.Schema_Attribute, error) { + resp := &tfplugin6.Schema_Attribute{ + Name: in.Name, + Description: in.Description, + Required: in.Required, + Optional: in.Optional, + Computed: in.Computed, + Sensitive: in.Sensitive, + DescriptionKind: StringKind(in.DescriptionKind), + Deprecated: in.Deprecated, + } + if in.Type != nil { + t, err := CtyType(in.Type) + if err != nil { + return resp, fmt.Errorf("error marshaling type to JSON: %w", err) + } + resp.Type = t + } + if in.NestedType != nil { + nb, err := Schema_Object(in.NestedType) + if err != nil { + return resp, err + } + resp.NestedType = nb + } + return resp, nil +} + +func Schema_Attributes(in []*tfprotov6.SchemaAttribute) ([]*tfplugin6.Schema_Attribute, error) { + resp := make([]*tfplugin6.Schema_Attribute, 0, len(in)) + for _, a := range in { + if a == nil { + resp = append(resp, nil) + continue + } + attr, err := Schema_Attribute(a) + if err != nil { + return nil, err + } + resp = append(resp, attr) + } + return resp, nil +} + +func Schema_NestedBlock(in *tfprotov6.SchemaNestedBlock) (*tfplugin6.Schema_NestedBlock, error) { + resp := &tfplugin6.Schema_NestedBlock{ + TypeName: in.TypeName, + Nesting: Schema_NestedBlock_NestingMode(in.Nesting), + MinItems: in.MinItems, + MaxItems: in.MaxItems, + } + if in.Block != nil { + block, err := Schema_Block(in.Block) + if err != nil { + return resp, fmt.Errorf("error marshaling nested block: %w", err) + } + resp.Block = block + } + return resp, nil +} + +func Schema_NestedBlocks(in []*tfprotov6.SchemaNestedBlock) ([]*tfplugin6.Schema_NestedBlock, error) { + resp := make([]*tfplugin6.Schema_NestedBlock, 0, len(in)) + for _, b := range in { + if b == nil { + resp = append(resp, nil) + continue + } + block, err := Schema_NestedBlock(b) + if err != nil { + return nil, err + } + resp = append(resp, block) + } + return resp, nil +} + +func Schema_NestedBlock_NestingMode(in tfprotov6.SchemaNestedBlockNestingMode) tfplugin6.Schema_NestedBlock_NestingMode { + return tfplugin6.Schema_NestedBlock_NestingMode(in) +} + +func Schema_Object_NestingMode(in tfprotov6.SchemaObjectNestingMode) tfplugin6.Schema_Object_NestingMode { + return tfplugin6.Schema_Object_NestingMode(in) +} + +func Schema_Object(in *tfprotov6.SchemaObject) (*tfplugin6.Schema_Object, error) { + resp := &tfplugin6.Schema_Object{ + Nesting: Schema_Object_NestingMode(in.Nesting), + } + attrs, err := Schema_Attributes(in.Attributes) + if err != nil { + return nil, err + } + resp.Attributes = attrs + + return resp, nil +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/state.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/state.go new file mode 100644 index 000000000..b6a69fcc4 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/state.go @@ -0,0 +1,21 @@ +package toproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func RawState(in *tfprotov6.RawState) *tfplugin6.RawState { + return &tfplugin6.RawState{ + Json: in.JSON, + Flatmap: in.Flatmap, + } +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/string_kind.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/string_kind.go new file mode 100644 index 000000000..10f1727e0 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto/string_kind.go @@ -0,0 +1,18 @@ +package toproto + +import ( + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" +) + +func StringKind(in tfprotov6.StringKind) tfplugin6.StringKind { + return tfplugin6.StringKind(in) +} + +// we have to say this next thing to get golint to stop yelling at us about the +// underscores in the function names. We want the function names to match +// actually-generated code, so it feels like fair play. It's just a shame we +// lose golint for the entire file. +// +// This file is not actually generated. You can edit it. Ignore this next line. +// Code generated by hand ignore this next bit DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/provider.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/provider.go new file mode 100644 index 000000000..f2b8b3add --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/provider.go @@ -0,0 +1,181 @@ +package tfprotov6 + +import ( + "context" +) + +// ProviderServer is an interface that reflects that Terraform protocol. +// Providers must implement this interface. +type ProviderServer interface { + // GetProviderSchema is called when Terraform needs to know what the + // provider's schema is, along with the schemas of all its resources + // and data sources. + GetProviderSchema(context.Context, *GetProviderSchemaRequest) (*GetProviderSchemaResponse, error) + + // ValidateProviderConfig is called to give a provider a chance to + // validate the configuration the user specified. + ValidateProviderConfig(context.Context, *ValidateProviderConfigRequest) (*ValidateProviderConfigResponse, error) + + // ConfigureProvider is called to pass the user-specified provider + // configuration to the provider. + ConfigureProvider(context.Context, *ConfigureProviderRequest) (*ConfigureProviderResponse, error) + + // StopProvider is called when Terraform would like providers to shut + // down as quickly as possible, and usually represents an interrupt. + StopProvider(context.Context, *StopProviderRequest) (*StopProviderResponse, error) + + // ResourceServer is an interface encapsulating all the + // resource-related RPC requests. ProviderServer implementations must + // implement them, but they are a handy interface for defining what a + // resource is to terraform-plugin-go, so they're their own interface + // that is composed into ProviderServer. + ResourceServer + + // DataSourceServer is an interface encapsulating all the data + // source-related RPC requests. ProviderServer implementations must + // implement them, but they are a handy interface for defining what a + // data source is to terraform-plugin-go, so they're their own + // interface that is composed into ProviderServer. + DataSourceServer +} + +// GetProviderSchemaRequest represents a Terraform RPC request for the +// provider's schemas. +type GetProviderSchemaRequest struct{} + +// GetProviderSchemaResponse represents a Terraform RPC response containing the +// provider's schemas. +type GetProviderSchemaResponse struct { + // Provider defines the schema for the provider configuration, which + // will be specified in the provider block of the user's configuration. + Provider *Schema + + // ProviderMeta defines the schema for the provider's metadta, which + // will be specified in the provider_meta blocks of the terraform block + // for a module. This is an advanced feature and its usage should be + // coordinated with the Terraform Core team by opening an issue at + // https://github.com/hashicorp/terraform/issues/new/choose. + ProviderMeta *Schema + + // ResourceSchemas is a map of resource names to the schema for the + // configuration specified in the resource. The name should be a + // resource name, and should be prefixed with your provider's shortname + // and an underscore. It should match the first label after `resource` + // in a user's configuration. + ResourceSchemas map[string]*Schema + + // DataSourceSchemas is a map of data source names to the schema for + // the configuration specified in the data source. The name should be a + // data source name, and should be prefixed with your provider's + // shortname and an underscore. It should match the first label after + // `data` in a user's configuration. + DataSourceSchemas map[string]*Schema + + // Diagnostics report errors or warnings related to returning the + // provider's schemas. Returning an empty slice indicates success, with + // no errors or warnings generated. + Diagnostics []*Diagnostic +} + +// ValidateProviderConfigRequest represents a Terraform RPC request for the +// provider to modify the provider configuration in preparation for Terraform +// validating it. +type ValidateProviderConfigRequest struct { + // Config is the configuration the user supplied for the provider. See + // the documentation on `DynamicValue` for more information about + // safely accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // The ValidateProviderConfig RPC call will be called twice; once when + // generating a plan, once when applying the plan. When called during + // plan, Config can contain unknown values if fields with unknown + // values are interpolated into it. At apply time, all fields will have + // known values. Values that are not set in the configuration will be + // null. + Config *DynamicValue +} + +// ValidateProviderConfigResponse represents a Terraform RPC response containing +// a modified provider configuration that Terraform can now validate and use. +type ValidateProviderConfigResponse struct { + // PreparedConfig should be set to the modified configuration. See the + // documentation on `DynamicValue` for information about safely + // creating the `DynamicValue`. + // + // This RPC call exists because early versions of the Terraform Plugin + // SDK allowed providers to set defaults for provider configurations in + // such a way that Terraform couldn't validate the provider config + // without retrieving the default values first. As providers using + // terraform-plugin-go directly and new frameworks built on top of it + // have no such requirement, it is safe and recommended to simply set + // PreparedConfig to the value of the PrepareProviderConfigRequest's + // Config property, indicating that no changes are needed to the + // configuration. + // + // The configuration should be represented as a tftypes.Object, with + // each attribute and nested block getting its own key and value. + // + // TODO: should we provide an implementation that does that that + // provider developers can just embed and not need to implement the + // method themselves, then? + PreparedConfig *DynamicValue + + // Diagnostics report errors or warnings related to preparing the + // provider's configuration. Returning an empty slice indicates + // success, with no errors or warnings generated. + Diagnostics []*Diagnostic +} + +// ConfigureProviderRequest represents a Terraform RPC request to supply the +// provider with information about what the user entered in the provider's +// configuration block. +type ConfigureProviderRequest struct { + // TerraformVersion is the version of Terraform executing the request. + // This is supplied for logging, analytics, and User-Agent purposes + // *only*. Providers should not try to gate provider behavior on + // Terraform versions. It will make you sad. We can't stop you from + // doing it, but we really highly recommend you do not do it. + TerraformVersion string + + // Config is the configuration the user supplied for the provider. This + // information should usually be persisted to the underlying type + // that's implementing the ProviderServer interface, for use in later + // RPC requests. See the documentation on `DynamicValue` for more + // information about safely accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // The ConfigureProvider RPC call will be called twice; once when + // generating a plan, once when applying the plan. When called during + // plan, Config can contain unknown values if fields with unknown + // values are interpolated into it. At apply time, all fields will have + // known values. Values that are not set in the configuration will be + // null. + Config *DynamicValue +} + +// ConfigureProviderResponse represents a Terraform RPC response to the +// configuration block that Terraform supplied for the provider. +type ConfigureProviderResponse struct { + // Diagnostics report errors or warnings related to the provider's + // configuration. Returning an empty slice indicates success, with no + // errors or warnings generated. + Diagnostics []*Diagnostic +} + +// StopProviderRequest represents a Terraform RPC request to interrupt a +// provider's work and terminate a provider's processes as soon as possible. +type StopProviderRequest struct{} + +// StopProviderResponse represents a Terraform RPC response surfacing an issues +// the provider encountered in terminating. +type StopProviderResponse struct { + // Error should be set to a string describing the error if the provider + // cannot currently shut down for some reason. Because this always + // represents a system error and not a user error, it is returned as a + // string, not a Diagnostic. + Error string +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/resource.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/resource.go new file mode 100644 index 000000000..3250f1954 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/resource.go @@ -0,0 +1,451 @@ +package tfprotov6 + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +// ResourceServer is an interface containing the methods a resource +// implementation needs to fill. +type ResourceServer interface { + // ValidateResourceConfig is called when Terraform is checking that + // a resource's configuration is valid. It is guaranteed to have types + // conforming to your schema. This is your opportunity to do custom or + // advanced validation prior to a plan being generated. + ValidateResourceConfig(context.Context, *ValidateResourceConfigRequest) (*ValidateResourceConfigResponse, error) + + // UpgradeResourceState is called when Terraform has encountered a + // resource with a state in a schema that doesn't match the schema's + // current version. It is the provider's responsibility to modify the + // state to upgrade it to the latest state schema. + UpgradeResourceState(context.Context, *UpgradeResourceStateRequest) (*UpgradeResourceStateResponse, error) + + // ReadResource is called when Terraform is refreshing a resource's + // state. + ReadResource(context.Context, *ReadResourceRequest) (*ReadResourceResponse, error) + + // PlanResourceChange is called when Terraform is attempting to + // calculate a plan for a resource. Terraform will suggest a proposed + // new state, which the provider can modify or return unmodified to + // influence Terraform's plan. + PlanResourceChange(context.Context, *PlanResourceChangeRequest) (*PlanResourceChangeResponse, error) + + // ApplyResourceChange is called when Terraform has detected a diff + // between the resource's state and the user's config, and the user has + // approved a planned change. The provider is to apply the changes + // contained in the plan, and return the resulting state. + ApplyResourceChange(context.Context, *ApplyResourceChangeRequest) (*ApplyResourceChangeResponse, error) + + // ImportResourceState is called when a user has requested Terraform + // import a resource. The provider should fetch the information + // specified by the passed ID and return it as one or more resource + // states for Terraform to assume control of. + ImportResourceState(context.Context, *ImportResourceStateRequest) (*ImportResourceStateResponse, error) +} + +// ValidateResourceConfigRequest is the request Terraform sends when it +// wants to validate a resource's configuration. +type ValidateResourceConfigRequest struct { + // TypeName is the type of resource Terraform is validating. + TypeName string + + // Config is the configuration the user supplied for that resource. See + // the documentation on `DynamicValue` for more information about + // safely accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration may contain unknown values if a user uses + // interpolation or other functionality that would prevent Terraform + // from knowing the value at request time. Any attributes not directly + // set in the configuration will be null. + Config *DynamicValue +} + +// ValidateResourceConfigResponse is the response from the provider about +// the validity of a resource's configuration. +type ValidateResourceConfigResponse struct { + // Diagnostics report errors or warnings related to the given + // configuration. Returning an empty slice indicates a successful + // validation with no warnings or errors generated. + Diagnostics []*Diagnostic +} + +// UpgradeResourceStateRequest is the request Terraform sends when it needs a +// provider to upgrade the state of a given resource. +type UpgradeResourceStateRequest struct { + // TypeName is the type of resource that Terraform needs to upgrade the + // state for. + TypeName string + + // Version is the version of the state the resource currently has. + Version int64 + + // RawState is the state as Terraform sees it right now. See the + // documentation for `RawState` for information on how to work with the + // data it contains. + RawState *RawState +} + +// UpgradeResourceStateResponse is the response from the provider containing +// the upgraded state for the given resource. +type UpgradeResourceStateResponse struct { + // UpgradedState is the upgraded state for the resource, represented as + // a `DynamicValue`. See the documentation on `DynamicValue` for + // information about safely creating the `DynamicValue`. + // + // The state should be represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + UpgradedState *DynamicValue + + // Diagnostics report errors or warnings related to upgrading the + // state of the requested resource. Returning an empty slice indicates + // a successful validation with no warnings or errors generated. + Diagnostics []*Diagnostic +} + +// ReadResourceRequest is the request Terraform sends when it wants to get the +// latest state for a resource. +type ReadResourceRequest struct { + // TypeName is the type of resource Terraform is requesting an upated + // state for. + TypeName string + + // CurrentState is the current state of the resource as far as + // Terraform knows, represented as a `DynamicValue`. See the + // documentation for `DynamicValue` for information about safely + // accessing the state. + // + // The state is represented as a tftypes.Object, with each attribute + // and nested block getting its own key and value. + CurrentState *DynamicValue + + // Private is any provider-defined private state stored with the + // resource. It is used for keeping state with the resource that is not + // meant to be included when calculating diffs. + Private []byte + + // ProviderMeta supplies the provider metadata configuration for the + // module this resource is in. Module-specific provider metadata is an + // advanced feature and usage of it should be coordinated with the + // Terraform Core team by raising an issue at + // https://github.com/hashicorp/terraform/issues/new/choose. See the + // documentation on `DynamicValue` for information about safely + // accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration will have known values for all fields. + ProviderMeta *DynamicValue +} + +// ReadResourceResponse is the response from the provider about the current +// state of the requested resource. +type ReadResourceResponse struct { + // NewState is the current state of the resource according to the + // provider, represented as a `DynamicValue`. See the documentation for + // `DynamicValue` for information about safely creating the + // `DynamicValue`. + // + // The state should be represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + NewState *DynamicValue + + // Diagnostics report errors or warnings related to retrieving the + // current state of the requested resource. Returning an empty slice + // indicates a successful validation with no warnings or errors + // generated. + Diagnostics []*Diagnostic + + // Private should be set to any state that the provider would like sent + // with requests for this resource. This state will be associated with + // the resource, but will not be considered when calculating diffs. + Private []byte +} + +// PlanResourceChangeRequest is the request Terraform sends when it is +// generating a plan for a resource and wants the provider's input on what the +// planned state should be. +type PlanResourceChangeRequest struct { + // TypeName is the type of resource Terraform is generating a plan for. + TypeName string + + // PriorState is the state of the resource before the plan is applied, + // represented as a `DynamicValue`. See the documentation for + // `DynamicValue` for information about safely accessing the state. + // + // The state is represented as a tftypes.Object, with each attribute + // and nested block getting its own key and value. + PriorState *DynamicValue + + // ProposedNewState is the state that Terraform is proposing for the + // resource, with the changes in the configuration applied, represented + // as a `DynamicValue`. See the documentation for `DynamicValue` for + // information about safely accessing the state. + // + // The ProposedNewState merges any non-null values in the configuration + // with any computed attributes in PriorState as a utility to help + // providers avoid needing to implement such merging functionality + // themselves. + // + // The state is represented as a tftypes.Object, with each attribute + // and nested block getting its own key and value. + // + // The ProposedNewState will be null when planning a delete operation. + ProposedNewState *DynamicValue + + // Config is the configuration the user supplied for the resource. See + // the documentation on `DynamicValue` for more information about + // safely accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration may contain unknown values if a user uses + // interpolation or other functionality that would prevent Terraform + // from knowing the value at request time. + Config *DynamicValue + + // PriorPrivate is any provider-defined private state stored with the + // resource. It is used for keeping state with the resource that is not + // meant to be included when calculating diffs. + PriorPrivate []byte + + // ProviderMeta supplies the provider metadata configuration for the + // module this resource is in. Module-specific provider metadata is an + // advanced feature and usage of it should be coordinated with the + // Terraform Core team by raising an issue at + // https://github.com/hashicorp/terraform/issues/new/choose. See the + // documentation on `DynamicValue` for information about safely + // accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration will have known values for all fields. + ProviderMeta *DynamicValue +} + +// PlanResourceChangeResponse is the response from the provider about what the +// planned state for a given resource should be. +type PlanResourceChangeResponse struct { + // PlannedState is the provider's indication of what the state for the + // resource should be after apply, represented as a `DynamicValue`. See + // the documentation for `DynamicValue` for information about safely + // creating the `DynamicValue`. + // + // This is usually derived from the ProposedNewState passed in the + // PlanResourceChangeRequest, with default values substituted for any + // null values and overriding any computed values that are expected to + // change as a result of the apply operation. This may contain unknown + // values if the value could change but its new value won't be known + // until apply time. + // + // Any value that was non-null in the configuration must either + // preserve the exact configuration value or return the corresponding + // value from the prior state. The value from the prior state should be + // returned when the configuration value is semantically equivalent to + // the state value. + // + // Any value that is marked as computed in the schema and is null in + // the configuration may be set by the provider to any value of the + // expected type. + // + // PlanResourceChange will actually be called twice; once when + // generating the plan for the user to approve, once during the apply. + // During the apply, additional values from the configuration--upstream + // values interpolated in that were computed at apply time--will be + // populated. During this second call, any attribute that had a known + // value in the first PlannedState must have an identical value in the + // second PlannedState. Any unknown values may remain unknown or may + // take on any value of the appropriate type. This means the values + // returned in PlannedState should be deterministic and unknown values + // should be used if a field's value may change depending on what value + // ends up filling an unknown value in the config. + // + // The state should be represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + PlannedState *DynamicValue + + // RequiresReplace is a list of tftypes.AttributePaths that require the + // resource to be replaced. They should point to the specific field + // that changed that requires the resource to be destroyed and + // recreated. + RequiresReplace []*tftypes.AttributePath + + // PlannedPrivate should be set to any state that the provider would + // like sent with requests for this resource. This state will be + // associated with the resource, but will not be considered when + // calculating diffs. + PlannedPrivate []byte + + // Diagnostics report errors or warnings related to determining the + // planned state of the requested resource. Returning an empty slice + // indicates a successful validation with no warnings or errors + // generated. + Diagnostics []*Diagnostic + + // UnsafeToUseLegacyTypeSystem should only be set by + // hashicorp/terraform-plugin-sdk. It modifies Terraform's behavior to + // work with the legacy expectations of that SDK. + // + // Nobody else should use this. Ever. For any reason. Just don't do it. + // + // We have to expose it here for terraform-plugin-sdk to be muxable, or + // we wouldn't even be including it in this type. Don't use it. It may + // go away or change behavior on you with no warning. It is + // explicitly unsupported and not part of our SemVer guarantees. + // + // Deprecated: Really, just don't use this, you don't need it. + UnsafeToUseLegacyTypeSystem bool +} + +// ApplyResourceChangeRequest is the request Terraform sends when it needs to +// apply a planned set of changes to a resource. +type ApplyResourceChangeRequest struct { + // TypeName is the type of resource Terraform wants to change. + TypeName string + + // PriorState is the state of the resource before the changes are + // applied, represented as a `DynamicValue`. See the documentation for + // `DynamicValue` for information about safely accessing the state. + // + // The state is represented as a tftypes.Object, with each attribute + // and nested block getting its own key and value. + PriorState *DynamicValue + + // PlannedState is Terraform's plan for what the state should look like + // after the changes are applied, represented as a `DynamicValue`. See + // the documentation for `DynamicValue` for information about safely + // accessing the state. + // + // This is the PlannedState returned during PlanResourceChange. + // + // The state is represented as a tftypes.Object, with each attribute + // and nested block getting its own key and value. + PlannedState *DynamicValue + + // Config is the configuration the user supplied for the resource. See + // the documentation on `DynamicValue` for more information about + // safely accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration may contain unknown values. + Config *DynamicValue + + // PlannedPrivate is any provider-defined private state stored with the + // resource. It is used for keeping state with the resource that is not + // meant to be included when calculating diffs. + PlannedPrivate []byte + + // ProviderMeta supplies the provider metadata configuration for the + // module this resource is in. Module-specific provider metadata is an + // advanced feature and usage of it should be coordinated with the + // Terraform Core team by raising an issue at + // https://github.com/hashicorp/terraform/issues/new/choose. See the + // documentation on `DynamicValue` for information about safely + // accessing the configuration. + // + // The configuration is represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + // + // This configuration will have known values for all fields. + ProviderMeta *DynamicValue +} + +// ApplyResourceChangeResponse is the response from the provider about what the +// state of a resource is after planned changes have been applied. +type ApplyResourceChangeResponse struct { + // NewState is the provider's understanding of what the resource's + // state is after changes are applied, represented as a `DynamicValue`. + // See the documentation for `DynamicValue` for information about + // safely creating the `DynamicValue`. + // + // Any attribute, whether computed or not, that has a known value in + // the PlannedState in the ApplyResourceChangeRequest must be preserved + // exactly as it was in NewState. + // + // Any attribute in the PlannedState in the ApplyResourceChangeRequest + // that is unknown must take on a known value at this time. No unknown + // values are allowed in the NewState. + // + // The state should be represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + NewState *DynamicValue + + // Private should be set to any state that the provider would like sent + // with requests for this resource. This state will be associated with + // the resource, but will not be considered when calculating diffs. + Private []byte + + // Diagnostics report errors or warnings related to applying changes to + // the requested resource. Returning an empty slice indicates a + // successful validation with no warnings or errors generated. + Diagnostics []*Diagnostic + + // UnsafeToUseLegacyTypeSystem should only be set by + // hashicorp/terraform-plugin-sdk. It modifies Terraform's behavior to + // work with the legacy expectations of that SDK. + // + // Nobody else should use this. Ever. For any reason. Just don't do it. + // + // We have to expose it here for terraform-plugin-sdk to be muxable, or + // we wouldn't even be including it in this type. Don't use it. It may + // go away or change behavior on you with no warning. It is + // explicitly unsupported and not part of our SemVer guarantees. + // + // Deprecated: Really, just don't use this, you don't need it. + UnsafeToUseLegacyTypeSystem bool +} + +// ImportResourceStateRequest is the request Terraform sends when it wants a +// provider to import one or more resources specified by an ID. +type ImportResourceStateRequest struct { + // TypeName is the type of resource Terraform wants to import. + TypeName string + + // ID is the user-supplied identifying information about the resource + // or resources. Providers decide and communicate to users the format + // for the ID, and use it to determine what resource or resources to + // import. + ID string +} + +// ImportResourceStateResponse is the response from the provider about the +// imported resources. +type ImportResourceStateResponse struct { + // ImportedResources are the resources the provider found and was able + // to import. + ImportedResources []*ImportedResource + + // Diagnostics report errors or warnings related to importing the + // requested resource or resources. Returning an empty slice indicates + // a successful validation with no warnings or errors generated. + Diagnostics []*Diagnostic +} + +// ImportedResource represents a single resource that a provider has +// successfully imported into state. +type ImportedResource struct { + // TypeName is the type of resource that was imported. + TypeName string + + // State is the provider's understanding of the imported resource's + // state, represented as a `DynamicValue`. See the documentation for + // `DynamicValue` for information about safely creating the + // `DynamicValue`. + // + // The state should be represented as a tftypes.Object, with each + // attribute and nested block getting its own key and value. + State *DynamicValue + + // Private should be set to any state that the provider would like sent + // with requests for this resource. This state will be associated with + // the resource, but will not be considered when calculating diffs. + Private []byte +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go new file mode 100644 index 000000000..c17e2ccee --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/schema.go @@ -0,0 +1,440 @@ +package tfprotov6 + +import "github.com/hashicorp/terraform-plugin-go/tftypes" + +const ( + // SchemaNestedBlockNestingModeInvalid indicates that the nesting mode + // for a nested block in the schema is invalid. This generally + // indicates a nested block that was created incorrectly. + SchemaNestedBlockNestingModeInvalid SchemaNestedBlockNestingMode = 0 + + // SchemaNestedBlockNestingModeSingle indicates that the nested block + // should be treated as a single block with no labels, and there should + // not be more than one of these blocks in the containing block. The + // block will appear in config and state values as a tftypes.Object. + SchemaNestedBlockNestingModeSingle SchemaNestedBlockNestingMode = 1 + + // SchemaNestedBlockNestingModeList indicates that multiple instances + // of the nested block should be permitted, with no labels, and that + // the instances of the block should appear in config and state values + // as a tftypes.List, with an ElementType of tftypes.Object. + SchemaNestedBlockNestingModeList SchemaNestedBlockNestingMode = 2 + + // SchemaNestedBlockNestingModeSet indicates that multiple instances + // of the nested block should be permitted, with no labels, and that + // the instances of the block should appear in config and state values + // as a tftypes.Set, with an ElementType of tftypes.Object. + SchemaNestedBlockNestingModeSet SchemaNestedBlockNestingMode = 3 + + // SchemaNestedBlockNestingModeMap indicates that multiple instances of + // the nested block should be permitted, each with a single label, and + // that they should be represented in state and config values as a + // tftypes.Map, with an ElementType of tftypes.Object. The labels on + // the blocks will be used as the map keys. It is an error, therefore, + // to use the same label value on multiple block instances. + SchemaNestedBlockNestingModeMap SchemaNestedBlockNestingMode = 4 + + // SchemaNestedBlockNestingModeGroup indicates that the nested block + // should be treated as a single block with no labels, and there should + // not be more than one of these blocks in the containing block. The + // block will appear in config and state values as a tftypes.Object. + // + // SchemaNestedBlockNestingModeGroup is distinct from + // SchemaNestedBlockNestingModeSingle in that it guarantees that the + // block will never be null. If it is omitted from a config, the block + // will still be set, but its attributes and nested blocks will all be + // null. This is an exception to the rule that any block not set in the + // configuration cannot be set in config by the provider; this ensures + // the block is always considered "set" in the configuration, and is + // therefore settable in state by the provider. + SchemaNestedBlockNestingModeGroup SchemaNestedBlockNestingMode = 5 + + // SchemaObjectNestingModeInvalid indicates that the nesting mode + // for a nested type in the schema is invalid. This generally + // indicates a nested type that was created incorrectly. + SchemaObjectNestingModeInvalid SchemaObjectNestingMode = 0 + + // SchemaObjectNestingModeSingle indicates that the nested type should + // be treated as a single object. The block will appear in config and state + // values as a tftypes.Object. + SchemaObjectNestingModeSingle SchemaObjectNestingMode = 1 + + // SchemaObjectNestingModeList indicates that multiple instances of the + // nested type should be permitted, and that the nested type should appear + // in config and state values as a tftypes.List, with an ElementType of + // tftypes.Object. + SchemaObjectNestingModeList SchemaObjectNestingMode = 2 + + // SchemaObjectNestingModeSet indicates that multiple instances of the + // nested type should be permitted, and that the nested type should appear in + // config and state values as a tftypes.Set, with an ElementType of + // tftypes.Object. + SchemaObjectNestingModeSet SchemaObjectNestingMode = 3 + + // SchemaObjectNestingModeMap indicates that multiple instances of the + // nested type should be permitted, and that they should be appear in state + // and config values as a tftypes.Map, with an ElementType of + // tftypes.Object. + SchemaObjectNestingModeMap SchemaObjectNestingMode = 4 +) + +// Schema is how Terraform defines the shape of data. It can be thought of as +// the type information for resources, data sources, provider configuration, +// and all the other data that Terraform sends to providers. It is how +// providers express their requirements for that data. +type Schema struct { + // Version indicates which version of the schema this is. Versions + // should be monotonically incrementing numbers. When Terraform + // encounters a resource stored in state with a schema version lower + // that the schema version the provider advertises for that resource, + // Terraform requests the provider upgrade the resource's state. + Version int64 + + // Block is the root level of the schema, the collection of attributes + // and blocks that make up a resource, data source, provider, or other + // configuration block. + Block *SchemaBlock +} + +// ValueType returns the tftypes.Type for a Schema. +// +// If Schema is missing, an empty Object is returned. +func (s *Schema) ValueType() tftypes.Type { + if s == nil { + return tftypes.Object{ + AttributeTypes: map[string]tftypes.Type{}, + } + } + + return s.Block.ValueType() +} + +// SchemaBlock represents a block in a schema. Blocks are how Terraform creates +// groupings of attributes. In configurations, they don't use the equals sign +// and use dynamic instead of list comprehensions. +// +// Blocks will show up in state and config Values as a tftypes.Object, with the +// attributes and nested blocks defining the tftypes.Object's AttributeTypes. +type SchemaBlock struct { + // TODO: why do we have version in the block, too? + Version int64 + + // Attributes are the attributes defined within the block. These are + // the fields that users can set using the equals sign or reference in + // interpolations. + Attributes []*SchemaAttribute + + // BlockTypes are the nested blocks within the block. These are used to + // have blocks within blocks. + BlockTypes []*SchemaNestedBlock + + // Description offers an end-user friendly description of what the + // block is for. This will be surfaced to users through editor + // integrations, documentation generation, and other settings. + Description string + + // DescriptionKind indicates the formatting and encoding that the + // Description field is using. + DescriptionKind StringKind + + // Deprecated, when set to true, indicates that a block should no + // longer be used and users should migrate away from it. At the moment + // it is unused and will have no impact, but it will be used in future + // tooling that is powered by provider schemas to enable richer user + // experiences. Providers should set it when deprecating blocks in + // preparation for these tools. + Deprecated bool +} + +// ValueType returns the tftypes.Type for a SchemaBlock. +// +// If SchemaBlock is missing, an empty Object is returned. +func (s *SchemaBlock) ValueType() tftypes.Type { + if s == nil { + return tftypes.Object{ + AttributeTypes: map[string]tftypes.Type{}, + } + } + + attributeTypes := map[string]tftypes.Type{} + + for _, attribute := range s.Attributes { + if attribute == nil { + continue + } + + attributeType := attribute.ValueType() + + if attributeType == nil { + continue + } + + attributeTypes[attribute.Name] = attributeType + } + + for _, block := range s.BlockTypes { + if block == nil { + continue + } + + blockType := block.ValueType() + + if blockType == nil { + continue + } + + attributeTypes[block.TypeName] = blockType + } + + return tftypes.Object{ + AttributeTypes: attributeTypes, + } +} + +// SchemaAttribute represents a single attribute within a schema block. +// Attributes are the fields users can set in configuration using the equals +// sign, can assign to variables, can interpolate, and can use list +// comprehensions on. +type SchemaAttribute struct { + // Name is the name of the attribute. This is what the user will put + // before the equals sign to assign a value to this attribute. + Name string + + // Type indicates the type of data the attribute expects. See the + // documentation for the tftypes package for information on what types + // are supported and their behaviors. + Type tftypes.Type + + // NestedType indicates that this is a NestedBlock-style object masquerading + // as an attribute. This field conflicts with Type. + NestedType *SchemaObject + + // Description offers an end-user friendly description of what the + // attribute is for. This will be surfaced to users through editor + // integrations, documentation generation, and other settings. + Description string + + // Required, when set to true, indicates that this attribute must have + // a value assigned to it by the user or Terraform will throw an error. + Required bool + + // Optional, when set to true, indicates that the user does not need to + // supply a value for this attribute, but may. + Optional bool + + // Computed, when set to true, indicates the the provider will supply a + // value for this field. If Optional and Required are false and + // Computed is true, the user will not be able to specify a value for + // this field without Terraform throwing an error. If Optional is true + // and Computed is true, the user can specify a value for this field, + // but the provider may supply a value if the user does not. It is + // always a violation of Terraform's protocol to substitute a value for + // what the user entered, even if Computed is true. + Computed bool + + // Sensitive, when set to true, indicates that the contents of this + // attribute should be considered sensitive and not included in output. + // This does not encrypt or otherwise protect these values in state, it + // only offers protection from them showing up in plans or other + // output. + Sensitive bool + + // DescriptionKind indicates the formatting and encoding that the + // Description field is using. + DescriptionKind StringKind + + // Deprecated, when set to true, indicates that a attribute should no + // longer be used and users should migrate away from it. At the moment + // it is unused and will have no impact, but it will be used in future + // tooling that is powered by provider schemas to enable richer user + // experiences. Providers should set it when deprecating attributes in + // preparation for these tools. + Deprecated bool +} + +// ValueType returns the tftypes.Type for a SchemaAttribute. +// +// If SchemaAttribute is missing, nil is returned. +func (s *SchemaAttribute) ValueType() tftypes.Type { + if s == nil { + return nil + } + + // It is not valid to set both NestedType and Type. + if s.NestedType != nil { + return s.NestedType.ValueType() + } + + return s.Type +} + +// SchemaNestedBlock is a nested block within another block. See SchemaBlock +// for more information on blocks. +type SchemaNestedBlock struct { + // TypeName is the name of the block. It is what the user will specify + // when using the block in configuration. + TypeName string + + // Block is the block being nested inside another block. See the + // SchemaBlock documentation for more information on blocks. + Block *SchemaBlock + + // Nesting is the kind of nesting the block is using. Different nesting + // modes have different behaviors and imply different kinds of data. + Nesting SchemaNestedBlockNestingMode + + // MinItems is the minimum number of instances of this block that a + // user must specify or Terraform will return an error. + // + // MinItems can only be set for SchemaNestedBlockNestingModeList and + // SchemaNestedBlockNestingModeSet. SchemaNestedBlockNestingModeSingle + // can also set MinItems and MaxItems both to 1 to indicate that the + // block is required to be set. All other SchemaNestedBlockNestingModes + // must leave MinItems set to 0. + MinItems int64 + + // MaxItems is the maximum number of instances of this block that a + // user may specify before Terraform returns an error. + // + // MaxItems can only be set for SchemaNestedBlockNestingModeList and + // SchemaNestedBlockNestingModeSet. SchemaNestedBlockNestingModeSingle + // can also set MinItems and MaxItems both to 1 to indicate that the + // block is required to be set. All other SchemaNestedBlockNestingModes + // must leave MaxItems set to 0. + MaxItems int64 +} + +// ValueType returns the tftypes.Type for a SchemaNestedBlock. +// +// If SchemaNestedBlock is missing or the Nesting mode is invalid, nil is +// returned. +func (s *SchemaNestedBlock) ValueType() tftypes.Type { + if s == nil { + return nil + } + + blockType := s.Block.ValueType() + + switch s.Nesting { + case SchemaNestedBlockNestingModeGroup: + return blockType + case SchemaNestedBlockNestingModeList: + return tftypes.List{ + ElementType: blockType, + } + case SchemaNestedBlockNestingModeMap: + return tftypes.Map{ + ElementType: blockType, + } + case SchemaNestedBlockNestingModeSet: + return tftypes.Set{ + ElementType: blockType, + } + case SchemaNestedBlockNestingModeSingle: + return blockType + default: + return nil + } +} + +// SchemaNestedBlockNestingMode indicates the nesting mode for +// SchemaNestedBlocks. The nesting mode determines the number of instances of +// the block allowed, how many labels the block expects, and the data structure +// used for the block in config and state values. +type SchemaNestedBlockNestingMode int32 + +func (s SchemaNestedBlockNestingMode) String() string { + switch s { + case 0: + return "INVALID" + case 1: + return "SINGLE" + case 2: + return "LIST" + case 3: + return "SET" + case 4: + return "MAP" + case 5: + return "GROUP" + } + return "UNKNOWN" +} + +// SchemaObject represents a nested-block-stype object in an Attribute. +type SchemaObject struct { + // Attributes are the attributes defined within the Object. + Attributes []*SchemaAttribute + + Nesting SchemaObjectNestingMode +} + +// ValueType returns the tftypes.Type for a SchemaObject. +// +// If SchemaObject is missing or the Nesting mode is invalid, nil is returned. +func (s *SchemaObject) ValueType() tftypes.Type { + if s == nil { + return nil + } + + attributeTypes := map[string]tftypes.Type{} + + for _, attribute := range s.Attributes { + if attribute == nil { + continue + } + + attributeType := attribute.ValueType() + + if attributeType == nil { + continue + } + + attributeTypes[attribute.Name] = attributeType + } + + objectType := tftypes.Object{ + AttributeTypes: attributeTypes, + } + + switch s.Nesting { + case SchemaObjectNestingModeList: + return tftypes.List{ + ElementType: objectType, + } + case SchemaObjectNestingModeMap: + return tftypes.Map{ + ElementType: objectType, + } + case SchemaObjectNestingModeSet: + return tftypes.Set{ + ElementType: objectType, + } + case SchemaObjectNestingModeSingle: + return objectType + default: + return nil + } +} + +// SchemaObjectNestingMode indicates the nesting mode for +// SchemaNestedBlocks. The nesting mode determines the number of instances of +// the nested type allowed and the data structure used for the block in config +// and state values. +type SchemaObjectNestingMode int32 + +func (s SchemaObjectNestingMode) String() string { + switch s { + case 0: + return "INVALID" + case 1: + return "SINGLE" + case 2: + return "LIST" + case 3: + return "SET" + case 4: + return "MAP" + } + return "UNKNOWN" +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/state.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/state.go new file mode 100644 index 000000000..3b5d9b11c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/state.go @@ -0,0 +1,79 @@ +package tfprotov6 + +import ( + "errors" + "fmt" + + "github.com/hashicorp/terraform-plugin-go/tftypes" +) + +// ErrUnknownRawStateType is returned when a RawState has no Flatmap or JSON +// bytes set. This should never be returned during the normal operation of a +// provider, and indicates one of the following: +// +// 1. terraform-plugin-go is out of sync with the protocol and should be +// updated. +// +// 2. terrafrom-plugin-go has a bug. +// +// 3. The `RawState` was generated or modified by something other than +// terraform-plugin-go and is no longer a valid value. +var ErrUnknownRawStateType = errors.New("RawState had no JSON or flatmap data set") + +// RawState is the raw, undecoded state for providers to upgrade. It is +// undecoded as Terraform, for whatever reason, doesn't have the previous +// schema available to it, and so cannot decode the state itself and pushes +// that responsibility off onto providers. +// +// It is safe to assume that Flatmap can be ignored for any state written by +// Terraform 0.12.0 or higher, but it is not safe to assume that all states +// written by 0.12.0 or higher will be in JSON format; future versions may +// switch to an alternate encoding for states. +type RawState struct { + JSON []byte + Flatmap map[string]string +} + +// Unmarshal returns a `tftypes.Value` that represents the information +// contained in the RawState in an easy-to-interact-with way. It is the +// main purpose of the RawState type, and is how provider developers should +// obtain state values from the UpgradeResourceState RPC call. +// +// Pass in the type you want the `Value` to be interpreted as. Terraform's type +// system encodes in a lossy manner, meaning the type information is not +// preserved losslessly when going over the wire. Sets, lists, and tuples all +// look the same. Objects and maps all look the same, as well, as do +// user-specified values when DynamicPseudoType is used in the schema. +// Fortunately, the provider should already know the type; it should be the +// type of the schema, or DynamicPseudoType if that's what's in the schema. +// `Unmarshal` will then parse the value as though it belongs to that type, if +// possible, and return a `tftypes.Value` with the appropriate information. If +// the data can't be interpreted as that type, an error will be returned saying +// so. In these cases, double check to make sure the schema is declaring the +// same type being passed into `Unmarshal`. +// +// In the event an ErrUnknownRawStateType is returned, one of three things +// has happened: +// +// 1. terraform-plugin-go is out of date and out of sync with the protocol, and +// an issue should be opened on its repo to get it updated. +// +// 2. terraform-plugin-go has a bug somewhere, and an issue should be opened on +// its repo to get it fixed. +// +// 3. The provider or a dependency has modified the `RawState` in an +// unsupported way, or has created one from scratch, and should treat it as +// opaque and not modify it, only calling `Unmarshal` on `RawState`s received +// from RPC requests. +// +// State files written before Terraform 0.12 that haven't been upgraded yet +// cannot be unmarshaled, and must have their Flatmap property read directly. +func (s RawState) Unmarshal(typ tftypes.Type) (tftypes.Value, error) { + if s.JSON != nil { + return tftypes.ValueFromJSON(s.JSON, typ) //nolint:staticcheck + } + if s.Flatmap != nil { + return tftypes.Value{}, fmt.Errorf("flatmap states cannot be unmarshaled, only states written by Terraform 0.12 and higher can be unmarshaled") + } + return tftypes.Value{}, ErrUnknownRawStateType +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/string_kind.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/string_kind.go new file mode 100644 index 000000000..359e036e7 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/string_kind.go @@ -0,0 +1,25 @@ +package tfprotov6 + +const ( + // StringKindPlain indicates a string is plaintext, and should be + // interpreted as having no formatting information. + StringKindPlain StringKind = 0 + + // StringKindMarkdown indicates a string is markdown-formatted, and + // should be rendered using a Markdown renderer to correctly display + // its formatting. + StringKindMarkdown StringKind = 1 +) + +// StringKind indicates a formatting or encoding scheme for a string. +type StringKind int32 + +func (s StringKind) String() string { + switch s { + case 0: + return "PLAIN" + case 1: + return "MARKDOWN" + } + return "UNKNOWN" +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/doc.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/doc.go new file mode 100644 index 000000000..8b5313d95 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/doc.go @@ -0,0 +1,6 @@ +// Package tf6server implements a server implementation to run +// tfprotov6.ProviderServers as gRPC servers. +// +// Providers will likely be calling tf6server.Serve from their main function to +// start the server so Terraform can connect to it. +package tf6server diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/plugin.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/plugin.go new file mode 100644 index 000000000..e868d30a5 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/plugin.go @@ -0,0 +1,47 @@ +package tf6server + +import ( + "context" + "errors" + "net/rpc" + + "github.com/hashicorp/go-plugin" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "google.golang.org/grpc" +) + +// GRPCProviderPlugin is an implementation of the +// github.com/hashicorp/go-plugin#Plugin and +// github.com/hashicorp/go-plugin#GRPCPlugin interfaces, indicating how to +// serve tfprotov6.ProviderServers as gRPC plugins for go-plugin. +type GRPCProviderPlugin struct { + GRPCProvider func() tfprotov6.ProviderServer + Opts []ServeOpt + Name string +} + +// Server always returns an error; we're only implementing the GRPCPlugin +// interface, not the Plugin interface. +func (p *GRPCProviderPlugin) Server(*plugin.MuxBroker) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// Client always returns an error; we're only implementing the GRPCPlugin +// interface, not the Plugin interface. +func (p *GRPCProviderPlugin) Client(*plugin.MuxBroker, *rpc.Client) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// GRPCClient always returns an error; we're only implementing the server half +// of the interface. +func (p *GRPCProviderPlugin) GRPCClient(context.Context, *plugin.GRPCBroker, *grpc.ClientConn) (interface{}, error) { + return nil, errors.New("terraform-plugin-go only implements gRPC servers") +} + +// GRPCServer registers the gRPC provider server with the gRPC server that +// go-plugin is standing up. +func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { + tfplugin6.RegisterProviderServer(s, New(p.Name, p.GRPCProvider(), p.Opts...)) + return nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/server.go b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/server.go new file mode 100644 index 000000000..4ed9ece60 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server/server.go @@ -0,0 +1,854 @@ +package tf6server + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "os" + "os/signal" + "regexp" + "runtime" + "strings" + "sync" + "time" + + "github.com/hashicorp/terraform-plugin-go/internal/logging" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto" + "google.golang.org/grpc" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/go-plugin" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-log/tfsdklog" + testing "github.com/mitchellh/go-testing-interface" +) + +const ( + // protocolVersionMajor represents the major version number of the protocol + // being served. This is used during the plugin handshake to validate the + // server and client are compatible. + // + // In the future, it may be possible to include this information directly + // in the protocol buffers rather than recreating a constant here. + protocolVersionMajor uint = 6 + + // protocolVersionMinor represents the minor version number of the protocol + // being served. Backwards compatible additions are possible in the + // protocol definitions, which is when this may be increased. While it is + // not used in plugin negotiation, it can be helpful to include this value + // for debugging, such as in logs. + // + // In the future, it may be possible to include this information directly + // in the protocol buffers rather than recreating a constant here. + protocolVersionMinor uint = 0 +) + +// protocolVersion represents the combined major and minor version numbers of +// the protocol being served. +var protocolVersion string = fmt.Sprintf("%d.%d", protocolVersionMajor, protocolVersionMinor) + +const ( + // envTfReattachProviders is the environment variable used by Terraform CLI + // to directly connect to already running provider processes, such as those + // being inspected by debugging processes. When connecting to providers in + // this manner, Terraform CLI disables certain plugin handshake checks and + // will not stop the provider process. + envTfReattachProviders = "TF_REATTACH_PROVIDERS" +) + +const ( + // grpcMaxMessageSize is the maximum gRPC send and receive message sizes + // for the server. + // + // This 256MB value is arbitrarily raised from the default message sizes of + // 4MB to account for advanced use cases, but arbitrarily lowered from + // MaxInt32 (or similar) to prevent incorrect server implementations from + // exhausting resources in common execution environments. Receiving a gRPC + // message size error is preferable for troubleshooting over determining + // why an execution environment may have terminated the process via its + // memory management processes, such as oom-killer on Linux. + // + // This value is kept as constant over allowing server configurability + // since there are many factors that influence message size, such as + // Terraform configuration and state data. If larger message size use + // cases appear, other gRPC options should be explored, such as + // implementing streaming RPCs and messages. + grpcMaxMessageSize = 256 << 20 +) + +// ServeOpt is an interface for defining options that can be passed to the +// Serve function. Each implementation modifies the ServeConfig being +// generated. A slice of ServeOpts then, cumulatively applied, render a full +// ServeConfig. +type ServeOpt interface { + ApplyServeOpt(*ServeConfig) error +} + +// ServeConfig contains the configured options for how a provider should be +// served. +type ServeConfig struct { + logger hclog.Logger + debugCtx context.Context + debugCh chan *plugin.ReattachConfig + debugCloseCh chan struct{} + + managedDebug bool + managedDebugReattachConfigTimeout time.Duration + managedDebugStopSignals []os.Signal + + disableLogInitStderr bool + disableLogLocation bool + useLoggingSink testing.T + envVar string +} + +type serveConfigFunc func(*ServeConfig) error + +func (s serveConfigFunc) ApplyServeOpt(in *ServeConfig) error { + return s(in) +} + +// WithDebug returns a ServeOpt that will set the server into debug mode, using +// the passed options to populate the go-plugin ServeTestConfig. +// +// This is an advanced ServeOpt that assumes the caller will fully manage the +// reattach configuration and server lifecycle. Refer to WithManagedDebug for a +// ServeOpt that handles common use cases, such as implementing provider main +// functions. +func WithDebug(ctx context.Context, config chan *plugin.ReattachConfig, closeCh chan struct{}) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if in.managedDebug { + return errors.New("cannot set both WithDebug and WithManagedDebug") + } + + in.debugCtx = ctx + in.debugCh = config + in.debugCloseCh = closeCh + return nil + }) +} + +// WithManagedDebug returns a ServeOpt that will start the server in debug +// mode, managing the reattach configuration handling and server lifecycle. +// Reattach configuration is output to stdout with human friendly instructions. +// By default, the server can be stopped with os.Interrupt (SIGINT; ctrl-c). +// +// Refer to the optional WithManagedDebugStopSignals and +// WithManagedDebugReattachConfigTimeout ServeOpt for additional configuration. +// +// The reattach configuration output of this handling is not protected by +// compatibility guarantees. Use the WithDebug ServeOpt for advanced use cases. +func WithManagedDebug() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if in.debugCh != nil { + return errors.New("cannot set both WithDebug and WithManagedDebug") + } + + in.managedDebug = true + return nil + }) +} + +// WithManagedDebugStopSignals returns a ServeOpt that will set the stop signals for a +// debug managed process (WithManagedDebug). When not configured, os.Interrupt +// (SIGINT; Ctrl-c) will stop the process. +func WithManagedDebugStopSignals(signals []os.Signal) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.managedDebugStopSignals = signals + return nil + }) +} + +// WithManagedDebugReattachConfigTimeout returns a ServeOpt that will set the timeout +// for a debug managed process to start and return its reattach configuration. +// When not configured, 2 seconds is the default. +func WithManagedDebugReattachConfigTimeout(timeout time.Duration) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.managedDebugReattachConfigTimeout = timeout + return nil + }) +} + +// WithGoPluginLogger returns a ServeOpt that will set the logger that +// go-plugin should use to log messages. +func WithGoPluginLogger(logger hclog.Logger) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.logger = logger + return nil + }) +} + +// WithLoggingSink returns a ServeOpt that will enable the logging sink, which +// is used in test frameworks to control where terraform-plugin-log output is +// written and at what levels, mimicking Terraform's logging sink behaviors. +func WithLoggingSink(t testing.T) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.useLoggingSink = t + return nil + }) +} + +// WithoutLogStderrOverride returns a ServeOpt that will disable the +// terraform-plugin-log behavior of logging to the stderr that existed at +// startup, not the stderr that exists when the logging statement is called. +func WithoutLogStderrOverride() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogInitStderr = true + return nil + }) +} + +// WithoutLogLocation returns a ServeOpt that will exclude file names and line +// numbers from log output for the terraform-plugin-log logs generated by the +// SDKs and provider. +func WithoutLogLocation() ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + in.disableLogLocation = true + return nil + }) +} + +// WithLogEnvVarName sets the name of the provider for the purposes of the +// logging environment variable that controls the provider's log level. It is +// the part following TF_LOG_PROVIDER_ and defaults to the name part of the +// provider's registry address, or disabled if it can't parse the provider's +// registry address. Name must only contain letters, numbers, and hyphens. +func WithLogEnvVarName(name string) ServeOpt { + return serveConfigFunc(func(in *ServeConfig) error { + if !regexp.MustCompile(`^[a-zA-Z0-9-]+$`).MatchString(name) { + return errors.New("environment variable names can only contain a-z, A-Z, 0-9, and -") + } + in.envVar = name + return nil + }) +} + +// Serve starts a tfprotov6.ProviderServer serving, ready for Terraform to +// connect to it. The name passed in should be the fully qualified name that +// users will enter in the source field of the required_providers block, like +// "registry.terraform.io/hashicorp/time". +// +// Zero or more options to configure the server may also be passed. The default +// invocation is sufficient, but if the provider wants to run in debug mode or +// modify the logger that go-plugin is using, ServeOpts can be specified to +// support that. +func Serve(name string, serverFactory func() tfprotov6.ProviderServer, opts ...ServeOpt) error { + // Defaults + conf := ServeConfig{ + managedDebugReattachConfigTimeout: 2 * time.Second, + managedDebugStopSignals: []os.Signal{os.Interrupt}, + } + + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + return err + } + } + + serveConfig := &plugin.ServeConfig{ + HandshakeConfig: plugin.HandshakeConfig{ + ProtocolVersion: protocolVersionMajor, + MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", + MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", + }, + Plugins: plugin.PluginSet{ + "provider": &GRPCProviderPlugin{ + GRPCProvider: serverFactory, + Opts: opts, + Name: name, + }, + }, + GRPCServer: func(opts []grpc.ServerOption) *grpc.Server { + opts = append(opts, grpc.MaxRecvMsgSize(grpcMaxMessageSize)) + opts = append(opts, grpc.MaxSendMsgSize(grpcMaxMessageSize)) + + return grpc.NewServer(opts...) + }, + } + + if conf.logger != nil { + serveConfig.Logger = conf.logger + } + + if conf.managedDebug { + ctx, cancel := context.WithCancel(context.Background()) + signalCh := make(chan os.Signal, len(conf.managedDebugStopSignals)) + + signal.Notify(signalCh, conf.managedDebugStopSignals...) + + defer func() { + signal.Stop(signalCh) + cancel() + }() + + go func() { + select { + case <-signalCh: + cancel() + case <-ctx.Done(): + } + }() + + conf.debugCh = make(chan *plugin.ReattachConfig) + conf.debugCloseCh = make(chan struct{}) + conf.debugCtx = ctx + } + + if conf.debugCh != nil { + serveConfig.Test = &plugin.ServeTestConfig{ + Context: conf.debugCtx, + ReattachConfigCh: conf.debugCh, + CloseCh: conf.debugCloseCh, + } + } + + if !conf.managedDebug { + plugin.Serve(serveConfig) + return nil + } + + go plugin.Serve(serveConfig) + + var pluginReattachConfig *plugin.ReattachConfig + + select { + case pluginReattachConfig = <-conf.debugCh: + case <-time.After(conf.managedDebugReattachConfigTimeout): + return errors.New("timeout waiting on reattach configuration") + } + + if pluginReattachConfig == nil { + return errors.New("nil reattach configuration received") + } + + // Duplicate implementation is required because the go-plugin + // ReattachConfig.Addr implementation is not friendly for JSON encoding + // and to avoid importing terraform-exec. + type reattachConfigAddr struct { + Network string + String string + } + + type reattachConfig struct { + Protocol string + ProtocolVersion int + Pid int + Test bool + Addr reattachConfigAddr + } + + reattachBytes, err := json.Marshal(map[string]reattachConfig{ + name: { + Protocol: string(pluginReattachConfig.Protocol), + ProtocolVersion: pluginReattachConfig.ProtocolVersion, + Pid: pluginReattachConfig.Pid, + Test: pluginReattachConfig.Test, + Addr: reattachConfigAddr{ + Network: pluginReattachConfig.Addr.Network(), + String: pluginReattachConfig.Addr.String(), + }, + }, + }) + + if err != nil { + return fmt.Errorf("Error building reattach string: %w", err) + } + + reattachStr := string(reattachBytes) + + // This is currently intended to be executed via provider main function and + // human friendly, so output directly to stdout. + fmt.Printf("Provider started. To attach Terraform CLI, set the %s environment variable with the following:\n\n", envTfReattachProviders) + + switch runtime.GOOS { + case "windows": + fmt.Printf("\tCommand Prompt:\tset \"%s=%s\"\n", envTfReattachProviders, reattachStr) + fmt.Printf("\tPowerShell:\t$env:%s='%s'\n", envTfReattachProviders, strings.ReplaceAll(reattachStr, `'`, `''`)) + default: + fmt.Printf("\t%s='%s'\n", envTfReattachProviders, strings.ReplaceAll(reattachStr, `'`, `'"'"'`)) + } + + fmt.Println("") + + // Wait for the server to be done. + <-conf.debugCloseCh + + return nil +} + +type server struct { + downstream tfprotov6.ProviderServer + tfplugin6.UnimplementedProviderServer + + stopMu sync.Mutex + stopCh chan struct{} + + tflogSDKOpts tfsdklog.Options + tflogOpts tflog.Options + useTFLogSink bool + testHandle testing.T + name string + + // protocolDataDir is a directory to store raw protocol data files for + // debugging purposes. + protocolDataDir string + + // protocolVersion is the protocol version for the server. + protocolVersion string +} + +func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struct{}) { + select { + case <-ctx.Done(): + return + case <-stopCh: + cancel() + } +} + +// stoppableContext returns a context that wraps `ctx` but will be canceled +// when the server's stopCh is closed. +// +// This is used to cancel all in-flight contexts when the Stop method of the +// server is called. +func (s *server) stoppableContext(ctx context.Context) context.Context { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + stoppable, cancel := context.WithCancel(ctx) + go mergeStop(stoppable, cancel, s.stopCh) + return stoppable +} + +// loggingContext returns a context that wraps `ctx` and has +// terraform-plugin-log loggers injected. +func (s *server) loggingContext(ctx context.Context) context.Context { + if s.useTFLogSink { + ctx = tfsdklog.RegisterTestSink(ctx, s.testHandle) + } + + ctx = logging.InitContext(ctx, s.tflogSDKOpts, s.tflogOpts) + ctx = logging.RequestIdContext(ctx) + ctx = logging.ProviderAddressContext(ctx, s.name) + ctx = logging.ProtocolVersionContext(ctx, s.protocolVersion) + + return ctx +} + +// New converts a tfprotov6.ProviderServer into a server capable of handling +// Terraform protocol requests and issuing responses using the gRPC types. +func New(name string, serve tfprotov6.ProviderServer, opts ...ServeOpt) tfplugin6.ProviderServer { + var conf ServeConfig + for _, opt := range opts { + err := opt.ApplyServeOpt(&conf) + if err != nil { + // this should never happen, we already executed all + // this code as part of Serve + panic(err) + } + } + var sdkOptions tfsdklog.Options + var options tflog.Options + if !conf.disableLogInitStderr { + sdkOptions = append(sdkOptions, tfsdklog.WithStderrFromInit()) + options = append(options, tfsdklog.WithStderrFromInit()) + } + if conf.disableLogLocation { + sdkOptions = append(sdkOptions, tfsdklog.WithoutLocation()) + options = append(options, tflog.WithoutLocation()) + } + envVar := conf.envVar + if envVar == "" { + envVar = logging.ProviderLoggerName(name) + } + if envVar != "" { + options = append(options, tfsdklog.WithLogName(envVar), tflog.WithLevelFromEnv(logging.EnvTfLogProvider, envVar)) + } + return &server{ + downstream: serve, + stopCh: make(chan struct{}), + tflogOpts: options, + tflogSDKOpts: sdkOptions, + name: name, + useTFLogSink: conf.useLoggingSink != nil, + testHandle: conf.useLoggingSink, + protocolDataDir: os.Getenv(logging.EnvTfLogSdkProtoDataDir), + protocolVersion: protocolVersion, + } +} + +func (s *server) GetProviderSchema(ctx context.Context, req *tfplugin6.GetProviderSchema_Request) (*tfplugin6.GetProviderSchema_Response, error) { + rpc := "GetProviderSchema" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.GetProviderSchemaRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.GetProviderSchema(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.GetProviderSchema_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ConfigureProvider(ctx context.Context, req *tfplugin6.ConfigureProvider_Request) (*tfplugin6.ConfigureProvider_Response, error) { + rpc := "ConfigureProvider" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ConfigureProviderRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ConfigureProvider(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.Configure_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateProviderConfig(ctx context.Context, req *tfplugin6.ValidateProviderConfig_Request) (*tfplugin6.ValidateProviderConfig_Response, error) { + rpc := "ValidateProviderConfig" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ValidateProviderConfigRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ValidateProviderConfig(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.ValidateProviderConfig_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +// stop closes the stopCh associated with the server and replaces it with a new +// one. +// +// This causes all in-flight requests for the server to have their contexts +// canceled. +func (s *server) stop() { + s.stopMu.Lock() + defer s.stopMu.Unlock() + + close(s.stopCh) + s.stopCh = make(chan struct{}) +} + +func (s *server) Stop(ctx context.Context, req *tfplugin6.StopProvider_Request) (*tfplugin6.StopProvider_Response, error) { + rpc := "StopProvider" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.StopProviderRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.StopProvider(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolTrace(ctx, "Closing all our contexts") + s.stop() + logging.ProtocolTrace(ctx, "Closed all our contexts") + ret, err := toproto.Stop_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateDataResourceConfig(ctx context.Context, req *tfplugin6.ValidateDataResourceConfig_Request) (*tfplugin6.ValidateDataResourceConfig_Response, error) { + rpc := "ValidateDataResourceConfig" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.DataSourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ValidateDataResourceConfigRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ValidateDataResourceConfig(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.ValidateDataResourceConfig_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ReadDataSource(ctx context.Context, req *tfplugin6.ReadDataSource_Request) (*tfplugin6.ReadDataSource_Response, error) { + rpc := "ReadDataSource" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.DataSourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ReadDataSourceRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProviderMeta", r.ProviderMeta) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ReadDataSource(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "State", resp.State) + ret, err := toproto.ReadDataSource_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ValidateResourceConfig(ctx context.Context, req *tfplugin6.ValidateResourceConfig_Request) (*tfplugin6.ValidateResourceConfig_Response, error) { + rpc := "ValidateResourceConfig" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ValidateResourceConfigRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ValidateResourceConfig(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + ret, err := toproto.ValidateResourceConfig_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) UpgradeResourceState(ctx context.Context, req *tfplugin6.UpgradeResourceState_Request) (*tfplugin6.UpgradeResourceState_Response, error) { + rpc := "UpgradeResourceState" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.UpgradeResourceStateRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.UpgradeResourceState(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "UpgradedState", resp.UpgradedState) + ret, err := toproto.UpgradeResourceState_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ReadResource(ctx context.Context, req *tfplugin6.ReadResource_Request) (*tfplugin6.ReadResource_Response, error) { + rpc := "ReadResource" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ReadResourceRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "CurrentState", r.CurrentState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProviderMeta", r.ProviderMeta) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ReadResource(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "NewState", resp.NewState) + ret, err := toproto.ReadResource_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) PlanResourceChange(ctx context.Context, req *tfplugin6.PlanResourceChange_Request) (*tfplugin6.PlanResourceChange_Response, error) { + rpc := "PlanResourceChange" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.PlanResourceChangeRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "PriorState", r.PriorState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProposedNewState", r.ProposedNewState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "ProviderMeta", r.ProviderMeta) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.PlanResourceChange(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "PlannedState", resp.PlannedState) + ret, err := toproto.PlanResourceChange_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ApplyResourceChange(ctx context.Context, req *tfplugin6.ApplyResourceChange_Request) (*tfplugin6.ApplyResourceChange_Response, error) { + rpc := "ApplyResourceChange" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ApplyResourceChangeRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "PlannedState", r.PlannedState) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Request", "Config", r.Config) + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ApplyResourceChange(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response", "NewState", resp.NewState) + ret, err := toproto.ApplyResourceChange_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} + +func (s *server) ImportResourceState(ctx context.Context, req *tfplugin6.ImportResourceState_Request) (*tfplugin6.ImportResourceState_Response, error) { + rpc := "ImportResourceState" + ctx = s.loggingContext(ctx) + ctx = logging.RpcContext(ctx, rpc) + ctx = logging.ResourceContext(ctx, req.TypeName) + ctx = s.stoppableContext(ctx) + logging.ProtocolTrace(ctx, "Received request") + defer logging.ProtocolTrace(ctx, "Served request") + r, err := fromproto.ImportResourceStateRequest(req) + if err != nil { + logging.ProtocolError(ctx, "Error converting request from protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Calling downstream") + resp, err := s.downstream.ImportResourceState(ctx, r) + if err != nil { + logging.ProtocolError(ctx, "Error from downstream", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + logging.ProtocolTrace(ctx, "Called downstream") + for _, importedResource := range resp.ImportedResources { + logging.ProtocolData(ctx, s.protocolDataDir, rpc, "Response_ImportedResource", "State", importedResource.State) + } + ret, err := toproto.ImportResourceState_Response(resp) + if err != nil { + logging.ProtocolError(ctx, "Error converting response to protobuf", map[string]interface{}{logging.KeyError: err}) + return nil, err + } + return ret, nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/attribute_path.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path.go similarity index 52% rename from vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/attribute_path.go rename to vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path.go index 90fb9c32b..d6108d4ab 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/attribute_path.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path.go @@ -3,6 +3,8 @@ package tftypes import ( "errors" "fmt" + "strconv" + "strings" ) var ( @@ -23,55 +25,156 @@ var ( type AttributePath struct { // Steps are the steps that must be followed from the root of the value // to obtain the value being indicated. - Steps []AttributePathStep + steps []AttributePathStep +} + +// NewAttributePath returns an empty AttributePath, ready to have steps added +// to it using WithElementKeyString, WithElementKeyInt, WithElementKeyValue, or +// WithAttributeName. +func NewAttributePath() *AttributePath { + return &AttributePath{} +} + +// NewAttributePathWithSteps returns an AttributePath populated with the passed +// AttributePathSteps. +func NewAttributePathWithSteps(steps []AttributePathStep) *AttributePath { + return &AttributePath{ + steps: steps, + } +} + +// Steps returns the AttributePathSteps that make up an AttributePath. +func (a *AttributePath) Steps() []AttributePathStep { + if a == nil { + return nil + } + steps := make([]AttributePathStep, len(a.steps)) + copy(steps, a.steps) + return steps +} + +func (a *AttributePath) String() string { + var res strings.Builder + for pos, step := range a.Steps() { + if pos != 0 { + res.WriteString(".") + } + switch v := step.(type) { + case AttributeName: + res.WriteString(`AttributeName("` + string(v) + `")`) + case ElementKeyString: + res.WriteString(`ElementKeyString("` + string(v) + `")`) + case ElementKeyInt: + res.WriteString(`ElementKeyInt(` + strconv.FormatInt(int64(v), 10) + `)`) + case ElementKeyValue: + res.WriteString(`ElementKeyValue(` + Value(v).String() + `)`) + } + } + return res.String() +} + +// Equal returns true if two AttributePaths should be considered equal. +// AttributePaths are considered equal if they have the same number of steps, +// the steps are all the same types, and the steps have all the same values. +func (a *AttributePath) Equal(o *AttributePath) bool { + if len(a.Steps()) == 0 && len(o.Steps()) == 0 { + return true + } + if len(a.Steps()) != len(o.Steps()) { + return false + } + for pos, aStep := range a.Steps() { + oStep := o.Steps()[pos] + + if !aStep.Equal(oStep) { + return false + } + } + return true } // NewErrorf returns an error associated with the value indicated by `a`. This // is equivalent to calling a.NewError(fmt.Errorf(f, args...)). -func (a AttributePath) NewErrorf(f string, args ...interface{}) error { - return attributePathError{ - error: fmt.Errorf(f, args...), - path: a, - } +func (a *AttributePath) NewErrorf(f string, args ...interface{}) error { + return a.NewError(fmt.Errorf(f, args...)) } // NewError returns an error that associates `err` with the value indicated by // `a`. -func (a AttributePath) NewError(err error) error { - return attributePathError{ - error: err, - path: a, +func (a *AttributePath) NewError(err error) error { + var wrapped AttributePathError + if errors.As(err, &wrapped) { + // TODO: at some point we'll probably want to handle the + // AttributePathError-within-AttributePathError situation, + // either by de-duplicating the paths we're surfacing, or + // privileging one, or something. For now, let's just do the + // naive thing and not add our own path. + return err + } + return AttributePathError{ + Path: a, + err: err, } } +// LastStep returns the last step in the path. If the path was +// empty, nil is returned. +func (a *AttributePath) LastStep() AttributePathStep { + steps := a.Steps() + + if len(steps) == 0 { + return nil + } + + return steps[len(steps)-1] +} + // WithAttributeName adds an AttributeName step to `a`, using `name` as the -// attribute's name. -func (a *AttributePath) WithAttributeName(name string) { - a.Steps = append(a.Steps, AttributeName(name)) +// attribute's name. `a` is copied, not modified. +func (a *AttributePath) WithAttributeName(name string) *AttributePath { + steps := a.Steps() + return &AttributePath{ + steps: append(steps, AttributeName(name)), + } } // WithElementKeyString adds an ElementKeyString step to `a`, using `key` as -// the element's key. -func (a *AttributePath) WithElementKeyString(key string) { - a.Steps = append(a.Steps, ElementKeyString(key)) +// the element's key. `a` is copied, not modified. +func (a *AttributePath) WithElementKeyString(key string) *AttributePath { + steps := a.Steps() + return &AttributePath{ + steps: append(steps, ElementKeyString(key)), + } } // WithElementKeyInt adds an ElementKeyInt step to `a`, using `key` as the -// element's key. -func (a *AttributePath) WithElementKeyInt(key int64) { - a.Steps = append(a.Steps, ElementKeyInt(key)) +// element's key. `a` is copied, not modified. +func (a *AttributePath) WithElementKeyInt(key int) *AttributePath { + steps := a.Steps() + return &AttributePath{ + steps: append(steps, ElementKeyInt(key)), + } } // WithElementKeyValue adds an ElementKeyValue to `a`, using `key` as the -// element's key. -func (a *AttributePath) WithElementKeyValue(key Value) { - a.Steps = append(a.Steps, ElementKeyValue(key)) +// element's key. `a` is copied, not modified. +func (a *AttributePath) WithElementKeyValue(key Value) *AttributePath { + steps := a.Steps() + return &AttributePath{ + steps: append(steps, ElementKeyValue(key.Copy())), + } } // WithoutLastStep removes the last step, whatever kind of step it was, from -// `a`. -func (a *AttributePath) WithoutLastStep() { - a.Steps = a.Steps[:len(a.Steps)-1] +// `a`. `a` is copied, not modified. +func (a *AttributePath) WithoutLastStep() *AttributePath { + steps := a.Steps() + if len(steps) == 0 { + return nil + } + return &AttributePath{ + steps: steps[:len(steps)-1], + } } // AttributePathStep is an intentionally unimplementable interface that @@ -82,6 +185,9 @@ func (a *AttributePath) WithoutLastStep() { // indicating a specific attribute or element that is the next value in the // path. type AttributePathStep interface { + // Equal returns true if the AttributePathStep is equal to the other. + Equal(AttributePathStep) bool + unfulfillable() // make this interface fillable only by this package } @@ -96,6 +202,18 @@ var ( // AttributeName is the name of the attribute to be selected. type AttributeName string +// Equal returns true if the other AttributePathStep is an AttributeName and +// has the same value. +func (a AttributeName) Equal(other AttributePathStep) bool { + otherA, ok := other.(AttributeName) + + if !ok { + return false + } + + return string(a) == string(otherA) +} + func (a AttributeName) unfulfillable() {} // ElementKeyString is an AttributePathStep implementation that indicates the @@ -103,6 +221,18 @@ func (a AttributeName) unfulfillable() {} // The value of the ElementKeyString is the key of the element to select. type ElementKeyString string +// Equal returns true if the other AttributePathStep is an ElementKeyString and +// has the same value. +func (e ElementKeyString) Equal(other AttributePathStep) bool { + otherE, ok := other.(ElementKeyString) + + if !ok { + return false + } + + return string(e) == string(otherE) +} + func (e ElementKeyString) unfulfillable() {} // ElementKeyInt is an AttributePathStep implementation that indicates the next @@ -110,6 +240,18 @@ func (e ElementKeyString) unfulfillable() {} // value of the ElementKeyInt is the key of the element to select. type ElementKeyInt int64 +// Equal returns true if the other AttributePathStep is an ElementKeyInt and +// has the same value. +func (e ElementKeyInt) Equal(other AttributePathStep) bool { + otherE, ok := other.(ElementKeyInt) + + if !ok { + return false + } + + return int(e) == int(otherE) +} + func (e ElementKeyInt) unfulfillable() {} // ElementKeyValue is an AttributePathStep implementation that indicates the @@ -118,6 +260,18 @@ func (e ElementKeyInt) unfulfillable() {} // to select. type ElementKeyValue Value +// Equal returns true if the other AttributePathStep is an ElementKeyValue and +// has the same value. +func (e ElementKeyValue) Equal(other AttributePathStep) bool { + otherE, ok := other.(ElementKeyValue) + + if !ok { + return false + } + + return Value(e).Equal(Value(otherE)) +} + func (e ElementKeyValue) unfulfillable() {} // AttributePathStepper is an interface that types can implement to make them @@ -130,16 +284,16 @@ type AttributePathStepper interface { ApplyTerraform5AttributePathStep(AttributePathStep) (interface{}, error) } -// WalkAttributePath will return the value that `path` is pointing to, using -// `in` as the root. If an error is returned, the AttributePath returned will -// indicate the steps that remained to be applied when the error was +// WalkAttributePath will return the Type or Value that `path` is pointing to, +// using `in` as the root. If an error is returned, the AttributePath returned +// will indicate the steps that remained to be applied when the error was // encountered. // // map[string]interface{} and []interface{} types have built-in support. Other // types need to use the AttributePathStepper interface to tell // WalkAttributePath how to traverse themselves. -func WalkAttributePath(in interface{}, path AttributePath) (interface{}, AttributePath, error) { - if len(path.Steps) < 1 { +func WalkAttributePath(in interface{}, path *AttributePath) (interface{}, *AttributePath, error) { + if len(path.Steps()) < 1 { return in, path, nil } stepper, ok := in.(AttributePathStepper) @@ -149,12 +303,11 @@ func WalkAttributePath(in interface{}, path AttributePath) (interface{}, Attribu return in, path, ErrNotAttributePathStepper } } - next, err := stepper.ApplyTerraform5AttributePathStep(path.Steps[0]) + next, err := stepper.ApplyTerraform5AttributePathStep(path.Steps()[0]) if err != nil { return in, path, err } - path.Steps = path.Steps[1:] - return WalkAttributePath(next, path) + return WalkAttributePath(next, &AttributePath{steps: path.Steps()[1:]}) } func builtinAttributePathStepper(in interface{}) (AttributePathStepper, bool) { @@ -197,6 +350,9 @@ func (i interfaceSliceAttributePathStepper) ApplyTerraform5AttributePathStep(ste if !isElementKeyInt { return nil, ErrInvalidStep } + if eki < 0 { + return nil, ErrInvalidStep + } // slices can only have items up to the max value of int // but we get ElementKeyInt as an int64 // we keep ElementKeyInt as an int64 and cast the length of the slice diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go new file mode 100644 index 000000000..be0002072 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go @@ -0,0 +1,43 @@ +package tftypes + +import ( + "fmt" +) + +// AttributePathError represents an error associated with part of a +// tftypes.Value, indicated by the Path property. +type AttributePathError struct { + Path *AttributePath + err error +} + +// Equal returns true if two AttributePathErrors are semantically equal. To be +// considered equal, they must have the same path and if errors are set, the +// strings returned by their `Error()` methods must match. +func (a AttributePathError) Equal(o AttributePathError) bool { + if !a.Path.Equal(o.Path) { + return false + } + + if (a.err == nil && o.err != nil) || (a.err != nil && o.err == nil) { + return false + } + + if a.err == nil { + return true + } + + return a.err.Error() == o.err.Error() +} + +func (a AttributePathError) Error() string { + var path string + if len(a.Path.Steps()) > 0 { + path = a.Path.String() + ": " + } + return fmt.Sprintf("%s%s", path, a.err) +} + +func (a AttributePathError) Unwrap() error { + return a.err +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go new file mode 100644 index 000000000..328b1adf6 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/diff.go @@ -0,0 +1,293 @@ +package tftypes + +import ( + "errors" + "fmt" + "math/big" +) + +// ValueDiff expresses a subset of a Value that is different between two +// Values. The Path property indicates where the subset is located within the +// Value, and Value1 and Value2 indicate what the subset is in each of the +// Values. If the Value does not contain a subset at that AttributePath, its +// Value will be nil. This is distinct from a Value with a nil in it (a "null" +// value), which is present in the Value. +type ValueDiff struct { + // The Path these different subsets are located at in the original + // Values. + Path *AttributePath + + // The subset of the first Value passed to Diff found at the + // AttributePath indicated by Path. + Value1 *Value + + // The subset of the second Value passed to Diff found at the + // AttributePath indicated by Path. + Value2 *Value +} + +func (v ValueDiff) String() string { + val1 := "{no value set}" + if v.Value1 != nil { + val1 = v.Value1.String() + } + val2 := "{no value set}" + if v.Value2 != nil { + val2 = v.Value2.String() + } + return fmt.Sprintf("%s: value1: %s, value2: %s", + v.Path.String(), val1, val2) +} + +// Equal returns whether two ValueDiffs should be considered equal or not. +// ValueDiffs are consisdered equal when their Path, Value1, and Value2 +// properties are considered equal. +func (v ValueDiff) Equal(o ValueDiff) bool { + if !v.Path.Equal(o.Path) { + return false + } + if v.Value1 == nil && o.Value1 != nil { + return false + } + if v.Value1 != nil && o.Value1 == nil { + return false + } + if v.Value1 != nil && o.Value1 != nil && !v.Value1.Equal(*o.Value1) { + return false + } + if v.Value2 == nil && o.Value2 != nil { + return false + } + if v.Value2 != nil && o.Value2 == nil { + return false + } + if v.Value2 != nil && o.Value2 != nil && !v.Value2.Equal(*o.Value2) { + return false + } + return true +} + +// Diff computes the differences between `val1` and `val2` and surfaces them as +// a slice of ValueDiffs. The ValueDiffs in the struct will use `val1`'s values +// as Value1 and `val2`'s values as Value2. An empty or nil slice means the two +// Values can be considered equal. Values must be the same type when passed to +// Diff; passing in Values of two different types will result in an error. If +// both Values are empty, they are considered equal. If one Value is missing +// type, it will result in an error. val1.Type().Is(val2.Type()) is a safe way +// to check that Values can be compared with Diff. +func (val1 Value) Diff(val2 Value) ([]ValueDiff, error) { + var diffs []ValueDiff + + if val1.Type() == nil && val2.Type() == nil && val1.value == nil && val2.value == nil { + return diffs, nil + } + if (val1.Type() == nil && val2.Type() != nil) || (val1.Type() != nil && val2.Type() == nil) { + return nil, errors.New("cannot diff value missing type") + } + if !val1.Type().Is(val2.Type()) { + return nil, errors.New("Can't diff values of different types") + } + + // make sure everything in val2 is also in val1 + err := Walk(val2, func(path *AttributePath, value2 Value) (bool, error) { + _, _, err := WalkAttributePath(val1, path) + if err != nil && err != ErrInvalidStep { + return false, fmt.Errorf("Error walking %q: %w", path, err) + } else if err == ErrInvalidStep { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: nil, + Value2: &value2, + }) + return false, nil + } + return true, nil + }) + if err != nil { + return nil, err + } + + // make sure everything in val1 is also in val2 and also that it all matches + err = Walk(val1, func(path *AttributePath, value1 Value) (bool, error) { + // pull out the Value at the same path in val2 + value2I, _, err := WalkAttributePath(val2, path) + if err != nil && err != ErrInvalidStep { + return false, fmt.Errorf("Error walking %q: %w", path, err) + } else if err == ErrInvalidStep { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: nil, + }) + return true, nil + } + + // convert from an interface{} to a Value + value2 := value2I.(Value) + + // if they're both unknown, no need to continue + if !value1.IsKnown() && !value2.IsKnown() { + return false, nil + } + + // if val1 is unknown and val2 not, we have a diff + // no need to continue to recurse into val1, no further to go + if !value1.IsKnown() && value2.IsKnown() { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + return false, nil + } + + // if val2 is unknown and val1 not, we have a diff + // continue to recurse though, so we can surface the elements of val1 + // that are now "missing" as diffs + if value1.IsKnown() && !value2.IsKnown() { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + return true, nil + } + + // if they're both null, no need to continue + if value1.IsNull() && value2.IsNull() { + return false, nil + } + + // if val1 is null and val2 not, we have a diff + // no need to continue to recurse into val1, no further to go + if value1.IsNull() && !value2.IsNull() { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + return false, nil + } + + // if val2 is null and val1 not, we have a diff + // continue to recurse though, so we can surface the elements of val1 + // that are now "missing" as diffs + if !value1.IsNull() && value2.IsNull() { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + return true, nil + } + + // we know there are known, non-null values, time to compare them + switch { + case value1.Type().Is(String): + var s1, s2 string + err := value1.As(&s1) + if err != nil { + return false, fmt.Errorf("Error converting %s (value1) at %q: %w", value1, path, err) + } + err = value2.As(&s2) + if err != nil { + return false, fmt.Errorf("Error converting %s (value2) at %q: %w", value2, path, err) + } + if s1 != s2 { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + } + return false, nil + case value1.Type().Is(Number): + n1, n2 := big.NewFloat(0), big.NewFloat(0) + err := value1.As(&n1) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + err = value2.As(&n2) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + if n1.Cmp(n2) != 0 { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + } + return false, nil + case value1.Type().Is(Bool): + var b1, b2 bool + err := value1.As(&b1) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + err = value2.As(&b2) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + if b1 != b2 { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + } + return false, nil + case value1.Type().Is(List{}), value1.Type().Is(Set{}), value1.Type().Is(Tuple{}): + var s1, s2 []Value + err := value1.As(&s1) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + err = value2.As(&s2) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + // we only care about if the lengths match for lists, + // sets, and tuples. If any of the elements differ, + // the recursion of the walk will find them for us. + if len(s1) != len(s2) { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + return true, nil + } + return true, nil + case value1.Type().Is(Map{}), value1.Type().Is(Object{}): + m1 := map[string]Value{} + m2 := map[string]Value{} + err := value1.As(&m1) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + err = value2.As(&m2) + if err != nil { + return false, fmt.Errorf("Error converting %q: %w", path, err) + } + // we need maps and objects to have the same exact keys + // as each other + if len(m1) != len(m2) { + diffs = append(diffs, ValueDiff{ + Path: path, + Value1: &value1, + Value2: &value2, + }) + return true, nil + } + // if we have the same keys, we can just let recursion + // from the walk check the sub-values match + return true, nil + case value1.Type().Is(DynamicPseudoType): + // Let recursion from the walk check the sub-values match + return true, nil + } + return false, fmt.Errorf("unexpected type %v in Diff at %s", value1.Type(), path) + }) + return diffs, err +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/doc.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/doc.go similarity index 100% rename from vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/doc.go rename to vendor/github.com/hashicorp/terraform-plugin-go/tftypes/doc.go diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go new file mode 100644 index 000000000..a0bc2f370 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/list.go @@ -0,0 +1,119 @@ +package tftypes + +import ( + "fmt" +) + +// List is a Terraform type representing an ordered collection of elements, all +// of the same type. +type List struct { + ElementType Type + + // used to make this type uncomparable + // see https://golang.org/ref/spec#Comparison_operators + // this enforces the use of Is, instead + _ []struct{} +} + +// ApplyTerraform5AttributePathStep applies an AttributePathStep to a List, +// returning the Type found at that AttributePath within the List. If the +// AttributePathStep cannot be applied to the List, an ErrInvalidStep error +// will be returned. +func (l List) ApplyTerraform5AttributePathStep(step AttributePathStep) (interface{}, error) { + switch s := step.(type) { + case ElementKeyInt: + if int64(s) < 0 { + return nil, ErrInvalidStep + } + + return l.ElementType, nil + default: + return nil, ErrInvalidStep + } +} + +// Equal returns true if the two Lists are exactly equal. Unlike Is, passing in +// a List with no ElementType will always return false. +func (l List) Equal(o Type) bool { + v, ok := o.(List) + if !ok { + return false + } + if l.ElementType == nil || v.ElementType == nil { + // when doing exact comparisons, we can't compare types that + // don't have element types set, so we just consider them not + // equal + return false + } + return l.ElementType.Equal(v.ElementType) +} + +// UsableAs returns whether the two Lists are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a List, it will return false. +// If the other List does not have a type compatible ElementType, it will +// return false. +func (l List) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(List) + if !ok { + return false + } + return l.ElementType.UsableAs(v.ElementType) +} + +// Is returns whether `t` is a List type or not. It does not perform any +// ElementType checks. +func (l List) Is(t Type) bool { + _, ok := t.(List) + return ok +} + +func (l List) String() string { + return "tftypes.List[" + l.ElementType.String() + "]" +} + +func (l List) private() {} + +func (l List) supportedGoTypes() []string { + return []string{"[]tftypes.Value"} +} + +func valueFromList(typ Type, in interface{}) (Value, error) { + switch value := in.(type) { + case []Value: + var valType Type + for pos, v := range value { + if !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyInt(pos).NewErrorf("can't use %s as %s", v.Type(), typ) + } + if valType == nil { + valType = v.Type() + } + if !v.Type().Equal(valType) { + return Value{}, fmt.Errorf("lists must only contain one type of element, saw %s and %s", valType, v.Type()) + } + } + return Value{ + typ: List{ElementType: typ}, + value: value, + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.List; expected types are: %s", in, formattedSupportedGoTypes(List{})) + } +} + +// MarshalJSON returns a JSON representation of the full type signature of `l`, +// including its ElementType. +// +// Deprecated: this is not meant to be called by third-party code. +func (l List) MarshalJSON() ([]byte, error) { + elementType, err := l.ElementType.MarshalJSON() + if err != nil { + return nil, fmt.Errorf("error marshaling tftypes.List's element type %T to JSON: %w", l.ElementType, err) + } + return []byte(`["list",` + string(elementType) + `]`), nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go new file mode 100644 index 000000000..7c1e7d05a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/map.go @@ -0,0 +1,122 @@ +package tftypes + +import ( + "fmt" + "sort" +) + +// Map is a Terraform type representing an unordered collection of elements, +// all of the same type, each identifiable with a unique string key. +type Map struct { + ElementType Type + + // used to make this type uncomparable + // see https://golang.org/ref/spec#Comparison_operators + // this enforces the use of Is, instead + _ []struct{} +} + +// ApplyTerraform5AttributePathStep applies an AttributePathStep to a Map, +// returning the Type found at that AttributePath within the Map. If the +// AttributePathStep cannot be applied to the Map, an ErrInvalidStep error +// will be returned. +func (m Map) ApplyTerraform5AttributePathStep(step AttributePathStep) (interface{}, error) { + switch step.(type) { + case ElementKeyString: + return m.ElementType, nil + default: + return nil, ErrInvalidStep + } +} + +// Equal returns true if the two Maps are exactly equal. Unlike Is, passing in +// a Map with no ElementType will always return false. +func (m Map) Equal(o Type) bool { + v, ok := o.(Map) + if !ok { + return false + } + if v.ElementType == nil || m.ElementType == nil { + // when doing exact comparisons, we can't compare types that + // don't have element types set, so we just consider them not + // equal + return false + } + return m.ElementType.Equal(v.ElementType) +} + +// UsableAs returns whether the two Maps are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Map, it will return false. +// If the other Map does not have a type compatible ElementType, it will +// return false. +func (m Map) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(Map) + if !ok { + return false + } + return m.ElementType.UsableAs(v.ElementType) +} + +// Is returns whether `t` is a Map type or not. It does not perform any +// ElementType checks. +func (m Map) Is(t Type) bool { + _, ok := t.(Map) + return ok +} + +func (m Map) String() string { + return "tftypes.Map[" + m.ElementType.String() + "]" +} + +func (m Map) private() {} + +func (m Map) supportedGoTypes() []string { + return []string{"map[string]tftypes.Value"} +} + +// MarshalJSON returns a JSON representation of the full type signature of `m`, +// including its ElementType. +// +// Deprecated: this is not meant to be called by third-party code. +func (m Map) MarshalJSON() ([]byte, error) { + attributeType, err := m.ElementType.MarshalJSON() + if err != nil { + return nil, fmt.Errorf("error marshaling tftypes.Map's attribute type %T to JSON: %w", m.ElementType, err) + } + return []byte(`["map",` + string(attributeType) + `]`), nil +} + +func valueFromMap(typ Type, in interface{}) (Value, error) { + switch value := in.(type) { + case map[string]Value: + keys := make([]string, 0, len(value)) + for k := range value { + keys = append(keys, k) + } + sort.Strings(keys) + var elType Type + for _, k := range keys { + v := value[k] + if !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyString(k).NewErrorf("can't use %s as %s", v.Type(), typ) + } + if elType == nil { + elType = v.Type() + } + if !elType.Equal(v.Type()) { + return Value{}, fmt.Errorf("maps must only contain one type of element, saw %s and %s", elType, v.Type()) + } + } + return Value{ + typ: Map{ElementType: typ}, + value: value, + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.Map; expected types are: %s", in, formattedSupportedGoTypes(Map{})) + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go new file mode 100644 index 000000000..ce2bf1325 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/object.go @@ -0,0 +1,253 @@ +package tftypes + +import ( + "encoding/json" + "fmt" + "sort" + "strings" +) + +// Object is a Terraform type representing an unordered collection of +// attributes, potentially of differing types, each identifiable with a unique +// string name. The number of attributes, their names, and their types are part +// of the type signature for the Object, and so two Objects with different +// attribute names or types are considered to be distinct types. +type Object struct { + // AttributeTypes is a map of attributes to their types. The key should + // be the name of the attribute, and the value should be the type of + // the attribute. + AttributeTypes map[string]Type + + // OptionalAttributes is a set of attributes that are optional. This + // allows values of this object type to include or not include those + // attributes without changing the type of the value; other attributes + // are considered part of the type signature, and their absence means a + // value is no longer of that type. + // + // OptionalAttributes is only valid when declaring a type constraint + // (e.g. Schema) and should not be used as part of a Type when creating + // a Value (e.g. NewValue()). When creating a Value, all OptionalAttributes + // must still be defined in the Object by setting each attribute to a null + // or known value for its attribute type. + // + // The key of OptionalAttributes should be the name of the attribute + // that is optional. The value should be an empty struct, used only to + // indicate presence. + // + // OptionalAttributes must also be listed in the AttributeTypes + // property, indicating their types. + OptionalAttributes map[string]struct{} + + // used to make this type uncomparable + // see https://golang.org/ref/spec#Comparison_operators + // this enforces the use of Is, instead + _ []struct{} +} + +// ApplyTerraform5AttributePathStep applies an AttributePathStep to an Object, +// returning the Type found at that AttributePath within the Object. If the +// AttributePathStep cannot be applied to the Object, an ErrInvalidStep error +// will be returned. +func (o Object) ApplyTerraform5AttributePathStep(step AttributePathStep) (interface{}, error) { + switch s := step.(type) { + case AttributeName: + if len(o.AttributeTypes) == 0 { + return nil, ErrInvalidStep + } + + attrType, ok := o.AttributeTypes[string(s)] + + if !ok { + return nil, ErrInvalidStep + } + + return attrType, nil + default: + return nil, ErrInvalidStep + } +} + +// Equal returns true if the two Objects are exactly equal. Unlike Is, passing +// in an Object with no AttributeTypes will always return false. +func (o Object) Equal(other Type) bool { + v, ok := other.(Object) + if !ok { + return false + } + if v.AttributeTypes == nil || o.AttributeTypes == nil { + // when doing exact comparisons, we can't compare types that + // don't have attribute types set, so we just consider them not + // equal + return false + } + + // if the don't have the exact same optional attributes, they're not + // the same type. + if len(v.OptionalAttributes) != len(o.OptionalAttributes) { + return false + } + for attr := range o.OptionalAttributes { + if !v.attrIsOptional(attr) { + return false + } + } + + // if they don't have the same attribute types, they're not the + // same type. + if len(v.AttributeTypes) != len(o.AttributeTypes) { + return false + } + for k, typ := range o.AttributeTypes { + if _, ok := v.AttributeTypes[k]; !ok { + return false + } + if !typ.Equal(v.AttributeTypes[k]) { + return false + } + } + return true +} + +// UsableAs returns whether the two Objects are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Object, it will return false. +// If the other Object does not have matching AttributeTypes length, it will +// return false. +// If the other Object does not have a type compatible ElementType for every +// nested attribute, it will return false. +// +// If the current type contains OptionalAttributes, it will panic. +func (o Object) UsableAs(other Type) bool { + if other.Is(DynamicPseudoType) { + return true + } + v, ok := other.(Object) + if !ok { + return false + } + if len(o.OptionalAttributes) > 0 { + panic("Objects with OptionalAttributes cannot be used.") + } + if len(v.AttributeTypes) != len(o.AttributeTypes) { + return false + } + for k, typ := range o.AttributeTypes { + otherTyp, ok := v.AttributeTypes[k] + if !ok { + return false + } + if !typ.UsableAs(otherTyp) { + return false + } + } + return true +} + +// Is returns whether `t` is an Object type or not. It does not perform any +// AttributeTypes checks. +func (o Object) Is(t Type) bool { + _, ok := t.(Object) + return ok +} + +func (o Object) attrIsOptional(attr string) bool { + if o.OptionalAttributes == nil { + return false + } + _, ok := o.OptionalAttributes[attr] + return ok +} + +func (o Object) String() string { + var res strings.Builder + res.WriteString("tftypes.Object[") + keys := make([]string, 0, len(o.AttributeTypes)) + for k := range o.AttributeTypes { + keys = append(keys, k) + } + sort.Strings(keys) + for pos, key := range keys { + if pos != 0 { + res.WriteString(", ") + } + res.WriteString(`"` + key + `":`) + res.WriteString(o.AttributeTypes[key].String()) + if o.attrIsOptional(key) { + res.WriteString(`?`) + } + } + res.WriteString("]") + return res.String() +} + +func (o Object) private() {} + +func (o Object) supportedGoTypes() []string { + return []string{"map[string]tftypes.Value"} +} + +func valueFromObject(types map[string]Type, optionalAttrs map[string]struct{}, in interface{}) (Value, error) { + switch value := in.(type) { + case map[string]Value: + // types should only be null if the "Object" is actually a + // DynamicPseudoType being created from a map[string]Value. In + // which case, we don't know what types it should have, or even + // how many there will be, so let's not validate that at all + if types != nil { + for k := range types { + if _, ok := optionalAttrs[k]; ok { + // if it's optional, we don't need to check that it has a value + continue + } + if _, ok := value[k]; !ok { + return Value{}, fmt.Errorf("can't create a tftypes.Value of type %s, required attribute %q not set", Object{AttributeTypes: types}, k) + } + } + for k, v := range value { + typ, ok := types[k] + if !ok { + return Value{}, fmt.Errorf("can't set a value on %q in tftypes.NewValue, key not part of the object type %s", k, Object{AttributeTypes: types}) + } + if v.Type() == nil { + return Value{}, NewAttributePath().WithAttributeName(k).NewErrorf("missing value type") + } + if !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithAttributeName(k).NewErrorf("can't use %s as %s", v.Type(), typ) + } + } + } + return Value{ + typ: Object{AttributeTypes: types, OptionalAttributes: optionalAttrs}, + value: value, + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.Object; expected types are: %s", in, formattedSupportedGoTypes(Object{})) + } +} + +// MarshalJSON returns a JSON representation of the full type signature of `o`, +// including the AttributeTypes. +// +// Deprecated: this is not meant to be called by third-party code. +func (o Object) MarshalJSON() ([]byte, error) { + attrs, err := json.Marshal(o.AttributeTypes) + if err != nil { + return nil, err + } + var optionalAttrs []byte + if len(o.OptionalAttributes) > 0 { + optionalAttrs = append(optionalAttrs, []byte(",")...) + names := make([]string, 0, len(o.OptionalAttributes)) + for k := range o.OptionalAttributes { + names = append(names, k) + } + sort.Strings(names) + optionalsJSON, err := json.Marshal(names) + if err != nil { + return nil, err + } + optionalAttrs = append(optionalAttrs, optionalsJSON...) + } + return []byte(`["object",` + string(attrs) + string(optionalAttrs) + `]`), nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go new file mode 100644 index 000000000..0349f4145 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/primitive.go @@ -0,0 +1,405 @@ +package tftypes + +import ( + "fmt" + "math/big" +) + +var ( + // DynamicPseudoType is a pseudo-type in Terraform's type system that + // is used as a wildcard type. It indicates that any Terraform type can + // be used. + DynamicPseudoType = primitive{name: "DynamicPseudoType"} + + // String is a primitive type in Terraform that represents a UTF-8 + // string of bytes. + String = primitive{name: "String"} + + // Number is a primitive type in Terraform that represents a real + // number. + Number = primitive{name: "Number"} + + // Bool is a primitive type in Terraform that represents a true or + // false boolean value. + Bool = primitive{name: "Bool"} +) + +var ( + _ Type = primitive{name: "test"} +) + +type primitive struct { + name string + + // used to make this type uncomparable + // see https://golang.org/ref/spec#Comparison_operators + // this enforces the use of Is, instead + _ []struct{} +} + +// ApplyTerraform5AttributePathStep always returns an ErrInvalidStep error +// as it is invalid to step into a primitive. +func (p primitive) ApplyTerraform5AttributePathStep(step AttributePathStep) (interface{}, error) { + return nil, ErrInvalidStep +} + +func (p primitive) Equal(o Type) bool { + v, ok := o.(primitive) + if !ok { + return false + } + return p.name == v.name +} + +func (p primitive) Is(t Type) bool { + return p.Equal(t) +} + +func (p primitive) UsableAs(t Type) bool { + v, ok := t.(primitive) + if !ok { + return false + } + if v.name == DynamicPseudoType.name { + return true + } + return v.name == p.name +} + +func (p primitive) String() string { + return "tftypes." + p.name +} + +func (p primitive) private() {} + +func (p primitive) MarshalJSON() ([]byte, error) { + switch p.name { + case String.name: + return []byte(`"string"`), nil + case Number.name: + return []byte(`"number"`), nil + case Bool.name: + return []byte(`"bool"`), nil + case DynamicPseudoType.name: + return []byte(`"dynamic"`), nil + } + return nil, fmt.Errorf("unknown primitive type %q", p) +} + +func (p primitive) supportedGoTypes() []string { + switch p.name { + case String.name: + return []string{"string", "*string"} + case Number.name: + return []string{ + "*big.Float", + "uint", "*uint", + "uint8", "*uint8", + "uint16", "*uint16", + "uint32", "*uint32", + "uint64", "*uint64", + "int", "*int", + "int8", "*int8", + "int16", "*int16", + "int32", "*int32", + "int64", "*int64", + "float64", "*float64", + } + case Bool.name: + return []string{"bool", "*bool"} + case DynamicPseudoType.name: + // List/Set is covered by Tuple, Map is covered by Object + possibleTypes := []Type{ + String, Bool, Number, + Tuple{}, Object{}, + } + results := []string{} + for _, t := range possibleTypes { + results = append(results, t.supportedGoTypes()...) + } + return results + } + panic(fmt.Sprintf("unknown primitive type %q", p.name)) +} + +func valueFromString(in interface{}) (Value, error) { + switch value := in.(type) { + case *string: + if value == nil { + return Value{ + typ: String, + value: nil, + }, nil + } + return Value{ + typ: String, + value: *value, + }, nil + case string: + return Value{ + typ: String, + value: value, + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.String; expected types are: %s", in, formattedSupportedGoTypes(String)) + } +} + +func valueFromBool(in interface{}) (Value, error) { + switch value := in.(type) { + case *bool: + if value == nil { + return Value{ + typ: Bool, + value: nil, + }, nil + } + return Value{ + typ: Bool, + value: *value, + }, nil + case bool: + return Value{ + typ: Bool, + value: value, + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.Bool; expected types are: %s", in, formattedSupportedGoTypes(Bool)) + } +} + +func valueFromNumber(in interface{}) (Value, error) { + switch value := in.(type) { + case *big.Float: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: value, + }, nil + case uint: + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(value)), + }, nil + case *uint: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(*value)), + }, nil + case uint8: + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(value)), + }, nil + case *uint8: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(*value)), + }, nil + case uint16: + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(value)), + }, nil + case *uint16: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(*value)), + }, nil + case uint32: + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(value)), + }, nil + case *uint32: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetUint64(uint64(*value)), + }, nil + case uint64: + return Value{ + typ: Number, + value: new(big.Float).SetUint64(value), + }, nil + case *uint64: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetUint64(*value), + }, nil + case int: + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(value)), + }, nil + case *int: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(*value)), + }, nil + case int8: + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(value)), + }, nil + case *int8: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(*value)), + }, nil + case int16: + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(value)), + }, nil + case *int16: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(*value)), + }, nil + case int32: + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(value)), + }, nil + case *int32: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetInt64(int64(*value)), + }, nil + case int64: + return Value{ + typ: Number, + value: new(big.Float).SetInt64(value), + }, nil + case *int64: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: new(big.Float).SetInt64(*value), + }, nil + case float64: + return Value{ + typ: Number, + value: big.NewFloat(value), + }, nil + case *float64: + if value == nil { + return Value{ + typ: Number, + value: nil, + }, nil + } + return Value{ + typ: Number, + value: big.NewFloat(*value), + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.Number; expected types are: %s", in, formattedSupportedGoTypes(Number)) + } +} + +func valueFromDynamicPseudoType(val interface{}) (Value, error) { + switch val := val.(type) { + case string, *string: + v, err := valueFromString(val) + if err != nil { + return Value{}, err + } + v.typ = DynamicPseudoType + return v, nil + case *big.Float, float64, *float64, int, *int, int8, *int8, int16, *int16, int32, *int32, int64, *int64, uint, *uint, uint8, *uint8, uint16, *uint16, uint32, *uint32, uint64, *uint64: + v, err := valueFromNumber(val) + if err != nil { + return Value{}, err + } + v.typ = DynamicPseudoType + return v, nil + case bool, *bool: + v, err := valueFromBool(val) + if err != nil { + return Value{}, err + } + v.typ = DynamicPseudoType + return v, nil + case map[string]Value: + v, err := valueFromObject(nil, nil, val) + if err != nil { + return Value{}, err + } + v.typ = DynamicPseudoType + return v, nil + case []Value: + v, err := valueFromTuple(nil, val) + if err != nil { + return Value{}, err + } + v.typ = DynamicPseudoType + return v, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.DynamicPseudoType; expected types are: %s", val, formattedSupportedGoTypes(DynamicPseudoType)) + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go new file mode 100644 index 000000000..00163067e --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/set.go @@ -0,0 +1,115 @@ +package tftypes + +import ( + "fmt" +) + +// Set is a Terraform type representing an unordered collection of unique +// elements, all of the same type. +type Set struct { + ElementType Type + + // used to make this type uncomparable + // see https://golang.org/ref/spec#Comparison_operators + // this enforces the use of Is, instead + _ []struct{} +} + +// ApplyTerraform5AttributePathStep applies an AttributePathStep to a Set, +// returning the Type found at that AttributePath within the Set. If the +// AttributePathStep cannot be applied to the Set, an ErrInvalidStep error +// will be returned. +func (s Set) ApplyTerraform5AttributePathStep(step AttributePathStep) (interface{}, error) { + switch step.(type) { + case ElementKeyValue: + return s.ElementType, nil + default: + return nil, ErrInvalidStep + } +} + +// Equal returns true if the two Sets are exactly equal. Unlike Is, passing in +// a Set with no ElementType will always return false. +func (s Set) Equal(o Type) bool { + v, ok := o.(Set) + if !ok { + return false + } + if v.ElementType == nil || s.ElementType == nil { + // when doing exact comparisons, we can't compare types that + // don't have element types set, so we just consider them not + // equal + return false + } + return s.ElementType.Equal(v.ElementType) +} + +// UsableAs returns whether the two Sets are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Set, it will return false. +// If the other Set does not have a type compatible ElementType, it will +// return false. +func (s Set) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(Set) + if !ok { + return false + } + return s.ElementType.UsableAs(v.ElementType) +} + +// Is returns whether `t` is a Set type or not. It does not perform any +// ElementType checks. +func (s Set) Is(t Type) bool { + _, ok := t.(Set) + return ok +} + +func (s Set) String() string { + return "tftypes.Set[" + s.ElementType.String() + "]" +} + +func (s Set) private() {} + +func (s Set) supportedGoTypes() []string { + return []string{"[]tftypes.Value"} +} + +func valueFromSet(typ Type, in interface{}) (Value, error) { + switch value := in.(type) { + case []Value: + var elType Type + for _, v := range value { + if !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyValue(v).NewErrorf("can't use %s as %s", v.Type(), typ) + } + if elType == nil { + elType = v.Type() + } + if !elType.Equal(v.Type()) { + return Value{}, fmt.Errorf("sets must only contain one type of element, saw %s and %s", elType, v.Type()) + } + } + return Value{ + typ: Set{ElementType: typ}, + value: value, + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.Set; expected types are: %s", in, formattedSupportedGoTypes(Set{})) + } +} + +// MarshalJSON returns a JSON representation of the full type signature of `s`, +// including its ElementType. +// +// Deprecated: this is not meant to be called by third-party code. +func (s Set) MarshalJSON() ([]byte, error) { + elementType, err := s.ElementType.MarshalJSON() + if err != nil { + return nil, fmt.Errorf("error marshaling tftypes.Set's element type %T to JSON: %w", s.ElementType, err) + } + return []byte(`["set",` + string(elementType) + `]`), nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go new file mode 100644 index 000000000..5ca5709a3 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/tuple.go @@ -0,0 +1,153 @@ +package tftypes + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Tuple is a Terraform type representing an ordered collection of elements, +// potentially of differing types. The number of elements and their types are +// part of the type signature for the Tuple, and so two Tuples with different +// numbers or types of elements are considered to be distinct types. +type Tuple struct { + ElementTypes []Type + + // used to make this type uncomparable + // see https://golang.org/ref/spec#Comparison_operators + // this enforces the use of Is, instead + _ []struct{} +} + +// ApplyTerraform5AttributePathStep applies an AttributePathStep to a Tuple, +// returning the Type found at that AttributePath within the Tuple. If the +// AttributePathStep cannot be applied to the Tuple, an ErrInvalidStep error +// will be returned. +func (tu Tuple) ApplyTerraform5AttributePathStep(step AttributePathStep) (interface{}, error) { + switch s := step.(type) { + case ElementKeyInt: + if int64(s) < 0 || int64(s) >= int64(len(tu.ElementTypes)) { + return nil, ErrInvalidStep + } + + return tu.ElementTypes[int64(s)], nil + default: + return nil, ErrInvalidStep + } +} + +// Equal returns true if the two Tuples are exactly equal. Unlike Is, passing +// in a Tuple with no ElementTypes will always return false. +func (tu Tuple) Equal(o Type) bool { + v, ok := o.(Tuple) + if !ok { + return false + } + if v.ElementTypes == nil || tu.ElementTypes == nil { + // when doing exact comparisons, we can't compare types that + // don't have element types set, so we just consider them not + // equal + return false + } + if len(v.ElementTypes) != len(tu.ElementTypes) { + return false + } + for pos, typ := range tu.ElementTypes { + if !typ.Equal(v.ElementTypes[pos]) { + return false + } + } + return true +} + +// UsableAs returns whether the two Tuples are type compatible. +// +// If the other type is DynamicPseudoType, it will return true. +// If the other type is not a Tuple, it will return false. +// If the other Tuple does not have matching ElementTypes length, it will +// return false. +// If the other Tuple does not have type compatible ElementTypes in each +// position, it will return false. +func (tu Tuple) UsableAs(o Type) bool { + if o.Is(DynamicPseudoType) { + return true + } + v, ok := o.(Tuple) + if !ok { + return false + } + if len(v.ElementTypes) != len(tu.ElementTypes) { + return false + } + for pos, typ := range tu.ElementTypes { + if !typ.UsableAs(v.ElementTypes[pos]) { + return false + } + } + return true +} + +// Is returns whether `t` is a Tuple type or not. It does not perform any +// ElementTypes checks. +func (tu Tuple) Is(t Type) bool { + _, ok := t.(Tuple) + return ok +} + +func (tu Tuple) String() string { + var res strings.Builder + res.WriteString("tftypes.Tuple[") + for pos, t := range tu.ElementTypes { + if pos != 0 { + res.WriteString(", ") + } + res.WriteString(t.String()) + } + res.WriteString("]") + return res.String() +} + +func (tu Tuple) private() {} + +func (tu Tuple) supportedGoTypes() []string { + return []string{"[]tftypes.Value"} +} + +func valueFromTuple(types []Type, in interface{}) (Value, error) { + switch value := in.(type) { + case []Value: + // types should only be null if the "Tuple" is actually a + // DynamicPseudoType being created from a []Value. In which + // case, we don't know what types it should have, or even how + // many there will be, so let's not validate that at all + if types != nil { + if len(types) != len(value) { + return Value{}, fmt.Errorf("can't create a tftypes.Value with %d elements, type %s requires %d elements", len(value), Tuple{ElementTypes: types}, len(types)) + } + for pos, v := range value { + typ := types[pos] + if !v.Type().UsableAs(typ) { + return Value{}, NewAttributePath().WithElementKeyInt(pos).NewErrorf("can't use %s as %s", v.Type(), typ) + } + } + } + return Value{ + typ: Tuple{ElementTypes: types}, + value: value, + }, nil + default: + return Value{}, fmt.Errorf("tftypes.NewValue can't use %T as a tftypes.Tuple; expected types are: %s", in, formattedSupportedGoTypes(Tuple{})) + } +} + +// MarshalJSON returns a JSON representation of the full type signature of +// `tu`, including the ElementTypes. +// +// Deprecated: this is not meant to be called by third-party code. +func (tu Tuple) MarshalJSON() ([]byte, error) { + elements, err := json.Marshal(tu.ElementTypes) + if err != nil { + return nil, err + } + return []byte(`["tuple",` + string(elements) + `]`), nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/type.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/type.go similarity index 62% rename from vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/type.go rename to vendor/github.com/hashicorp/terraform-plugin-go/tftypes/type.go index 1e7ff1931..4f0e4af7c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/type.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/type.go @@ -3,18 +3,37 @@ package tftypes import ( "bytes" "encoding/json" + "errors" "fmt" + "strings" ) // Type is an interface representing a Terraform type. It is only meant to be // implemented by the tftypes package. Types define the shape and // characteristics of data coming from or being sent to Terraform. type Type interface { + // AttributePathStepper requires each Type to implement the + // ApplyTerraform5AttributePathStep method, so Type is compatible with + // WalkAttributePath. The method should return the Type found at that + // AttributePath within the Type or ErrInvalidStep. + AttributePathStepper + // Is is used to determine what type a Type implementation is. It is // the recommended method for determining whether two types are // equivalent or not. + + // Is performs shallow type equality checks, in that the root type is + // compared, but underlying attribute/element types are not. Is(Type) bool + // Equal performs deep type equality checks, including attribute/element + // types and whether attributes are optional or not. + Equal(Type) bool + + // UsableAs performs type conformance checks. This primarily checks if the + // target implements DynamicPsuedoType in a compatible manner. + UsableAs(Type) bool + // String returns a string representation of the Type's name. String() string @@ -29,6 +48,30 @@ type Type interface { // private is meant to keep this interface from being implemented by // types from other packages. private() + + // supportedGoTypes returns a list of string representations of the Go + // types that the Type supports for its values. + supportedGoTypes() []string +} + +// TypeFromElements returns the common type that the passed elements all have +// in common. An error will be returned if the passed elements are not of the +// same type. +func TypeFromElements(elements []Value) (Type, error) { + var typ Type + for _, el := range elements { + if typ == nil { + typ = el.Type() + continue + } + if !typ.Equal(el.Type()) { + return nil, errors.New("elements do not all have the same types") + } + } + if typ == nil { + return DynamicPseudoType, nil + } + return typ, nil } type jsonType struct { @@ -106,7 +149,7 @@ func (t *jsonType) UnmarshalJSON(buf []byte) error { return err } t.t = Map{ - AttributeType: ety.t, + ElementType: ety.t, } case "set": var ety jsonType @@ -127,9 +170,21 @@ func (t *jsonType) UnmarshalJSON(buf []byte) error { for k, v := range atys { types[k] = v.t } - t.t = Object{ - AttributeTypes: types, + o := Object{ + AttributeTypes: types, + OptionalAttributes: map[string]struct{}{}, + } + if dec.More() { + var optionals []string + err = dec.Decode(&optionals) + if err != nil { + return err + } + for _, attr := range optionals { + o.OptionalAttributes[attr] = struct{}{} + } } + t.t = o case "tuple": var etys []jsonType err = dec.Decode(&etys) @@ -161,3 +216,18 @@ func (t *jsonType) UnmarshalJSON(buf []byte) error { return fmt.Errorf("invalid type description") } } + +func formattedSupportedGoTypes(t Type) string { + sgt := t.supportedGoTypes() + switch len(sgt) { + case 0: + return "no supported Go types" + case 1: + return sgt[0] + case 2: + return sgt[0] + " or " + sgt[1] + default: + sgt[len(sgt)-1] = "or " + sgt[len(sgt)-1] + return strings.Join(sgt, ", ") + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/unknown_value.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/unknown_value.go similarity index 100% rename from vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/unknown_value.go rename to vendor/github.com/hashicorp/terraform-plugin-go/tftypes/unknown_value.go diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/value.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go similarity index 50% rename from vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/value.go rename to vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go index 2b882d099..4d7b74989 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes/value.go +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value.go @@ -2,12 +2,13 @@ package tftypes import ( "bytes" - "errors" "fmt" "math/big" + "sort" + "strconv" + "strings" - "github.com/google/go-cmp/cmp" - "github.com/vmihailenco/msgpack" + msgpack "github.com/vmihailenco/msgpack/v4" ) // ValueConverter is an interface that provider-defined types can implement to @@ -27,14 +28,6 @@ type ValueCreator interface { ToTerraform5Value() (interface{}, error) } -type msgPackUnknownType struct{} - -var msgPackUnknownVal = msgPackUnknownType{} - -func (u msgPackUnknownType) MarshalMsgpack() ([]byte, error) { - return []byte{0xd4, 0, 0}, nil -} - // Value is a piece of data from Terraform or being returned to Terraform. It // has a Type associated with it, defining its shape and characteristics, and a // Go representation of that Type containing the data itself. Values are a @@ -50,19 +43,228 @@ type Value struct { value interface{} } +func (val Value) String() string { + typ := val.Type() + + if typ == nil { + return "invalid typeless tftypes.Value<>" + } + + // null and unknown values we use static strings for + if val.IsNull() { + return typ.String() + "" + } + if !val.IsKnown() { + return typ.String() + "" + } + + // everything else is built up + var res strings.Builder + switch { + case typ.Is(String): + var s string + err := val.As(&s) + if err != nil { + panic(err) + } + res.WriteString(typ.String() + `<"` + s + `">`) + case typ.Is(Number): + n := big.NewFloat(0) + err := val.As(&n) + if err != nil { + panic(err) + } + res.WriteString(typ.String() + `<"` + n.String() + `">`) + case typ.Is(Bool): + var b bool + err := val.As(&b) + if err != nil { + panic(err) + } + res.WriteString(typ.String() + `<"` + strconv.FormatBool(b) + `">`) + case typ.Is(List{}), typ.Is(Set{}), typ.Is(Tuple{}): + var l []Value + err := val.As(&l) + if err != nil { + panic(err) + } + res.WriteString(typ.String() + `<`) + for pos, el := range l { + if pos != 0 { + res.WriteString(", ") + } + res.WriteString(el.String()) + } + res.WriteString(">") + case typ.Is(Map{}), typ.Is(Object{}): + m := map[string]Value{} + err := val.As(&m) + if err != nil { + panic(err) + } + res.WriteString(typ.String() + `<`) + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + sort.Strings(keys) + for pos, key := range keys { + if pos != 0 { + res.WriteString(", ") + } + res.WriteString(`"` + key + `":`) + res.WriteString(m[key].String()) + } + res.WriteString(">") + } + return res.String() +} + +// ApplyTerraform5AttributePathStep applies an AttributePathStep to a Value, +// returning the Value found at that AttributePath within the Value. It +// fulfills that AttributePathStepper interface, allowing Values to be passed +// to WalkAttributePath. This allows retrieving a subset of a Value using an +// AttributePath. If the AttributePathStep can't be applied to the Value, +// either because it is the wrong type or because no Value exists at that +// AttributePathStep, an ErrInvalidStep error will be returned. +func (val Value) ApplyTerraform5AttributePathStep(step AttributePathStep) (interface{}, error) { + if !val.IsKnown() || val.IsNull() { + return nil, ErrInvalidStep + } + switch s := step.(type) { + case AttributeName: + if !val.Type().Is(Object{}) { + return nil, ErrInvalidStep + } + o := map[string]Value{} + err := val.As(&o) + if err != nil { + return nil, err + } + res, ok := o[string(s)] + if !ok { + return nil, ErrInvalidStep + } + return res, nil + case ElementKeyString: + if !val.Type().Is(Map{}) { + return nil, ErrInvalidStep + } + m := map[string]Value{} + err := val.As(&m) + if err != nil { + return nil, err + } + res, ok := m[string(s)] + if !ok { + return nil, ErrInvalidStep + } + return res, nil + case ElementKeyInt: + if !val.Type().Is(List{}) && !val.Type().Is(Tuple{}) { + return nil, ErrInvalidStep + } + if int64(s) < 0 { + return nil, ErrInvalidStep + } + sl := []Value{} + err := val.As(&sl) + if err != nil { + return nil, err + } + if int64(len(sl)) <= int64(s) { + return nil, ErrInvalidStep + } + return sl[int64(s)], nil + case ElementKeyValue: + if !val.Type().Is(Set{}) { + return nil, ErrInvalidStep + } + sl := []Value{} + err := val.As(&sl) + if err != nil { + return nil, err + } + for _, el := range sl { + diffs, err := el.Diff(Value(s)) + if err != nil { + return nil, err + } + if len(diffs) == 0 { + return el, nil + } + } + return nil, ErrInvalidStep + default: + return nil, fmt.Errorf("unexpected AttributePathStep type %T", step) + } +} + +// Equal returns true if two Values should be considered equal. Values are +// considered equal if their types are considered equal and if they represent +// data that is considered equal. +func (val Value) Equal(o Value) bool { + if val.Type() == nil && o.Type() == nil && val.value == nil && o.value == nil { + return true + } + if val.Type() == nil { + return false + } + if o.Type() == nil { + return false + } + if !val.Type().Equal(o.Type()) { + return false + } + diff, err := val.Diff(o) + if err != nil { + panic(err) + } + return len(diff) < 1 +} + +// Copy returns a defensively-copied clone of Value that shares no underlying +// data structures with the original Value and can be mutated without +// accidentally mutating the original. +func (val Value) Copy() Value { + newVal := val.value + switch v := val.value.(type) { + case []Value: + newVals := make([]Value, 0, len(v)) + for _, value := range v { + newVals = append(newVals, value.Copy()) + } + newVal = newVals + case map[string]Value: + newVals := make(map[string]Value, len(v)) + for k, value := range v { + newVals[k] = value.Copy() + } + newVal = newVals + } + return NewValue(val.Type(), newVal) +} + // NewValue returns a Value constructed using the specified Type and stores the // passed value in it. // // The passed value should be in one of the builtin Value representations or // implement the ValueCreator interface. // +// If the passed value is not a valid value for the passed type, NewValue will +// panic. Any value and type combination that does not return an error from +// ValidateValue is guaranteed to not panic. When calling NewValue with user +// input with a type not known at compile time, it is recommended to call +// ValidateValue before calling NewValue, to allow graceful handling of the +// error. +// // The builtin Value representations are: // // * String: string, *string // -// * Number: *big.Float, int64, *int64, int32, *int32, int16, *int16, int8, *int8, int, *int, -// uint64, *uint64, uint32, *uint32, uint16, *uint16, uint8, *uint8, byte, *byte, uint, *uint, -// float64, *float64, float32, *float32 +// * Number: *big.Float, int64, *int64, int32, *int32, int16, *int16, int8, +// *int8, int, *int, uint64, *uint64, uint32, *uint32, uint16, +// *uint16, uint8, *uint8, uint, *uint, float64, *float64 // // * Bool: bool, *bool // @@ -70,192 +272,95 @@ type Value struct { // // * Tuple, List, and Set: []Value func NewValue(t Type, val interface{}) Value { + v, err := newValue(t, val) + if err != nil { + panic(err) + } + return v +} + +// ValidateValue checks that the Go type passed as `val` can be used as a value +// for the Type passed as `t`. A nil error response indicates that the value is +// valid for the type. +func ValidateValue(t Type, val interface{}) error { + _, err := newValue(t, val) + return err +} + +func newValue(t Type, val interface{}) (Value, error) { if val == nil || val == UnknownValue { return Value{ typ: t, value: val, - } + }, nil } + if creator, ok := val.(ValueCreator); ok { var err error val, err = creator.ToTerraform5Value() if err != nil { - panic("error creating tftypes.Value: " + err.Error()) + return Value{}, fmt.Errorf("error creating tftypes.Value: %w", err) } } - switch val := val.(type) { - case *string: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - return Value{ - typ: t, - value: *val, - } - case *bool: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - return Value{ - typ: t, - value: *val, - } - case *uint: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetUint64(uint64(*val)) - return Value{ - typ: t, - value: f, - } - case *uint64: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetUint64(uint64(*val)) - return Value{ - typ: t, - value: f, - } - case *uint8: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetInt64(int64(*val)) - return Value{ - typ: t, - value: f, - } - case *uint16: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetInt64(int64(*val)) - return Value{ - typ: t, - value: f, - } - case *uint32: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetInt64(int64(*val)) - return Value{ - typ: t, - value: f, - } - case *int: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetInt64(int64(*val)) - return Value{ - typ: t, - value: f, - } - case *int8: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetInt64(int64(*val)) - return Value{ - typ: t, - value: f, - } - case *int16: - if val == nil { - return Value{ - typ: t, - value: nil, - } - } - f := new(big.Float).SetInt64(int64(*val)) - return Value{ - typ: t, - value: f, - } - case *int32: - if val == nil { - return Value{ - typ: t, - value: nil, - } + switch { + case t.Is(String): + v, err := valueFromString(val) + if err != nil { + return Value{}, err } - f := new(big.Float).SetInt64(int64(*val)) - return Value{ - typ: t, - value: f, + return v, nil + case t.Is(Number): + v, err := valueFromNumber(val) + if err != nil { + return Value{}, err } - case *int64: - if val == nil { - return Value{ - typ: t, - value: nil, - } + return v, nil + case t.Is(Bool): + v, err := valueFromBool(val) + if err != nil { + return Value{}, err } - f := new(big.Float).SetInt64(*val) - return Value{ - typ: t, - value: f, + return v, nil + case t.Is(Map{}): + v, err := valueFromMap(t.(Map).ElementType, val) + if err != nil { + return Value{}, err } - case *float32: - if val == nil { - return Value{ - typ: t, - value: nil, - } + return v, nil + case t.Is(Object{}): + v, err := valueFromObject(t.(Object).AttributeTypes, t.(Object).OptionalAttributes, val) + if err != nil { + return Value{}, err } - return Value{ - typ: t, - value: big.NewFloat(float64(*val)), + return v, nil + case t.Is(List{}): + v, err := valueFromList(t.(List).ElementType, val) + if err != nil { + return Value{}, err } - case *float64: - if val == nil { - return Value{ - typ: t, - value: nil, - } + return v, nil + case t.Is(Set{}): + v, err := valueFromSet(t.(Set).ElementType, val) + if err != nil { + return Value{}, err } - return Value{ - typ: t, - value: big.NewFloat(*val), + return v, nil + case t.Is(Tuple{}): + v, err := valueFromTuple(t.(Tuple).ElementTypes, val) + if err != nil { + return Value{}, err } - case string, *big.Float, bool, map[string]Value, []Value: - return Value{ - typ: t, - value: val, + return v, nil + case t.Is(DynamicPseudoType): + v, err := valueFromDynamicPseudoType(val) + if err != nil { + return Value{}, err } + return v, nil + default: + return Value{}, fmt.Errorf("unknown type %s passed to tftypes.NewValue", t) } - panic(fmt.Sprintf("unknown type %T passed to NewValue", val)) } // As converts a Value into a Go value. `dst` must be set to a pointer to a @@ -312,7 +417,7 @@ func (val Value) As(dst interface{}) error { } v, ok := val.value.(string) if !ok { - return fmt.Errorf("can't unmarshal %s into %T, expected string", val.typ, dst) + return fmt.Errorf("can't unmarshal %s into %T, expected string", val.Type(), dst) } *target = v return nil @@ -321,6 +426,10 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + var s string + *target = &s + } return val.As(*target) case *big.Float: if val.IsNull() { @@ -329,15 +438,18 @@ func (val Value) As(dst interface{}) error { } v, ok := val.value.(*big.Float) if !ok { - return fmt.Errorf("can't unmarshal %s into %T, expected *big.Float", val.typ, dst) + return fmt.Errorf("can't unmarshal %s into %T, expected *big.Float", val.Type(), dst) } - target.Set(v) + target.Copy(v) return nil case **big.Float: if val.IsNull() { *target = nil return nil } + if *target == nil { + *target = big.NewFloat(0) + } return val.As(*target) case *bool: if val.IsNull() { @@ -346,7 +458,7 @@ func (val Value) As(dst interface{}) error { } v, ok := val.value.(bool) if !ok { - return fmt.Errorf("can't unmarshal %s into %T, expected boolean", val.typ, dst) + return fmt.Errorf("can't unmarshal %s into %T, expected boolean", val.Type(), dst) } *target = v return nil @@ -355,6 +467,10 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + var b bool + *target = &b + } return val.As(*target) case *map[string]Value: if val.IsNull() { @@ -363,7 +479,7 @@ func (val Value) As(dst interface{}) error { } v, ok := val.value.(map[string]Value) if !ok { - return fmt.Errorf("can't unmarshal %s into %T, expected map[string]tftypes.Value", val.typ, dst) + return fmt.Errorf("can't unmarshal %s into %T, expected map[string]tftypes.Value", val.Type(), dst) } *target = v return nil @@ -372,6 +488,10 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + m := map[string]Value{} + *target = &m + } return val.As(*target) case *[]Value: if val.IsNull() { @@ -380,7 +500,7 @@ func (val Value) As(dst interface{}) error { } v, ok := val.value.([]Value) if !ok { - return fmt.Errorf("can't unmarshal %s into %T expected []tftypes.Value", val.typ, dst) + return fmt.Errorf("can't unmarshal %s into %T expected []tftypes.Value", val.Type(), dst) } *target = v return nil @@ -389,17 +509,18 @@ func (val Value) As(dst interface{}) error { *target = nil return nil } + if *target == nil { + l := []Value{} + *target = &l + } return val.As(*target) } return fmt.Errorf("can't unmarshal into %T, needs FromTerraform5Value method", dst) } -// Is calls Type.Is using the Type of the Value. -func (val Value) Is(t Type) bool { - if val.typ == nil || t == nil { - return val.typ == nil && t == nil - } - return val.typ.Is(t) +// Type returns the Type of the Value. +func (val Value) Type() Type { + return val.typ } // IsKnown returns true if `val` is known. If `val` is an aggregate type, only @@ -416,7 +537,10 @@ func (val Value) IsFullyKnown() bool { if !val.IsKnown() { return false } - switch val.typ.(type) { + if val.value == nil { + return true + } + switch val.Type().(type) { case primitive: return true case List, Set, Tuple: @@ -434,7 +558,7 @@ func (val Value) IsFullyKnown() bool { } return true } - panic(fmt.Sprintf("unknown type %T", val.typ)) + panic(fmt.Sprintf("unknown type %T", val.Type())) } // IsNull returns true if the Value is null. @@ -450,50 +574,13 @@ func (val Value) MarshalMsgPack(t Type) ([]byte, error) { var buf bytes.Buffer enc := msgpack.NewEncoder(&buf) - err := marshalMsgPack(val, t, AttributePath{}, enc) + err := marshalMsgPack(val, t, NewAttributePath(), enc) if err != nil { return nil, err } return buf.Bytes(), nil } -func unexpectedValueTypeError(p AttributePath, expected, got interface{}, typ Type) error { +func unexpectedValueTypeError(p *AttributePath, expected, got interface{}, typ Type) error { return p.NewErrorf("unexpected value type %T, %s values must be of type %T", got, typ, expected) } - -// ValueComparer returns a github.com/google/go-cmp/cmp#Option that can be used -// to tell go-cmp how to compare Values. -func ValueComparer() cmp.Option { - return cmp.Comparer(valueComparer) -} - -func numberComparer(i, j *big.Float) bool { - return (i == nil && j == nil) || (i != nil && j != nil && i.Cmp(j) == 0) -} - -func valueComparer(i, j Value) bool { - if !i.typ.Is(j.typ) { - return false - } - return cmp.Equal(i.value, j.value, cmp.Comparer(numberComparer), ValueComparer()) -} - -// TypeFromElements returns the common type that the passed elements all have -// in common. An error will be returned if the passed elements are not of the -// same type. -func TypeFromElements(elements []Value) (Type, error) { - var typ Type - for _, el := range elements { - if typ == nil { - typ = el.typ - continue - } - if !typ.Is(el.typ) { - return nil, errors.New("elements do not all have the same types") - } - } - if typ == nil { - return DynamicPseudoType, nil - } - return typ, nil -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go new file mode 100644 index 000000000..308434776 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_json.go @@ -0,0 +1,483 @@ +package tftypes + +import ( + "bytes" + "encoding/json" + "math/big" + "strings" +) + +// ValueFromJSON returns a Value from the JSON-encoded bytes, using the +// provided Type to determine what shape the Value should be. +// DynamicPseudoTypes will be transparently parsed into the types they +// represent. +// +// Deprecated: this function is exported for internal use in +// terraform-plugin-go. Third parties should not use it, and its behavior is +// not covered under the API compatibility guarantees. Don't use this. +func ValueFromJSON(data []byte, typ Type) (Value, error) { + return jsonUnmarshal(data, typ, NewAttributePath()) +} + +func jsonByteDecoder(buf []byte) *json.Decoder { + r := bytes.NewReader(buf) + dec := json.NewDecoder(r) + dec.UseNumber() + return dec +} + +func jsonUnmarshal(buf []byte, typ Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + + if tok == nil { + return NewValue(typ, nil), nil + } + + switch { + case typ.Is(String): + return jsonUnmarshalString(buf, typ, p) + case typ.Is(Number): + return jsonUnmarshalNumber(buf, typ, p) + case typ.Is(Bool): + return jsonUnmarshalBool(buf, typ, p) + case typ.Is(DynamicPseudoType): + return jsonUnmarshalDynamicPseudoType(buf, typ, p) + case typ.Is(List{}): + return jsonUnmarshalList(buf, typ.(List).ElementType, p) + case typ.Is(Set{}): + return jsonUnmarshalSet(buf, typ.(Set).ElementType, p) + + case typ.Is(Map{}): + return jsonUnmarshalMap(buf, typ.(Map).ElementType, p) + case typ.Is(Tuple{}): + return jsonUnmarshalTuple(buf, typ.(Tuple).ElementTypes, p) + case typ.Is(Object{}): + return jsonUnmarshalObject(buf, typ.(Object).AttributeTypes, p) + } + return Value{}, p.NewErrorf("unknown type %s", typ) +} + +func jsonUnmarshalString(buf []byte, _ Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + switch v := tok.(type) { + case string: + return NewValue(String, v), nil + case json.Number: + return NewValue(String, string(v)), nil + case bool: + if v { + return NewValue(String, "true"), nil + } + return NewValue(String, "false"), nil + } + return Value{}, p.NewErrorf("unsupported type %T sent as %s", tok, String) +} + +func jsonUnmarshalNumber(buf []byte, typ Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + switch numTok := tok.(type) { + case json.Number: + f, _, err := big.ParseFloat(string(numTok), 10, 512, big.ToNearestEven) + if err != nil { + return Value{}, p.NewErrorf("error parsing number: %w", err) + } + return NewValue(typ, f), nil + case string: + f, _, err := big.ParseFloat(numTok, 10, 512, big.ToNearestEven) + if err != nil { + return Value{}, p.NewErrorf("error parsing number: %w", err) + } + return NewValue(typ, f), nil + } + return Value{}, p.NewErrorf("unsupported type %T sent as %s", tok, Number) +} + +func jsonUnmarshalBool(buf []byte, _ Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + switch v := tok.(type) { + case bool: + return NewValue(Bool, v), nil + case string: + switch v { + case "true", "1": + return NewValue(Bool, true), nil + case "false", "0": + return NewValue(Bool, false), nil + } + switch strings.ToLower(v) { + case "true": + return Value{}, p.NewErrorf("to convert from string, use lowercase \"true\"") + case "false": + return Value{}, p.NewErrorf("to convert from string, use lowercase \"false\"") + } + case json.Number: + switch v { + case "1": + return NewValue(Bool, true), nil + case "0": + return NewValue(Bool, false), nil + } + } + return Value{}, p.NewErrorf("unsupported type %T sent as %s", tok, Bool) +} + +func jsonUnmarshalDynamicPseudoType(buf []byte, _ Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('{') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('{'), tok) + } + var t Type + var valBody []byte + for dec.More() { + tok, err = dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + key, ok := tok.(string) + if !ok { + return Value{}, p.NewErrorf("expected key to be a string, got %T", tok) + } + var rawVal json.RawMessage + err = dec.Decode(&rawVal) + if err != nil { + return Value{}, p.NewErrorf("error decoding value: %w", err) + } + switch key { + case "type": + t, err = ParseJSONType(rawVal) //nolint:staticcheck + if err != nil { + return Value{}, p.NewErrorf("error decoding type information: %w", err) + } + case "value": + valBody = rawVal + default: + return Value{}, p.NewErrorf("invalid key %q in dynamically-typed value", key) + } + } + tok, err = dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('}') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('}'), tok) + } + if t == nil { + return Value{}, p.NewErrorf("missing type in dynamically-typed value") + } + if valBody == nil { + return Value{}, p.NewErrorf("missing value in dynamically-typed value") + } + return jsonUnmarshal(valBody, t, p) +} + +func jsonUnmarshalList(buf []byte, elementType Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('[') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('['), tok) + } + + // we want to have a value for this always, even if there are no + // elements, because no elements is *technically* different than empty, + // and we want to preserve that distinction + // + // var vals []Value + // would evaluate as nil if the list is empty + // + // while generally in Go it's undesirable to treat empty and nil slices + // separately, in this case we're surfacing a non-Go-in-origin + // distinction, so we'll allow it. + vals := []Value{} + + var idx int + for dec.More() { + innerPath := p.WithElementKeyInt(idx) + // update the index + idx++ + + var rawVal json.RawMessage + err = dec.Decode(&rawVal) + if err != nil { + return Value{}, innerPath.NewErrorf("error decoding value: %w", err) + } + val, err := jsonUnmarshal(rawVal, elementType, innerPath) + if err != nil { + return Value{}, err + } + vals = append(vals, val) + } + + tok, err = dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim(']') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim(']'), tok) + } + + elTyp := elementType + if elTyp.Is(DynamicPseudoType) { + elTyp, err = TypeFromElements(vals) + if err != nil { + return Value{}, p.NewErrorf("invalid elements for list: %w", err) + } + } + return NewValue(List{ + ElementType: elTyp, + }, vals), nil +} + +func jsonUnmarshalSet(buf []byte, elementType Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('[') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('['), tok) + } + + // we want to have a value for this always, even if there are no + // elements, because no elements is *technically* different than empty, + // and we want to preserve that distinction + // + // var vals []Value + // would evaluate as nil if the set is empty + // + // while generally in Go it's undesirable to treat empty and nil slices + // separately, in this case we're surfacing a non-Go-in-origin + // distinction, so we'll allow it. + vals := []Value{} + + for dec.More() { + innerPath := p.WithElementKeyValue(NewValue(elementType, UnknownValue)) + var rawVal json.RawMessage + err = dec.Decode(&rawVal) + if err != nil { + return Value{}, innerPath.NewErrorf("error decoding value: %w", err) + } + val, err := jsonUnmarshal(rawVal, elementType, innerPath) + if err != nil { + return Value{}, err + } + vals = append(vals, val) + } + tok, err = dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim(']') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim(']'), tok) + } + + elTyp := elementType + if elTyp.Is(DynamicPseudoType) { + elTyp, err = TypeFromElements(vals) + if err != nil { + return Value{}, p.NewErrorf("invalid elements for list: %w", err) + } + } + return NewValue(Set{ + ElementType: elTyp, + }, vals), nil +} + +func jsonUnmarshalMap(buf []byte, attrType Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('{') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('{'), tok) + } + + vals := map[string]Value{} + for dec.More() { + innerPath := p.WithElementKeyValue(NewValue(attrType, UnknownValue)) + tok, err := dec.Token() + if err != nil { + return Value{}, innerPath.NewErrorf("error reading token: %w", err) + } + key, ok := tok.(string) + if !ok { + return Value{}, innerPath.NewErrorf("expected map key to be a string, got %T", tok) + } + + //fix the path value, we have an actual key now + innerPath = p.WithElementKeyString(key) + + var rawVal json.RawMessage + err = dec.Decode(&rawVal) + if err != nil { + return Value{}, innerPath.NewErrorf("error decoding value: %w", err) + } + val, err := jsonUnmarshal(rawVal, attrType, innerPath) + if err != nil { + return Value{}, err + } + vals[key] = val + } + tok, err = dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('}') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('}'), tok) + } + + return NewValue(Map{ + ElementType: attrType, + }, vals), nil +} + +func jsonUnmarshalTuple(buf []byte, elementTypes []Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('[') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('['), tok) + } + + // we want to have a value for this always, even if there are no + // elements, because no elements is *technically* different than empty, + // and we want to preserve that distinction + // + // var vals []Value + // would evaluate as nil if the tuple is empty + // + // while generally in Go it's undesirable to treat empty and nil slices + // separately, in this case we're surfacing a non-Go-in-origin + // distinction, so we'll allow it. + vals := []Value{} + + var idx int + for dec.More() { + if idx >= len(elementTypes) { + return Value{}, p.NewErrorf("too many tuple elements (only have types for %d)", len(elementTypes)) + } + + innerPath := p.WithElementKeyInt(idx) + elementType := elementTypes[idx] + idx++ + + var rawVal json.RawMessage + err = dec.Decode(&rawVal) + if err != nil { + return Value{}, innerPath.NewErrorf("error decoding value: %w", err) + } + val, err := jsonUnmarshal(rawVal, elementType, innerPath) + if err != nil { + return Value{}, err + } + vals = append(vals, val) + } + + tok, err = dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim(']') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim(']'), tok) + } + + if len(vals) != len(elementTypes) { + return Value{}, p.NewErrorf("not enough tuple elements (only have %d, have types for %d)", len(vals), len(elementTypes)) + } + + return NewValue(Tuple{ + ElementTypes: elementTypes, + }, vals), nil +} + +func jsonUnmarshalObject(buf []byte, attrTypes map[string]Type, p *AttributePath) (Value, error) { + dec := jsonByteDecoder(buf) + + tok, err := dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('{') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('{'), tok) + } + + vals := map[string]Value{} + for dec.More() { + innerPath := p.WithElementKeyValue(NewValue(String, UnknownValue)) + tok, err := dec.Token() + if err != nil { + return Value{}, innerPath.NewErrorf("error reading token: %w", err) + } + key, ok := tok.(string) + if !ok { + return Value{}, innerPath.NewErrorf("object attribute key was %T, not string", tok) + } + attrType, ok := attrTypes[key] + if !ok { + return Value{}, innerPath.NewErrorf("unsupported attribute %q", key) + } + innerPath = p.WithAttributeName(key) + + var rawVal json.RawMessage + err = dec.Decode(&rawVal) + if err != nil { + return Value{}, innerPath.NewErrorf("error decoding value: %w", err) + } + val, err := jsonUnmarshal(rawVal, attrType, innerPath) + if err != nil { + return Value{}, err + } + vals[key] = val + } + + tok, err = dec.Token() + if err != nil { + return Value{}, p.NewErrorf("error reading token: %w", err) + } + if tok != json.Delim('}') { + return Value{}, p.NewErrorf("invalid JSON, expected %q, got %q", json.Delim('}'), tok) + } + + // make sure we have a value for every attribute + for k, typ := range attrTypes { + if _, ok := vals[k]; !ok { + vals[k] = NewValue(typ, nil) + } + } + + return NewValue(Object{ + AttributeTypes: attrTypes, + }, vals), nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go new file mode 100644 index 000000000..c4047aeab --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/value_msgpack.go @@ -0,0 +1,571 @@ +package tftypes + +import ( + "bytes" + "fmt" + "math" + "math/big" + "sort" + + msgpack "github.com/vmihailenco/msgpack/v4" + msgpackCodes "github.com/vmihailenco/msgpack/v4/codes" +) + +type msgPackUnknownType struct{} + +var msgPackUnknownVal = msgPackUnknownType{} + +func (u msgPackUnknownType) MarshalMsgpack() ([]byte, error) { + return []byte{0xd4, 0, 0}, nil +} + +// ValueFromMsgPack returns a Value from the MsgPack-encoded bytes, using the +// provided Type to determine what shape the Value should be. +// DynamicPseudoTypes will be transparently parsed into the types they +// represent. +// +// Deprecated: this function is exported for internal use in +// terraform-plugin-go. Third parties should not use it, and its behavior is +// not covered under the API compatibility guarantees. Don't use this. +func ValueFromMsgPack(data []byte, typ Type) (Value, error) { + r := bytes.NewReader(data) + dec := msgpack.NewDecoder(r) + return msgpackUnmarshal(dec, typ, NewAttributePath()) +} + +func msgpackUnmarshal(dec *msgpack.Decoder, typ Type, path *AttributePath) (Value, error) { + peek, err := dec.PeekCode() + if err != nil { + return Value{}, path.NewErrorf("error peeking next byte: %w", err) + } + if msgpackCodes.IsExt(peek) { + // as with go-cty, assume all extensions are unknown values + err := dec.Skip() + if err != nil { + return Value{}, path.NewErrorf("error skipping extension byte: %w", err) + } + return NewValue(typ, UnknownValue), nil + } + if typ.Is(DynamicPseudoType) { + return msgpackUnmarshalDynamic(dec, path) + } + if peek == msgpackCodes.Nil { + err := dec.Skip() + if err != nil { + return Value{}, path.NewErrorf("error skipping nil byte: %w", err) + } + return NewValue(typ, nil), nil + } + + switch { + case typ.Is(String): + rv, err := dec.DecodeString() + if err != nil { + return Value{}, path.NewErrorf("error decoding string: %w", err) + } + return NewValue(String, rv), nil + case typ.Is(Number): + peek, err := dec.PeekCode() + if err != nil { + return Value{}, path.NewErrorf("couldn't peek number: %w", err) + } + if msgpackCodes.IsFixedNum(peek) { + rv, err := dec.DecodeInt64() + if err != nil { + return Value{}, path.NewErrorf("couldn't decode number as int64: %w", err) + } + return NewValue(Number, new(big.Float).SetInt64(rv)), nil + } + switch peek { + case msgpackCodes.Int8, msgpackCodes.Int16, msgpackCodes.Int32, msgpackCodes.Int64: + rv, err := dec.DecodeInt64() + if err != nil { + return Value{}, path.NewErrorf("couldn't decode number as int64: %w", err) + } + return NewValue(Number, new(big.Float).SetInt64(rv)), nil + case msgpackCodes.Uint8, msgpackCodes.Uint16, msgpackCodes.Uint32, msgpackCodes.Uint64: + rv, err := dec.DecodeUint64() + if err != nil { + return Value{}, path.NewErrorf("couldn't decode number as uint64: %w", err) + } + return NewValue(Number, new(big.Float).SetUint64(rv)), nil + case msgpackCodes.Float, msgpackCodes.Double: + rv, err := dec.DecodeFloat64() + if err != nil { + return Value{}, path.NewErrorf("couldn't decode number as float64: %w", err) + } + return NewValue(Number, big.NewFloat(rv)), nil + default: + rv, err := dec.DecodeString() + if err != nil { + return Value{}, path.NewErrorf("couldn't decode number as string: %w", err) + } + // according to + // https://github.com/hashicorp/go-cty/blob/85980079f637862fa8e43ddc82dd74315e2f4c85/cty/value_init.go#L49 + // Base 10, precision 512, and rounding to nearest even + // is the standard way to handle numbers arriving as + // strings. + fv, _, err := big.ParseFloat(rv, 10, 512, big.ToNearestEven) + if err != nil { + return Value{}, path.NewErrorf("error parsing %q as number: %w", rv, err) + } + return NewValue(Number, fv), nil + } + case typ.Is(Bool): + rv, err := dec.DecodeBool() + if err != nil { + return Value{}, path.NewErrorf("couldn't decode bool: %w", err) + } + return NewValue(Bool, rv), nil + case typ.Is(List{}): + return msgpackUnmarshalList(dec, typ.(List).ElementType, path) + case typ.Is(Set{}): + return msgpackUnmarshalSet(dec, typ.(Set).ElementType, path) + case typ.Is(Map{}): + return msgpackUnmarshalMap(dec, typ.(Map).ElementType, path) + case typ.Is(Tuple{}): + return msgpackUnmarshalTuple(dec, typ.(Tuple).ElementTypes, path) + case typ.Is(Object{}): + return msgpackUnmarshalObject(dec, typ.(Object).AttributeTypes, path) + } + return Value{}, path.NewErrorf("unsupported type %s", typ.String()) +} + +func msgpackUnmarshalList(dec *msgpack.Decoder, typ Type, path *AttributePath) (Value, error) { + length, err := dec.DecodeArrayLen() + if err != nil { + return Value{}, path.NewErrorf("error decoding list length: %w", err) + } + + switch { + case length < 0: + return NewValue(List{ + ElementType: typ, + }, nil), nil + case length == 0: + return NewValue(List{ + ElementType: typ, + }, []Value{}), nil + } + + vals := make([]Value, 0, length) + for i := 0; i < length; i++ { + innerPath := path.WithElementKeyInt(i) + val, err := msgpackUnmarshal(dec, typ, innerPath) + if err != nil { + return Value{}, err + } + vals = append(vals, val) + } + + elTyp := typ + if elTyp.Is(DynamicPseudoType) { + elTyp, err = TypeFromElements(vals) + if err != nil { + return Value{}, err + } + } + + return NewValue(List{ + ElementType: elTyp, + }, vals), nil +} + +func msgpackUnmarshalSet(dec *msgpack.Decoder, typ Type, path *AttributePath) (Value, error) { + length, err := dec.DecodeArrayLen() + if err != nil { + return Value{}, path.NewErrorf("error decoding set length: %w", err) + } + + switch { + case length < 0: + return NewValue(Set{ + ElementType: typ, + }, nil), nil + case length == 0: + return NewValue(Set{ + ElementType: typ, + }, []Value{}), nil + } + + vals := make([]Value, 0, length) + for i := 0; i < length; i++ { + innerPath := path.WithElementKeyInt(i) + val, err := msgpackUnmarshal(dec, typ, innerPath) + if err != nil { + return Value{}, err + } + vals = append(vals, val) + } + + elTyp, err := TypeFromElements(vals) + if err != nil { + return Value{}, err + } + + return NewValue(Set{ + ElementType: elTyp, + }, vals), nil +} + +func msgpackUnmarshalMap(dec *msgpack.Decoder, typ Type, path *AttributePath) (Value, error) { + length, err := dec.DecodeMapLen() + if err != nil { + return Value{}, path.NewErrorf("error decoding map length: %w", err) + } + + switch { + case length < 0: + return NewValue(Map{ + ElementType: typ, + }, nil), nil + case length == 0: + return NewValue(Map{ + ElementType: typ, + }, map[string]Value{}), nil + } + + vals := make(map[string]Value, length) + for i := 0; i < length; i++ { + key, err := dec.DecodeString() + if err != nil { + return Value{}, path.NewErrorf("error decoding map key: %w", err) + } + innerPath := path.WithElementKeyString(key) + val, err := msgpackUnmarshal(dec, typ, innerPath) + if err != nil { + return Value{}, err + } + vals[key] = val + } + + return NewValue(Map{ + ElementType: typ, + }, vals), nil +} + +func msgpackUnmarshalTuple(dec *msgpack.Decoder, types []Type, path *AttributePath) (Value, error) { + length, err := dec.DecodeArrayLen() + if err != nil { + return Value{}, path.NewErrorf("error decoding tuple length: %w", err) + } + + switch { + case length < 0: + return NewValue(Tuple{ + ElementTypes: types, + }, nil), nil + case length != len(types): + return Value{}, path.NewErrorf("error decoding tuple; expected %d items, got %d", len(types), length) + } + + vals := make([]Value, 0, length) + for i := 0; i < length; i++ { + innerPath := path.WithElementKeyInt(i) + typ := types[i] + val, err := msgpackUnmarshal(dec, typ, innerPath) + if err != nil { + return Value{}, err + } + vals = append(vals, val) + } + + return NewValue(Tuple{ + ElementTypes: types, + }, vals), nil +} + +func msgpackUnmarshalObject(dec *msgpack.Decoder, types map[string]Type, path *AttributePath) (Value, error) { + length, err := dec.DecodeMapLen() + if err != nil { + return Value{}, path.NewErrorf("error decoding object length: %w", err) + } + + switch { + case length < 0: + return NewValue(Object{ + AttributeTypes: types, + }, nil), nil + case length != len(types): + return Value{}, path.NewErrorf("error decoding object; expected %d attributes, got %d", len(types), length) + } + + vals := make(map[string]Value, length) + for i := 0; i < length; i++ { + key, err := dec.DecodeString() + if err != nil { + return Value{}, path.NewErrorf("error decoding object key: %w", err) + } + typ, exists := types[key] + if !exists { + return Value{}, path.NewErrorf("unknown attribute %q", key) + } + innerPath := path.WithAttributeName(key) + val, err := msgpackUnmarshal(dec, typ, innerPath) + if err != nil { + return Value{}, err + } + vals[key] = val + } + + return NewValue(Object{ + AttributeTypes: types, + }, vals), nil +} + +func msgpackUnmarshalDynamic(dec *msgpack.Decoder, path *AttributePath) (Value, error) { + length, err := dec.DecodeArrayLen() + if err != nil { + return Value{}, path.NewErrorf("error checking length of DynamicPseudoType value: %w", err) + } + + switch { + case length == -1: + return newValue(DynamicPseudoType, nil) + case length != 2: + return Value{}, path.NewErrorf("expected %d elements in DynamicPseudoType array, got %d", 2, length) + } + + typeJSON, err := dec.DecodeBytes() + if err != nil { + return Value{}, path.NewErrorf("error decoding bytes: %w", err) + } + typ, err := ParseJSONType(typeJSON) //nolint:staticcheck + if err != nil { + return Value{}, path.NewErrorf("error parsing type information: %w", err) + } + return msgpackUnmarshal(dec, typ, path) +} + +func marshalMsgPack(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + if typ.Is(DynamicPseudoType) && !val.Type().Is(DynamicPseudoType) { + return marshalMsgPackDynamicPseudoType(val, typ, p, enc) + + } + if !val.IsKnown() { + err := enc.Encode(msgPackUnknownVal) + if err != nil { + return p.NewErrorf("error encoding UnknownValue: %w", err) + } + return nil + } + if val.IsNull() { + err := enc.EncodeNil() + if err != nil { + return p.NewErrorf("error encoding null value: %w", err) + } + return nil + } + switch { + case typ.Is(String): + return marshalMsgPackString(val, typ, p, enc) + case typ.Is(Number): + return marshalMsgPackNumber(val, typ, p, enc) + case typ.Is(Bool): + return marshalMsgPackBool(val, typ, p, enc) + case typ.Is(List{}): + return marshalMsgPackList(val, typ, p, enc) + case typ.Is(Set{}): + return marshalMsgPackSet(val, typ, p, enc) + case typ.Is(Map{}): + return marshalMsgPackMap(val, typ, p, enc) + case typ.Is(Tuple{}): + return marshalMsgPackTuple(val, typ, p, enc) + case typ.Is(Object{}): + return marshalMsgPackObject(val, typ, p, enc) + } + return fmt.Errorf("unknown type %s", typ) +} + +func marshalMsgPackDynamicPseudoType(val Value, _ Type, p *AttributePath, enc *msgpack.Encoder) error { + typeJSON, err := val.Type().MarshalJSON() + if err != nil { + return p.NewErrorf("error generating JSON for type %s: %w", val.Type(), err) + } + err = enc.EncodeArrayLen(2) + if err != nil { + return p.NewErrorf("error encoding array length: %w", err) + } + err = enc.EncodeBytes(typeJSON) + if err != nil { + return p.NewErrorf("error encoding JSON type info: %w", err) + } + err = marshalMsgPack(val, val.Type(), p, enc) + if err != nil { + return p.NewErrorf("error marshaling DynamicPseudoType value: %w", err) + } + return nil +} + +func marshalMsgPackString(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + s, ok := val.value.(string) + if !ok { + return unexpectedValueTypeError(p, s, val.value, typ) + } + err := enc.EncodeString(s) + if err != nil { + return p.NewErrorf("error encoding string value: %w", err) + } + return nil +} + +func marshalMsgPackNumber(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + n, ok := val.value.(*big.Float) + if !ok { + return unexpectedValueTypeError(p, n, val.value, typ) + } + if n.IsInf() { + if n.Sign() == -1 { + err := enc.EncodeFloat64(math.Inf(-1)) + if err != nil { + return p.NewErrorf("error encoding negative infinity: %w", err) + } + } else if n.Sign() == 1 { + err := enc.EncodeFloat64(math.Inf(1)) + if err != nil { + return p.NewErrorf("error encoding positive infinity: %w", err) + } + } else { + return p.NewErrorf("error encoding unknown infiniy: sign %d is unknown", n.Sign()) + } + } else if iv, acc := n.Int64(); acc == big.Exact { + err := enc.EncodeInt(iv) + if err != nil { + return p.NewErrorf("error encoding int value: %w", err) + } + } else if fv, acc := n.Float64(); acc == big.Exact { + err := enc.EncodeFloat64(fv) + if err != nil { + return p.NewErrorf("error encoding float value: %w", err) + } + } else { + err := enc.EncodeString(n.Text('f', -1)) + if err != nil { + return p.NewErrorf("error encoding number string value: %w", err) + } + } + return nil +} + +func marshalMsgPackBool(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + b, ok := val.value.(bool) + if !ok { + return unexpectedValueTypeError(p, b, val.value, typ) + } + err := enc.EncodeBool(b) + if err != nil { + return p.NewErrorf("error encoding bool value: %w", err) + } + return nil +} + +func marshalMsgPackList(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + l, ok := val.value.([]Value) + if !ok { + return unexpectedValueTypeError(p, l, val.value, typ) + } + err := enc.EncodeArrayLen(len(l)) + if err != nil { + return p.NewErrorf("error encoding list length: %w", err) + } + for pos, i := range l { + err := marshalMsgPack(i, typ.(List).ElementType, p.WithElementKeyInt(pos), enc) + if err != nil { + return err + } + } + return nil +} + +func marshalMsgPackSet(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + s, ok := val.value.([]Value) + if !ok { + return unexpectedValueTypeError(p, s, val.value, typ) + } + err := enc.EncodeArrayLen(len(s)) + if err != nil { + return p.NewErrorf("error encoding set length: %w", err) + } + for _, i := range s { + err := marshalMsgPack(i, typ.(Set).ElementType, p.WithElementKeyValue(i), enc) + if err != nil { + return err + } + } + return nil +} + +func marshalMsgPackMap(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + m, ok := val.value.(map[string]Value) + if !ok { + return unexpectedValueTypeError(p, m, val.value, typ) + } + err := enc.EncodeMapLen(len(m)) + if err != nil { + return p.NewErrorf("error encoding map length: %w", err) + } + for k, v := range m { + err := marshalMsgPack(NewValue(String, k), String, p.WithElementKeyString(k), enc) + if err != nil { + return p.NewErrorf("error encoding map key: %w", err) + } + err = marshalMsgPack(v, typ.(Map).ElementType, p, enc) + if err != nil { + return err + } + } + return nil +} + +func marshalMsgPackTuple(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + t, ok := val.value.([]Value) + if !ok { + return unexpectedValueTypeError(p, t, val.value, typ) + } + types := typ.(Tuple).ElementTypes + err := enc.EncodeArrayLen(len(types)) + if err != nil { + return p.NewErrorf("error encoding tuple length: %w", err) + } + for pos, v := range t { + ty := types[pos] + err := marshalMsgPack(v, ty, p.WithElementKeyInt(pos), enc) + if err != nil { + return err + } + } + return nil +} + +func marshalMsgPackObject(val Value, typ Type, p *AttributePath, enc *msgpack.Encoder) error { + o, ok := val.value.(map[string]Value) + if !ok { + return unexpectedValueTypeError(p, o, val.value, typ) + } + types := typ.(Object).AttributeTypes + keys := make([]string, 0, len(types)) + for k := range types { + keys = append(keys, k) + } + sort.Strings(keys) + err := enc.EncodeMapLen(len(keys)) + if err != nil { + return p.NewErrorf("error encoding object length: %w", err) + } + for _, k := range keys { + ty := types[k] + v, ok := o[k] + if !ok { + return p.WithAttributeName(k).NewErrorf("no value set") + } + err := marshalMsgPack(NewValue(String, k), String, p.WithAttributeName(k), enc) + if err != nil { + return err + } + err = marshalMsgPack(v, ty, p.WithAttributeName(k), enc) + if err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go new file mode 100644 index 000000000..6b26f8ff3 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/walk.go @@ -0,0 +1,197 @@ +package tftypes + +// these functions are based heavily on github.com/zclconf/go-cty +// used under the MIT License +// +// Copyright (c) 2017-2018 Martin Atkins +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +import ( + "errors" +) + +// Walk traverses a Value, calling the passed function for every element and +// attribute in the Value. The AttributePath passed to the callback function +// will identify which attribute or element is currently being surfaced by the +// Walk, and the passed Value will be the element or attribute at that +// AttributePath. Returning true from the callback function will indicate that +// any attributes or elements of the surfaced Value should be walked, too; +// returning false short-circuits the walk at that element or attribute, and +// does not visit any of its descendants. The return value of the callback does +// not matter when the Value that has been surfaced has no elements or +// attributes. Walk uses a depth-first traversal. +func Walk(val Value, cb func(*AttributePath, Value) (bool, error)) error { + return walk(nil, val, cb) +} + +func walk(path *AttributePath, val Value, cb func(*AttributePath, Value) (bool, error)) error { + shouldContinue, err := cb(path, val) + if err != nil { + return path.NewError(err) + } + if !shouldContinue { + return nil + } + + if val.IsNull() || !val.IsKnown() { + return nil + } + + ty := val.Type() + switch { + case ty.Is(List{}), ty.Is(Set{}), ty.Is(Tuple{}): + var v []Value + err := val.As(&v) + if err != nil { + // should never happen + return path.NewError(err) + } + for pos, el := range v { + if ty.Is(Set{}) { + path = path.WithElementKeyValue(el) + } else { + path = path.WithElementKeyInt(pos) + } + err = walk(path, el, cb) + if err != nil { + return path.NewError(err) + } + path = path.WithoutLastStep() + } + case ty.Is(Map{}), ty.Is(Object{}): + v := map[string]Value{} + err := val.As(&v) + if err != nil { + // should never happen + return err + } + for k, el := range v { + if ty.Is(Map{}) { + path = path.WithElementKeyString(k) + } else if ty.Is(Object{}) { + path = path.WithAttributeName(k) + } + err = walk(path, el, cb) + if err != nil { + return path.NewError(err) + } + path = path.WithoutLastStep() + } + } + + return nil +} + +// Transform uses a callback to mutate a Value. Each element or attribute will +// be visited in turn, with the AttributePath and Value surfaced to the +// callback, as in Walk. Unlike in Walk, the callback returns a Value instead +// of a boolean; this is the Value that will be stored at that AttributePath. +// The callback must return the passed Value unmodified if it wishes to not +// mutate a Value. Elements and attributes of a Value will be passed to the +// callback prior to the Value they belong to being passed to the callback, +// which means a callback can overwrite its own modifications. Values passed to +// the callback will always reflect the results of earlier callback calls. +func Transform(val Value, cb func(*AttributePath, Value) (Value, error)) (Value, error) { + return transform(NewAttributePath(), val, cb) +} + +func transform(path *AttributePath, val Value, cb func(*AttributePath, Value) (Value, error)) (Value, error) { + var newVal Value + ty := val.Type() + + if ty == nil { + return val, path.NewError(errors.New("invalid transform: value missing type")) + } + + switch { + case val.IsNull() || !val.IsKnown(): + newVal = val + case ty.Is(List{}), ty.Is(Set{}), ty.Is(Tuple{}): + var v []Value + err := val.As(&v) + if err != nil { + return val, err + } + if len(v) == 0 { + newVal = val + } else { + elems := make([]Value, 0, len(v)) + for pos, el := range v { + if ty.Is(Set{}) { + path = path.WithElementKeyValue(el) + } else { + path = path.WithElementKeyInt(pos) + } + newEl, err := transform(path, el, cb) + if err != nil { + return val, path.NewError(err) + } + elems = append(elems, newEl) + path = path.WithoutLastStep() + } + newVal, err = newValue(ty, elems) + if err != nil { + return val, path.NewError(err) + } + } + case ty.Is(Map{}), ty.Is(Object{}): + v := map[string]Value{} + err := val.As(&v) + if err != nil { + return val, err + } + if len(v) == 0 { + newVal = val + } else { + elems := map[string]Value{} + for k, el := range v { + if ty.Is(Map{}) { + path = path.WithElementKeyString(k) + } else { + path = path.WithAttributeName(k) + } + newEl, err := transform(path, el, cb) + if err != nil { + return val, path.NewError(err) + } + elems[k] = newEl + path = path.WithoutLastStep() + } + newVal, err = newValue(ty, elems) + if err != nil { + return val, path.NewError(err) + } + } + default: + newVal = val + } + res, err := cb(path, newVal) + if err != nil { + return res, path.NewError(err) + } + newTy := newVal.Type() + if newTy == nil { + return val, path.NewError(errors.New("invalid transform: new value missing type")) + } + if !newTy.UsableAs(ty) { + return val, path.NewError(errors.New("invalid transform: value changed type")) + } + return res, err +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/LICENSE b/vendor/github.com/hashicorp/terraform-plugin-log/LICENSE new file mode 100644 index 000000000..c33dcc7c9 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/args.go b/vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/args.go new file mode 100644 index 000000000..220120f77 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/args.go @@ -0,0 +1,36 @@ +package hclogutils + +// MapsToArgs will shallow merge field maps into the slice of key1, value1, +// key2, value2, ... arguments expected by hc-log.Logger methods. +func MapsToArgs(maps ...map[string]interface{}) []interface{} { + switch len(maps) { + case 0: + return nil + case 1: + result := make([]interface{}, 0, len(maps[0])*2) + + for k, v := range maps[0] { + result = append(result, k) + result = append(result, v) + } + + return result + default: + mergedMap := make(map[string]interface{}, 0) + + for _, m := range maps { + for k, v := range m { + mergedMap[k] = v + } + } + + result := make([]interface{}, 0, len(mergedMap)*2) + + for k, v := range mergedMap { + result = append(result, k) + result = append(result, v) + } + + return result + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/logger_options.go b/vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/logger_options.go new file mode 100644 index 000000000..a0ec34e20 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/internal/hclogutils/logger_options.go @@ -0,0 +1,29 @@ +package hclogutils + +import ( + "github.com/hashicorp/go-hclog" +) + +// LoggerOptionsCopy will safely copy LoggerOptions. Manually implemented +// to save importing a dependency such as github.com/mitchellh/copystructure. +func LoggerOptionsCopy(src *hclog.LoggerOptions) *hclog.LoggerOptions { + if src == nil { + return nil + } + + return &hclog.LoggerOptions{ + AdditionalLocationOffset: src.AdditionalLocationOffset, + Color: src.Color, + DisableTime: src.DisableTime, + Exclude: src.Exclude, + IncludeLocation: src.IncludeLocation, + IndependentLevels: src.IndependentLevels, + JSONFormat: src.JSONFormat, + Level: src.Level, + Mutex: src.Mutex, + Name: src.Name, + Output: src.Output, + TimeFormat: src.TimeFormat, + TimeFn: src.TimeFn, + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/log.go b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/log.go new file mode 100644 index 000000000..983bc874d --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/log.go @@ -0,0 +1,73 @@ +package logging + +import ( + "io" + "os" +) + +const ( + // Default provider root logger name. + DefaultProviderRootLoggerName string = "provider" + + // Default SDK root logger name. + DefaultSDKRootLoggerName string = "sdk" +) + +// loggerKey defines context keys for locating loggers in context.Context +// it's a private type to make sure no other packages can override the key +type loggerKey string + +const ( + // ProviderRootLoggerKey is the loggerKey that will hold the root + // logger for writing logs from within provider code. + ProviderRootLoggerKey loggerKey = "provider" + + // ProviderRootLoggerOptionsKey is the loggerKey that will hold the root + // logger options when the root provider logger is created. This is to + // assist creating subsystem loggers, as most options cannot be fetched and + // a logger does not provide set methods for these options. + ProviderRootLoggerOptionsKey loggerKey = "provider-options" + + // SDKRootLoggerKey is the loggerKey that will hold the root logger for + // writing logs from with SDKs. + SDKRootLoggerKey loggerKey = "sdk" + + // SDKRootLoggerOptionsKey is the loggerKey that will hold the root + // logger options when the SDK provider logger is created. This is to + // assist creating subsystem loggers, as most options cannot be fetched and + // a logger does not provide set methods for these options. + SDKRootLoggerOptionsKey loggerKey = "sdk-options" + + // SinkKey is the loggerKey that will hold the logging sink used for + // test frameworks. + SinkKey loggerKey = "" + + // SinkOptionsKey is the loggerKey that will hold the sink + // logger options when the SDK provider logger is created. This is to + // assist creating subsystem loggers, as most options cannot be fetched and + // a logger does not provide set methods for these options. + SinkOptionsKey loggerKey = "sink-options" +) + +var ( + // Stderr caches the original os.Stderr when the process is started. + // + // When go-plugin.Serve is called, it overwrites our os.Stderr with a + // gRPC stream which Terraform ignores. This tends to be before our + // loggers get set up, as go-plugin has no way to pass in a base + // context, and our loggers are passed around via contexts. This leaves + // our loggers writing to an output that is never read by anything, + // meaning the logs get blackholed. This isn't ideal, for log output, + // so this is our workaround: we copy stderr on init, before Serve can + // be called, and offer an option to write to that instead of the + // os.Stderr available at runtime. + // + // Ideally, this is a short-term fix until Terraform starts reading + // from go-plugin's gRPC-streamed stderr channel, but for the moment it + // works. + Stderr io.Writer +) + +func init() { + Stderr = os.Stderr +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/options.go b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/options.go new file mode 100644 index 000000000..02891a330 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/options.go @@ -0,0 +1,116 @@ +package logging + +import ( + "io" + "os" + + "github.com/hashicorp/go-hclog" +) + +// Option defines a modification to the configuration for a logger. +type Option func(LoggerOpts) LoggerOpts + +// LoggerOpts is a collection of configuration settings for loggers. +type LoggerOpts struct { + // Name is the name or "@module" of a logger. + Name string + + // Level is the most verbose level that a logger will write logs for. + Level hclog.Level + + // IncludeLocation indicates whether logs should include the location + // of the logging statement or not. + IncludeLocation bool + + // AdditionalLocationOffset is the number of additional stack levels to + // skip when finding the file and line information for the log line. + // Defaults to 1 to account for the tflog and tfsdklog logging functions. + AdditionalLocationOffset int + + // Output dictates where logs are written to. Output should only ever + // be set by tflog or tfsdklog, never by SDK authors or provider + // developers. Where logs get written to is complex and delicate and + // requires a deep understanding of Terraform's architecture, and it's + // easy to mess up on accident. + Output io.Writer + + // IncludeTime indicates whether logs should incude the time they were + // written or not. It should only be set to true when testing tflog or + // tfsdklog; providers and SDKs should always include the time logs + // were written as part of the log. + IncludeTime bool + + // IncludeRootFields indicates whether a new subsystem logger should + // copy existing fields from the root logger. This is only performed + // at the time of new subsystem creation. + IncludeRootFields bool +} + +// ApplyLoggerOpts generates a LoggerOpts out of a list of Option +// implementations. By default, AdditionalLocationOffset is 1, IncludeLocation +// is true, IncludeTime is true, and Output is os.Stderr. +func ApplyLoggerOpts(opts ...Option) LoggerOpts { + // set some defaults + l := LoggerOpts{ + AdditionalLocationOffset: 1, + IncludeLocation: true, + IncludeTime: true, + Output: os.Stderr, + } + for _, opt := range opts { + l = opt(l) + } + return l +} + +// WithAdditionalLocationOffset sets the WithAdditionalLocationOffset +// configuration option, allowing implementations to fix location information +// when implementing helper functions. The default offset of 1 is automatically +// added to the provided value to account for the tflog and tfsdk logging +// functions. +func WithAdditionalLocationOffset(additionalLocationOffset int) Option { + return func(l LoggerOpts) LoggerOpts { + l.AdditionalLocationOffset = additionalLocationOffset + 1 + return l + } +} + +// WithOutput sets the Output configuration option, controlling where logs get +// written to. This is mostly used for testing (to write to os.Stdout, so the +// test framework can compare it against the example output) and as a helper +// when implementing safe, specific output strategies in tfsdklog. +func WithOutput(output io.Writer) Option { + return func(l LoggerOpts) LoggerOpts { + l.Output = output + return l + } +} + +// WithRootFields enables the copying of root logger fields to a new subsystem +// logger during creation. +func WithRootFields() Option { + return func(l LoggerOpts) LoggerOpts { + l.IncludeRootFields = true + return l + } +} + +// WithoutLocation disables the location included with logging statements. It +// should only ever be used to make log output deterministic when testing +// terraform-plugin-log. +func WithoutLocation() Option { + return func(l LoggerOpts) LoggerOpts { + l.IncludeLocation = false + return l + } +} + +// WithoutTimestamp disables the timestamp included with logging statements. It +// should only ever be used to make log output deterministic when testing +// terraform-plugin-log. +func WithoutTimestamp() Option { + return func(l LoggerOpts) LoggerOpts { + l.IncludeTime = false + return l + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/provider.go b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/provider.go new file mode 100644 index 000000000..b40a12f83 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/provider.go @@ -0,0 +1,74 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/go-hclog" +) + +// GetProviderRootLogger returns the root logger used for writing logs +// from a provider. If no root logger has been created, it will return nil. +func GetProviderRootLogger(ctx context.Context) hclog.Logger { + logger := ctx.Value(ProviderRootLoggerKey) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// GetProviderRootLoggerOptions returns the root logger options used for +// creating the root provider logger. If the root logger has not been created +// or the options are not present, it will return nil. +func GetProviderRootLoggerOptions(ctx context.Context) *hclog.LoggerOptions { + if GetProviderRootLogger(ctx) == nil { + return nil + } + + loggerOptionsRaw := ctx.Value(ProviderRootLoggerOptionsKey) + + if loggerOptionsRaw == nil { + return nil + } + + loggerOptions, ok := loggerOptionsRaw.(*hclog.LoggerOptions) + + if !ok { + return nil + } + + return loggerOptions +} + +// SetProviderRootLogger sets `logger` as the root logger used for writing +// logs from a provider. +func SetProviderRootLogger(ctx context.Context, logger hclog.Logger) context.Context { + return context.WithValue(ctx, ProviderRootLoggerKey, logger) +} + +// SetProviderRootLoggerOptions sets `loggerOptions` as the root logger options +// used for creating the provider root logger. +func SetProviderRootLoggerOptions(ctx context.Context, loggerOptions *hclog.LoggerOptions) context.Context { + return context.WithValue(ctx, ProviderRootLoggerOptionsKey, loggerOptions) +} + +// NewProviderSubsystemLoggerWarning is the text included in log output when a +// subsystem is auto-generated by terraform-plugin-log because it was used +// before the provider instantiated it. +const NewProviderSubsystemLoggerWarning = "This log was generated by a subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." + +// GetProviderSubsystemLogger returns the subsystem logger for the named +// subsystem in provider space. If no such subsystem logger has been created, +// it will return nil. +func GetProviderSubsystemLogger(ctx context.Context, subsystem string) hclog.Logger { + logger := ctx.Value(ProviderRootLoggerKey + loggerKey("."+subsystem)) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// SetProviderSubsystemLogger sets `logger` as the logger for the named +// subsystem in provider space. +func SetProviderSubsystemLogger(ctx context.Context, subsystem string, logger hclog.Logger) context.Context { + return context.WithValue(ctx, ProviderRootLoggerKey+loggerKey("."+subsystem), logger) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sdk.go b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sdk.go new file mode 100644 index 000000000..3c6772b53 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sdk.go @@ -0,0 +1,74 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/go-hclog" +) + +// GetSDKRootLogger returns the root logger used for writing logs from an SDK. +// If no root logger has been created, it will return nil. +func GetSDKRootLogger(ctx context.Context) hclog.Logger { + logger := ctx.Value(SDKRootLoggerKey) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// GetSDKRootLoggerOptions returns the root logger options used for +// creating the root SDK logger. If the root logger has not been created or +// the options are not present, it will return nil. +func GetSDKRootLoggerOptions(ctx context.Context) *hclog.LoggerOptions { + if GetSDKRootLogger(ctx) == nil { + return nil + } + + loggerOptionsRaw := ctx.Value(SDKRootLoggerOptionsKey) + + if loggerOptionsRaw == nil { + return nil + } + + loggerOptions, ok := loggerOptionsRaw.(*hclog.LoggerOptions) + + if !ok { + return nil + } + + return loggerOptions +} + +// SetSDKRootLogger sets `logger` as the root logger used for writing logs from +// an SDK. +func SetSDKRootLogger(ctx context.Context, logger hclog.Logger) context.Context { + return context.WithValue(ctx, SDKRootLoggerKey, logger) +} + +// SetSDKRootLoggerOptions sets `loggerOptions` as the root logger options +// used for creating the SDK root logger. +func SetSDKRootLoggerOptions(ctx context.Context, loggerOptions *hclog.LoggerOptions) context.Context { + return context.WithValue(ctx, SDKRootLoggerOptionsKey, loggerOptions) +} + +// NewSDKSubsystemLoggerWarning is the text included in log output when a +// subsystem is auto-generated by terraform-plugin-log because it was used +// before the SDK instantiated it. +const NewSDKSubsystemLoggerWarning = "This log was generated by an SDK subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." + +// GetSDKSubsystemLogger returns the subsystem logger for the named subsystem +// in SDK space. If no such subsystem logger has been created, it will return +// nil. +func GetSDKSubsystemLogger(ctx context.Context, subsystem string) hclog.Logger { + logger := ctx.Value(SDKRootLoggerKey + loggerKey("."+subsystem)) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// SetSDKSubsystemLogger sets `logger` as the logger for the named subsystem in +// SDK space. +func SetSDKSubsystemLogger(ctx context.Context, subsystem string, logger hclog.Logger) context.Context { + return context.WithValue(ctx, SDKRootLoggerKey+loggerKey("."+subsystem), logger) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sink.go b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sink.go new file mode 100644 index 000000000..d48f3bf4c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/internal/logging/sink.go @@ -0,0 +1,51 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/go-hclog" +) + +// GetSink returns the sink logger used for writing logs. +// If no sink logger has been created, it will return nil. +func GetSink(ctx context.Context) hclog.Logger { + logger := ctx.Value(SinkKey) + if logger == nil { + return nil + } + return logger.(hclog.Logger) +} + +// GetSinkOptions returns the root logger options used for +// creating the root SDK logger. If the root logger has not been created or +// the options are not present, it will return nil. +func GetSinkOptions(ctx context.Context) *hclog.LoggerOptions { + if GetSink(ctx) == nil { + return nil + } + + loggerOptionsRaw := ctx.Value(SinkOptionsKey) + + if loggerOptionsRaw == nil { + return nil + } + + loggerOptions, ok := loggerOptionsRaw.(*hclog.LoggerOptions) + + if !ok { + return nil + } + + return loggerOptions +} + +// SetSink sets `logger` as the sink logger used for writing logs. +func SetSink(ctx context.Context, logger hclog.Logger) context.Context { + return context.WithValue(ctx, SinkKey, logger) +} + +// SetSinkOptions sets `loggerOptions` as the root logger options +// used for creating the SDK root logger. +func SetSinkOptions(ctx context.Context, loggerOptions *hclog.LoggerOptions) context.Context { + return context.WithValue(ctx, SinkOptionsKey, loggerOptions) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tflog/doc.go b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/doc.go new file mode 100644 index 000000000..97ca21884 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/doc.go @@ -0,0 +1,13 @@ +// Package tflog provides helper functions for writing log output and creating +// loggers for Terraform plugins. +// +// For most plugin authors, building on an SDK or framework, the SDK or +// framework will take care of injecting a logger using New. +// +// tflog also allows plugin authors to create subsystem loggers, which are +// loggers for sufficiently distinct areas of the codebase or concerns. The +// benefit of using distinct loggers for these concerns is doing so allows +// plugin authors and practitioners to configure different log levels for each +// subsystem's log, allowing log output to be turned on or off without +// recompiling. +package tflog diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tflog/options.go b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/options.go new file mode 100644 index 000000000..750177812 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/options.go @@ -0,0 +1,60 @@ +package tflog + +import ( + "os" + "strings" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// Options are a collection of logging options, useful for collecting arguments +// to NewSubsystem prior to calling it. +type Options []logging.Option + +// WithAdditionalLocationOffset returns an option that allowing implementations +// to fix location information when implementing helper functions. The default +// offset of 1 is automatically added to the provided value to account for the +// tflog logging functions. +func WithAdditionalLocationOffset(additionalLocationOffset int) logging.Option { + return logging.WithAdditionalLocationOffset(additionalLocationOffset) +} + +// WithLevelFromEnv returns an option that will set the level of the logger +// based on the string in an environment variable. The environment variable +// checked will be `name` and `subsystems`, joined by _ and in all caps. +func WithLevelFromEnv(name string, subsystems ...string) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + envVar := strings.Join(subsystems, "_") + if envVar != "" { + envVar = "_" + envVar + } + envVar = strings.ToUpper(name + envVar) + l.Level = hclog.LevelFromString(os.Getenv(envVar)) + return l + } +} + +// WithLevel returns an option that will set the level of the logger. +func WithLevel(level hclog.Level) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.Level = level + return l + } +} + +// WithRootFields enables the copying of root logger fields to a new subsystem +// logger during creation. +func WithRootFields() logging.Option { + return logging.WithRootFields() +} + +// WithoutLocation returns an option that disables including the location of +// the log line in the log output, which is on by default. This has no effect +// when used with NewSubsystem. +func WithoutLocation() logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.IncludeLocation = false + return l + } +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tflog/provider.go b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/provider.go new file mode 100644 index 000000000..e450e3bb6 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/provider.go @@ -0,0 +1,108 @@ +package tflog + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/internal/hclogutils" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// With returns a new context.Context that has a modified logger in it which +// will include key and value as arguments in all its log output. +func With(ctx context.Context, key string, value interface{}) context.Context { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return ctx + } + return logging.SetProviderRootLogger(ctx, logger.With(key, value)) +} + +// Trace logs `msg` at the trace level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Trace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Trace(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Debug logs `msg` at the debug level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Debug(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Debug(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Info logs `msg` at the info level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Info(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Info(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Warn logs `msg` at the warn level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Warn(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Warn(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Error logs `msg` at the error level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Error(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return + } + logger.Error(msg, hclogutils.MapsToArgs(additionalFields...)...) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tflog/subsystem.go b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/subsystem.go new file mode 100644 index 000000000..5cf08f22b --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tflog/subsystem.go @@ -0,0 +1,185 @@ +package tflog + +import ( + "context" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/hclogutils" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// NewSubsystem returns a new context.Context that contains a subsystem logger +// configured with the passed options, named after the subsystem argument. +// +// Subsystem loggers allow different areas of a plugin codebase to use +// different logging levels, giving developers more fine-grained control over +// what is logging and with what verbosity. They're best utilized for logical +// concerns that are sometimes helpful to log, but may generate unwanted noise +// at other times. +// +// The only Options supported for subsystems are the Options for setting the +// level and additional location offset of the logger. +func NewSubsystem(ctx context.Context, subsystem string, options ...logging.Option) context.Context { + logger := logging.GetProviderRootLogger(ctx) + + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever SDK the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return ctx + } + + loggerOptions := logging.GetProviderRootLoggerOptions(ctx) + opts := logging.ApplyLoggerOpts(options...) + + // On the off-chance that the logger options are not available, fallback + // to creating a named logger. This will preserve the root logger options, + // but cannot make changes beyond the level due to the hclog.Logger + // interface. + if loggerOptions == nil { + subLogger := logger.Named(subsystem) + + if opts.AdditionalLocationOffset != 1 { + logger.Warn("Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options") + } + + if opts.Level != hclog.NoLevel { + subLogger.SetLevel(opts.Level) + } + + return logging.SetProviderSubsystemLogger(ctx, subsystem, subLogger) + } + + subLoggerOptions := hclogutils.LoggerOptionsCopy(loggerOptions) + subLoggerOptions.Name = subLoggerOptions.Name + "." + subsystem + + if opts.AdditionalLocationOffset != 1 { + subLoggerOptions.AdditionalLocationOffset = opts.AdditionalLocationOffset + } + + if opts.Level != hclog.NoLevel { + subLoggerOptions.Level = opts.Level + } + + subLogger := hclog.New(subLoggerOptions) + + if opts.IncludeRootFields { + subLogger = subLogger.With(logger.ImpliedArgs()...) + } + + return logging.SetProviderSubsystemLogger(ctx, subsystem, subLogger) +} + +// SubsystemWith returns a new context.Context that has a modified logger for +// the specified subsystem in it which will include key and value as arguments +// in all its log output. +func SubsystemWith(ctx context.Context, subsystem, key string, value interface{}) context.Context { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetProviderRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return ctx + } + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + return logging.SetProviderSubsystemLogger(ctx, subsystem, logger.With(key, value)) +} + +// SubsystemTrace logs `msg` at the trace level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemTrace(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetProviderRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Trace(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemDebug logs `msg` at the debug level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemDebug(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetProviderRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Debug(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemInfo logs `msg` at the info level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemInfo(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetProviderRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Info(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemWarn logs `msg` at the warn level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemWarn(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetProviderRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Warn(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemError logs `msg` at the error level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemError(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetProviderSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetProviderRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetProviderSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewProviderSubsystemLoggerWarning) + } + logger.Error(msg, hclogutils.MapsToArgs(additionalFields...)...) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/doc.go b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/doc.go new file mode 100644 index 000000000..2ed6f6fc8 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/doc.go @@ -0,0 +1,10 @@ +// Package tfsdklog provides helper functions for logging from SDKs and +// frameworks for building Terraform plugins. +// +// Plugin authors shouldn't need to use this package; it is meant for authors +// of the frameworks and SDKs for plugins. Plugin authors should use the tflog +// package. +// +// This package provides very similar functionality to tflog, except it uses a +// separate namespace for its logs. +package tfsdklog diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/options.go b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/options.go new file mode 100644 index 000000000..b1ba8e51e --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/options.go @@ -0,0 +1,78 @@ +package tfsdklog + +import ( + "os" + "strings" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// Options is a collection of logging options, useful for collecting arguments +// to NewSubsystem, NewRootSDKLogger, and NewRootProviderLogger before calling +// them. +type Options []logging.Option + +// WithAdditionalLocationOffset returns an option that allowing implementations +// to fix location information when implementing helper functions. The default +// offset of 1 is automatically added to the provided value to account for the +// tfsdklog logging functions. +func WithAdditionalLocationOffset(additionalLocationOffset int) logging.Option { + return logging.WithAdditionalLocationOffset(additionalLocationOffset) +} + +// WithLogName returns an option that will set the logger name explicitly to +// `name`. This has no effect when used with NewSubsystem. +func WithLogName(name string) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.Name = name + return l + } +} + +// WithLevelFromEnv returns an option that will set the level of the logger +// based on the string in an environment variable. The environment variable +// checked will be `name` and `subsystems`, joined by _ and in all caps. +func WithLevelFromEnv(name string, subsystems ...string) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + envVar := strings.Join(subsystems, "_") + if envVar != "" { + envVar = "_" + envVar + } + envVar = strings.ToUpper(name + envVar) + l.Level = hclog.LevelFromString(os.Getenv(envVar)) + return l + } +} + +// WithLevel returns an option that will set the level of the logger. +func WithLevel(level hclog.Level) logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.Level = level + return l + } +} + +// WithRootFields enables the copying of root logger fields to a new subsystem +// logger during creation. +func WithRootFields() logging.Option { + return logging.WithRootFields() +} + +// WithoutLocation returns an option that disables including the location of +// the log line in the log output, which is on by default. This has no effect +// when used with NewSubsystem. +func WithoutLocation() logging.Option { + return func(l logging.LoggerOpts) logging.LoggerOpts { + l.IncludeLocation = false + return l + } +} + +// WithStderrFromInit returns an option that tells the logger to write to the +// os.Stderr that was present when the program started, not the one that is +// available at runtime. Some versions of Terraform overwrite os.Stderr with an +// io.Writer that is never read, so any log lines written to it will be lost. +func WithStderrFromInit() logging.Option { + return logging.WithOutput(logging.Stderr) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sdk.go b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sdk.go new file mode 100644 index 000000000..a27b7f3b0 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sdk.go @@ -0,0 +1,189 @@ +package tfsdklog + +import ( + "context" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/hclogutils" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// NewRootSDKLogger returns a new context.Context that contains an SDK logger +// configured with the passed options. +func NewRootSDKLogger(ctx context.Context, options ...logging.Option) context.Context { + opts := logging.ApplyLoggerOpts(options...) + if opts.Name == "" { + opts.Name = logging.DefaultSDKRootLoggerName + } + if sink := logging.GetSink(ctx); sink != nil { + logger := sink.Named(opts.Name) + sinkLoggerOptions := logging.GetSinkOptions(ctx) + sdkLoggerOptions := hclogutils.LoggerOptionsCopy(sinkLoggerOptions) + sdkLoggerOptions.Name = opts.Name + + if opts.Level != hclog.NoLevel { + logger.SetLevel(opts.Level) + sdkLoggerOptions.Level = opts.Level + } + + ctx = logging.SetSDKRootLogger(ctx, logger) + ctx = logging.SetSDKRootLoggerOptions(ctx, sdkLoggerOptions) + + return ctx + } + if opts.Level == hclog.NoLevel { + opts.Level = hclog.Trace + } + loggerOptions := &hclog.LoggerOptions{ + Name: opts.Name, + Level: opts.Level, + JSONFormat: true, + IndependentLevels: true, + IncludeLocation: opts.IncludeLocation, + DisableTime: !opts.IncludeTime, + Output: opts.Output, + AdditionalLocationOffset: opts.AdditionalLocationOffset, + } + + ctx = logging.SetSDKRootLogger(ctx, hclog.New(loggerOptions)) + ctx = logging.SetSDKRootLoggerOptions(ctx, loggerOptions) + + return ctx +} + +// NewRootProviderLogger returns a new context.Context that contains a provider +// logger configured with the passed options. +func NewRootProviderLogger(ctx context.Context, options ...logging.Option) context.Context { + opts := logging.ApplyLoggerOpts(options...) + if opts.Name == "" { + opts.Name = logging.DefaultProviderRootLoggerName + } + if sink := logging.GetSink(ctx); sink != nil { + logger := sink.Named(opts.Name) + sinkLoggerOptions := logging.GetSinkOptions(ctx) + providerLoggerOptions := hclogutils.LoggerOptionsCopy(sinkLoggerOptions) + providerLoggerOptions.Name = opts.Name + + if opts.Level != hclog.NoLevel { + logger.SetLevel(opts.Level) + providerLoggerOptions.Level = opts.Level + } + + ctx = logging.SetProviderRootLogger(ctx, logger) + ctx = logging.SetProviderRootLoggerOptions(ctx, providerLoggerOptions) + + return ctx + } + if opts.Level == hclog.NoLevel { + opts.Level = hclog.Trace + } + loggerOptions := &hclog.LoggerOptions{ + Name: opts.Name, + Level: opts.Level, + JSONFormat: true, + IndependentLevels: true, + IncludeLocation: opts.IncludeLocation, + DisableTime: !opts.IncludeTime, + Output: opts.Output, + AdditionalLocationOffset: opts.AdditionalLocationOffset, + } + + ctx = logging.SetProviderRootLogger(ctx, hclog.New(loggerOptions)) + ctx = logging.SetProviderRootLoggerOptions(ctx, loggerOptions) + + return ctx +} + +// With returns a new context.Context that has a modified logger in it which +// will include key and value as arguments in all its log output. +func With(ctx context.Context, key string, value interface{}) context.Context { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return ctx + } + return logging.SetSDKRootLogger(ctx, logger.With(key, value)) +} + +// Trace logs `msg` at the trace level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Trace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Trace(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Debug logs `msg` at the debug level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Debug(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Debug(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Info logs `msg` at the info level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Info(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Info(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Warn logs `msg` at the warn level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Warn(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Warn(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// Error logs `msg` at the error level to the logger in `ctx`, with optional +// `additionalFields` structured key-value fields in the log output. Fields are +// shallow merged with any defined on the logger, e.g. by the `With()` function, +// and across multiple maps. +func Error(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKRootLogger(ctx) + if logger == nil { + // this essentially should never happen in production the root + // logger for code should be injected by the in + // question, so really this is only likely in unit tests, at + // most so just making this a no-op is fine + return + } + logger.Error(msg, hclogutils.MapsToArgs(additionalFields...)...) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sink.go b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sink.go new file mode 100644 index 000000000..6326901f1 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/sink.go @@ -0,0 +1,152 @@ +package tfsdklog + +import ( + "context" + "fmt" + "io" + "os" + "strings" + "sync" + "syscall" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/logging" + testing "github.com/mitchellh/go-testing-interface" +) + +const ( + // envLog is the environment variable that users can set to control the + // least-verbose level of logs that will be output during testing. If + // this environment variable is set, it will default to off. This is + // just the default; specific loggers and sub-loggers can set a lower + // or higher verbosity level without a problem right now. In theory, + // they should not be able to. + // + // Valid values are TRACE, DEBUG, INFO, WARN, ERROR, and OFF. A special + // pseudo-value, JSON, will set the value to TRACE and output the + // results in their JSON format. + envLog = "TF_LOG" + + // envLogFile is the environment variable that controls where log + // output is written during tests. By default, logs will be written to + // standard error. Setting this environment variable to another file + // path will write logs there instead during tests. + envLogFile = "TF_LOG_PATH" + + // envAccLogFile is the environment variable that controls where log + // output from the provider under test and the Terraform binary (and + // other providers) will be written during tests. Setting this + // environment variable to a file will combine all log output in that + // file. If both this environment variable and TF_LOG_PATH are set, + // this environment variable will take precedence. + envAccLogFile = "TF_ACC_LOG_PATH" + + // envLogPathMask is the environment variable that controls per-test + // logging output. It should be set to a fmt-compatible string, where a + // single %s will be replaced with the test name, and the log output + // for that test (and only that test) will be written to that file. + // Setting this environment variable will override TF_LOG_PATH. + // Only the logs for the provider under test are included. + envLogPathMask = "TF_LOG_PATH_MASK" +) + +// ValidLevels are the string representations of levels that can be set for +// loggers. +var ValidLevels = []string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF"} + +// Only show invalid log level message once across any number of level lookups. +var invalidLogLevelMessage sync.Once + +// RegisterTestSink sets up a logging sink, for use with test frameworks and +// other cases where plugin logs don't get routed through Terraform. This +// applies the same filtering and file output behaviors that Terraform does. +// +// RegisterTestSink should only ever be called by test frameworks, providers +// should never call it. +// +// RegisterTestSink must be called prior to any loggers being setup or +// instantiated. +func RegisterTestSink(ctx context.Context, t testing.T) context.Context { + logger, loggerOptions := newSink(t) + + ctx = logging.SetSink(ctx, logger) + ctx = logging.SetSinkOptions(ctx, loggerOptions) + + return ctx +} + +func newSink(t testing.T) (hclog.Logger, *hclog.LoggerOptions) { + logOutput := io.Writer(os.Stderr) + var json bool + var logLevel hclog.Level + var logFile string + + envLevel := strings.ToUpper(os.Getenv(envLog)) + + // if TF_LOG_PATH is set, output logs there + if logPath := os.Getenv(envLogFile); logPath != "" { + logFile = logPath + } + + // if TF_ACC_LOG_PATH is set, output logs there instead + if logPath := os.Getenv(envAccLogFile); logPath != "" { + logFile = logPath + // helper/resource makes this default to TRACE, so we should, + // too + envLevel = "TRACE" + } + + // if TF_LOG_PATH_MASK is set, use a test-name specific logging file, + // instead + if logPathMask := os.Getenv(envLogPathMask); logPathMask != "" { + testName := strings.Replace(t.Name(), "/", "__", -1) + logFile = fmt.Sprintf(logPathMask, testName) + } + + if logFile != "" { + f, err := os.OpenFile(logFile, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666) + if err != nil { + fmt.Fprintf(os.Stderr, "Error opening log file: %v\n", err) + } else { + logOutput = f + } + } + + // if TF_LOG is set, set the level + if envLevel == "" { + logLevel = hclog.Off + } else if envLevel == "JSON" { + logLevel = hclog.Trace + json = true + } else if isValidLogLevel(envLevel) { + logLevel = hclog.LevelFromString(envLevel) + } else { + invalidLogLevelMessage.Do(func() { + fmt.Fprintf( + os.Stderr, + "[WARN] Invalid log level: %q. Defaulting to level: OFF. Valid levels are: %+v\n", + envLevel, + ValidLevels, + ) + }) + } + + loggerOptions := &hclog.LoggerOptions{ + Level: logLevel, + Output: logOutput, + IndependentLevels: true, + JSONFormat: json, + } + + return hclog.New(loggerOptions), loggerOptions +} + +func isValidLogLevel(level string) bool { + for _, validLevel := range ValidLevels { + if level == validLevel { + return true + } + } + + return false +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/subsystem.go b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/subsystem.go new file mode 100644 index 000000000..3445288bc --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-log/tfsdklog/subsystem.go @@ -0,0 +1,185 @@ +package tfsdklog + +import ( + "context" + + "github.com/hashicorp/go-hclog" + "github.com/hashicorp/terraform-plugin-log/internal/hclogutils" + "github.com/hashicorp/terraform-plugin-log/internal/logging" +) + +// NewSubsystem returns a new context.Context that contains a subsystem logger +// configured with the passed options, named after the subsystem argument. +// +// Subsystem loggers allow different areas of a plugin codebase to use +// different logging levels, giving developers more fine-grained control over +// what is logging and with what verbosity. They're best utilized for logical +// concerns that are sometimes helpful to log, but may generate unwanted noise +// at other times. +// +// The only Options supported for subsystems are the Options for setting the +// level and additional location offset of the logger. +func NewSubsystem(ctx context.Context, subsystem string, options ...logging.Option) context.Context { + logger := logging.GetSDKRootLogger(ctx) + + if logger == nil { + // this essentially should never happen in production + // the root logger for provider code should be injected + // by whatever the provider developer is using, so + // really this is only likely in unit tests, at most + // so just making this a no-op is fine + return ctx + } + + loggerOptions := logging.GetSDKRootLoggerOptions(ctx) + opts := logging.ApplyLoggerOpts(options...) + + // On the off-chance that the logger options are not available, fallback + // to creating a named logger. This will preserve the root logger options, + // but cannot make changes beyond the level due to the hclog.Logger + // interface. + if loggerOptions == nil { + subLogger := logger.Named(subsystem) + + if opts.AdditionalLocationOffset != 1 { + logger.Warn("Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options") + } + + if opts.Level != hclog.NoLevel { + subLogger.SetLevel(opts.Level) + } + + return logging.SetSDKSubsystemLogger(ctx, subsystem, subLogger) + } + + subLoggerOptions := hclogutils.LoggerOptionsCopy(loggerOptions) + subLoggerOptions.Name = subLoggerOptions.Name + "." + subsystem + + if opts.AdditionalLocationOffset != 1 { + subLoggerOptions.AdditionalLocationOffset = opts.AdditionalLocationOffset + } + + if opts.Level != hclog.NoLevel { + subLoggerOptions.Level = opts.Level + } + + subLogger := hclog.New(subLoggerOptions) + + if opts.IncludeRootFields { + subLogger = subLogger.With(logger.ImpliedArgs()...) + } + + return logging.SetSDKSubsystemLogger(ctx, subsystem, subLogger) +} + +// SubsystemWith returns a new context.Context that has a modified logger for +// the specified subsystem in it which will include key and value as arguments +// in all its log output. +func SubsystemWith(ctx context.Context, subsystem, key string, value interface{}) context.Context { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetSDKRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return ctx + } + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + return logging.SetSDKSubsystemLogger(ctx, subsystem, logger.With(key, value)) +} + +// SubsystemTrace logs `msg` at the trace level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemTrace(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetSDKRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Trace(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemDebug logs `msg` at the debug level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemDebug(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetSDKRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Debug(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemInfo logs `msg` at the info level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemInfo(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetSDKRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Info(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemWarn logs `msg` at the warn level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemWarn(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetSDKRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Warn(msg, hclogutils.MapsToArgs(additionalFields...)...) +} + +// SubsystemError logs `msg` at the error level to the subsystem logger +// specified in `ctx`, with optional `additionalFields` structured key-value +// fields in the log output. Fields are shallow merged with any defined on the +// subsystem logger, e.g. by the `SubsystemWith()` function, and across +// multiple maps. +func SubsystemError(ctx context.Context, subsystem, msg string, additionalFields ...map[string]interface{}) { + logger := logging.GetSDKSubsystemLogger(ctx, subsystem) + if logger == nil { + if logging.GetSDKRootLogger(ctx) == nil { + // logging isn't set up, nothing we can do, just silently fail + // this should basically never happen in production + return + } + // create a new logger if one doesn't exist + logger = logging.GetSDKSubsystemLogger(NewSubsystem(ctx, subsystem), subsystem).With("new_logger_warning", logging.NewSDKSubsystemLoggerWarning) + } + logger.Error(msg, hclogutils.MapsToArgs(additionalFields...)...) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go new file mode 100644 index 000000000..235586aed --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/logging.go @@ -0,0 +1,138 @@ +package logging + +import ( + "fmt" + "io" + "io/ioutil" + "log" + "os" + "strings" + "syscall" + + "github.com/hashicorp/logutils" + testing "github.com/mitchellh/go-testing-interface" +) + +// These are the environmental variables that determine if we log, and if +// we log whether or not the log should go to a file. +const ( + EnvLog = "TF_LOG" // See ValidLevels + EnvLogFile = "TF_LOG_PATH" // Set to a file + EnvAccLogFile = "TF_ACC_LOG_PATH" // Set to a file + // EnvLogPathMask splits test log files by name. + EnvLogPathMask = "TF_LOG_PATH_MASK" +) + +var ValidLevels = []logutils.LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"} + +// LogOutput determines where we should send logs (if anywhere) and the log +// level. This only effects this log.Print* functions called in the provider +// under test. Dependency providers for the provider under test will have their +// logging controlled by Terraform itself and managed with the TF_ACC_LOG_PATH +// environment variable. Calls to tflog.* will have their output managed by the +// tfsdklog sink. +func LogOutput(t testing.T) (logOutput io.Writer, err error) { + logOutput = ioutil.Discard + + logLevel := LogLevel() + if logLevel == "" { + if os.Getenv(EnvAccLogFile) != "" { + // plugintest defaults to TRACE when TF_ACC_LOG_PATH is + // set for Terraform and dependency providers of the + // provider under test. We should do the same for the + // provider under test. + logLevel = "TRACE" + } else { + return + } + } + + logOutput = os.Stderr + if logPath := os.Getenv(EnvLogFile); logPath != "" { + var err error + logOutput, err = os.OpenFile(logPath, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666) + if err != nil { + return nil, err + } + } + + if logPath := os.Getenv(EnvAccLogFile); logPath != "" { + var err error + logOutput, err = os.OpenFile(logPath, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666) + if err != nil { + return nil, err + } + } + + if logPathMask := os.Getenv(EnvLogPathMask); logPathMask != "" { + // Escape special characters which may appear if we have subtests + testName := strings.Replace(t.Name(), "/", "__", -1) + + logPath := fmt.Sprintf(logPathMask, testName) + var err error + logOutput, err = os.OpenFile(logPath, syscall.O_CREAT|syscall.O_RDWR|syscall.O_APPEND, 0666) + if err != nil { + return nil, err + } + } + + // This was the default since the beginning + logOutput = &logutils.LevelFilter{ + Levels: ValidLevels, + MinLevel: logutils.LogLevel(logLevel), + Writer: logOutput, + } + + return +} + +// SetOutput checks for a log destination with LogOutput, and calls +// log.SetOutput with the result. If LogOutput returns nil, SetOutput uses +// ioutil.Discard. Any error from LogOutout is fatal. +func SetOutput(t testing.T) { + out, err := LogOutput(t) + if err != nil { + log.Fatal(err) + } + + if out == nil { + out = ioutil.Discard + } + + log.SetOutput(out) +} + +// LogLevel returns the current log level string based the environment vars +func LogLevel() string { + envLevel := os.Getenv(EnvLog) + if envLevel == "" { + return "" + } + + logLevel := "TRACE" + if isValidLogLevel(envLevel) { + // allow following for better ux: info, Info or INFO + logLevel = strings.ToUpper(envLevel) + } else { + log.Printf("[WARN] Invalid log level: %q. Defaulting to level: TRACE. Valid levels are: %+v", + envLevel, ValidLevels) + } + + return logLevel +} + +// IsDebugOrHigher returns whether or not the current log level is debug or trace +func IsDebugOrHigher() bool { + level := LogLevel() + return level == "DEBUG" || level == "TRACE" +} + +func isValidLogLevel(level string) bool { + for _, l := range ValidLevels { + if strings.ToUpper(level) == string(l) { + return true + } + } + + return false +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/transport.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/transport.go new file mode 100644 index 000000000..6419605e7 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging/transport.go @@ -0,0 +1,70 @@ +package logging + +import ( + "bytes" + "encoding/json" + "log" + "net/http" + "net/http/httputil" + "strings" +) + +type transport struct { + name string + transport http.RoundTripper +} + +func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { + if IsDebugOrHigher() { + reqData, err := httputil.DumpRequestOut(req, true) + if err == nil { + log.Printf("[DEBUG] "+logReqMsg, t.name, prettyPrintJsonLines(reqData)) + } else { + log.Printf("[ERROR] %s API Request error: %#v", t.name, err) + } + } + + resp, err := t.transport.RoundTrip(req) + if err != nil { + return resp, err + } + + if IsDebugOrHigher() { + respData, err := httputil.DumpResponse(resp, true) + if err == nil { + log.Printf("[DEBUG] "+logRespMsg, t.name, prettyPrintJsonLines(respData)) + } else { + log.Printf("[ERROR] %s API Response error: %#v", t.name, err) + } + } + + return resp, nil +} + +func NewTransport(name string, t http.RoundTripper) *transport { + return &transport{name, t} +} + +// prettyPrintJsonLines iterates through a []byte line-by-line, +// transforming any lines that are complete json into pretty-printed json. +func prettyPrintJsonLines(b []byte) string { + parts := strings.Split(string(b), "\n") + for i, p := range parts { + if b := []byte(p); json.Valid(b) { + var out bytes.Buffer + _ = json.Indent(&out, b, "", " ") // already checked for validity + parts[i] = out.String() + } + } + return strings.Join(parts, "\n") +} + +const logReqMsg = `%s API Request Details: +---[ REQUEST ]--------------------------------------- +%s +-----------------------------------------------------` + +const logRespMsg = `%s API Response Details: +---[ RESPONSE ]-------------------------------------- +%s +-----------------------------------------------------` diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader.go index c7721bcd3..855bc4028 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader.go @@ -171,7 +171,7 @@ func addrToSchema(addr []string, schemaMap map[string]*Schema) []*Schema { // "foo.#" for a list "foo" and that the indexes are "foo.0", "foo.1", etc. // after that point. func readListField( - r FieldReader, addr []string, schema *Schema) (FieldReadResult, error) { + r FieldReader, addr []string) (FieldReadResult, error) { addrPadded := make([]string, len(addr)+1) copy(addrPadded, addr) addrPadded[len(addrPadded)-1] = "#" diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_config.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_config.go index 3f1f5e8ab..cd4a993a3 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_config.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_config.go @@ -100,7 +100,7 @@ func (r *ConfigFieldReader) readField( case TypeBool, TypeFloat, TypeInt, TypeString: return r.readPrimitive(k, schema) case TypeList: - return readListField(&nestedConfigFieldReader{r}, address, schema) + return readListField(&nestedConfigFieldReader{r}, address) case TypeMap: return r.readMap(k, schema) case TypeSet: @@ -203,7 +203,7 @@ func (r *ConfigFieldReader) readMap(k string, schema *Schema) (FieldReadResult, err := mapValuesToPrimitive(k, result, schema) if err != nil { - return FieldReadResult{}, nil + return FieldReadResult{}, nil //nolint:nilerr // Leave legacy flatmap handling } var value interface{} @@ -258,7 +258,7 @@ func (r *ConfigFieldReader) readSet( // Create the set that will be our result set := schema.ZeroValue().(*Set) - raw, err := readListField(&nestedConfigFieldReader{r}, address, schema) + raw, err := readListField(&nestedConfigFieldReader{r}, address) if err != nil { return FieldReadResult{}, err } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_diff.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_diff.go index 642e7f32e..ca3b714b1 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_diff.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_diff.go @@ -67,7 +67,7 @@ func (r *DiffFieldReader) ReadField(address []string) (FieldReadResult, error) { case TypeBool, TypeInt, TypeFloat, TypeString: res, err = r.readPrimitive(address, schema) case TypeList: - res, err = readListField(r, address, schema) + res, err = readListField(r, address) case TypeMap: res, err = r.readMap(address, schema) case TypeSet: @@ -128,7 +128,7 @@ func (r *DiffFieldReader) readMap( key := address[len(address)-1] err = mapValuesToPrimitive(key, result, schema) if err != nil { - return FieldReadResult{}, nil + return FieldReadResult{}, nil //nolint:nilerr // Leave legacy flatmap handling } var resultVal interface{} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_map.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_map.go index 092dd7f68..6fa191522 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_map.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_reader_map.go @@ -24,7 +24,7 @@ func (r *MapFieldReader) ReadField(address []string) (FieldReadResult, error) { case TypeBool, TypeInt, TypeFloat, TypeString: return r.readPrimitive(address, schema) case TypeList: - return readListField(r, address, schema) + return readListField(r, address) case TypeMap: return r.readMap(k, schema) case TypeSet: @@ -63,7 +63,7 @@ func (r *MapFieldReader) readMap(k string, schema *Schema) (FieldReadResult, err err := mapValuesToPrimitive(k, result, schema) if err != nil { - return FieldReadResult{}, nil + return FieldReadResult{}, nil //nolint:nilerr // Leave legacy flatmap handling } var resultVal interface{} @@ -159,11 +159,8 @@ func (r *MapFieldReader) readSet( // "ports.1", but the "state" map might have those plus "ports.2". // We don't want "ports.2" countActual[idx] = struct{}{} - if len(countActual) >= countExpected { - return false - } - return true + return len(countActual) < countExpected }) if !completed && err != nil { return FieldReadResult{}, err diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go index 85d05be4c..39c708b27 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/field_writer_map.go @@ -100,13 +100,13 @@ func (w *MapFieldWriter) set(addr []string, value interface{}) error { case TypeBool, TypeInt, TypeFloat, TypeString: return w.setPrimitive(addr, value, schema) case TypeList: - return w.setList(addr, value, schema) + return w.setList(addr, value) case TypeMap: - return w.setMap(addr, value, schema) + return w.setMap(addr, value) case TypeSet: return w.setSet(addr, value, schema) case typeObject: - return w.setObject(addr, value, schema) + return w.setObject(addr, value) default: panic(fmt.Sprintf("Unknown type: %#v", schema.Type)) } @@ -114,8 +114,7 @@ func (w *MapFieldWriter) set(addr []string, value interface{}) error { func (w *MapFieldWriter) setList( addr []string, - v interface{}, - schema *Schema) error { + v interface{}) error { k := strings.Join(addr, ".") setElement := func(idx string, value interface{}) error { addrCopy := make([]string, len(addr), len(addr)+1) @@ -148,7 +147,7 @@ func (w *MapFieldWriter) setList( if err != nil { for i := range vs { is := strconv.FormatInt(int64(i), 10) - setElement(is, nil) + _ = setElement(is, nil) // best effort; error returned below } return err @@ -160,8 +159,7 @@ func (w *MapFieldWriter) setList( func (w *MapFieldWriter) setMap( addr []string, - value interface{}, - schema *Schema) error { + value interface{}) error { k := strings.Join(addr, ".") v := reflect.ValueOf(value) vs := make(map[string]interface{}) @@ -176,7 +174,7 @@ func (w *MapFieldWriter) setMap( return fmt.Errorf("%s: must be a map", k) } if v.Type().Key().Kind() != reflect.String { - return fmt.Errorf("%s: keys must strings", k) + return fmt.Errorf("%s: keys must be strings", k) } for _, mk := range v.MapKeys() { mv := v.MapIndex(mk) @@ -207,8 +205,7 @@ func (w *MapFieldWriter) setMap( func (w *MapFieldWriter) setObject( addr []string, - value interface{}, - schema *Schema) error { + value interface{}) error { // Set the entire object. First decode into a proper structure var v map[string]interface{} if err := mapstructure.Decode(value, &v); err != nil { @@ -228,11 +225,13 @@ func (w *MapFieldWriter) setObject( } if err != nil { for k1 := range v { - w.set(append(addrCopy, k1), nil) + _ = w.set(append(addrCopy, k1), nil) // best effort; error returned below } + + return err } - return err + return nil } func (w *MapFieldWriter) setPrimitive( @@ -271,7 +270,7 @@ func (w *MapFieldWriter) setPrimitive( if err := mapstructure.Decode(v, &n); err != nil { return fmt.Errorf("%s: %s", k, err) } - set = strconv.FormatFloat(float64(n), 'G', -1, 64) + set = strconv.FormatFloat(n, 'G', -1, 64) default: return fmt.Errorf("Unknown type: %#v", schema.Type) } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go index d9c824d26..ec3ed07c1 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "log" "strconv" "sync" @@ -13,15 +12,18 @@ import ( "github.com/hashicorp/go-cty/cty/msgpack" "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/configschema" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim" + "github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/plans/objchange" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -const newExtraKey = "_new_extra_shim" +const ( + newExtraKey = "_new_extra_shim" +) func NewGRPCProviderServer(p *Provider) *GRPCProviderServer { return &GRPCProviderServer{ @@ -53,6 +55,7 @@ func mergeStop(ctx context.Context, cancel context.CancelFunc, stopCh chan struc // It creates a goroutine to wait for the server stop and propagates // cancellation to the derived grpc context. func (s *GRPCProviderServer) StopContext(ctx context.Context) context.Context { + ctx = logging.InitContext(ctx) s.stopMu.Lock() defer s.stopMu.Unlock() @@ -61,7 +64,10 @@ func (s *GRPCProviderServer) StopContext(ctx context.Context) context.Context { return stoppable } -func (s *GRPCProviderServer) GetProviderSchema(_ context.Context, req *tfprotov5.GetProviderSchemaRequest) (*tfprotov5.GetProviderSchemaResponse, error) { +func (s *GRPCProviderServer) GetProviderSchema(ctx context.Context, req *tfprotov5.GetProviderSchemaRequest) (*tfprotov5.GetProviderSchemaResponse, error) { + ctx = logging.InitContext(ctx) + + logging.HelperSchemaTrace(ctx, "Getting provider schema") resp := &tfprotov5.GetProviderSchemaResponse{ ResourceSchemas: make(map[string]*tfprotov5.Schema), @@ -69,24 +75,28 @@ func (s *GRPCProviderServer) GetProviderSchema(_ context.Context, req *tfprotov5 } resp.Provider = &tfprotov5.Schema{ - Block: convert.ConfigSchemaToProto(s.getProviderSchemaBlock()), + Block: convert.ConfigSchemaToProto(ctx, s.getProviderSchemaBlock()), } resp.ProviderMeta = &tfprotov5.Schema{ - Block: convert.ConfigSchemaToProto(s.getProviderMetaSchemaBlock()), + Block: convert.ConfigSchemaToProto(ctx, s.getProviderMetaSchemaBlock()), } for typ, res := range s.provider.ResourcesMap { + logging.HelperSchemaTrace(ctx, "Found resource type", map[string]interface{}{logging.KeyResourceType: typ}) + resp.ResourceSchemas[typ] = &tfprotov5.Schema{ Version: int64(res.SchemaVersion), - Block: convert.ConfigSchemaToProto(res.CoreConfigSchema()), + Block: convert.ConfigSchemaToProto(ctx, res.CoreConfigSchema()), } } for typ, dat := range s.provider.DataSourcesMap { + logging.HelperSchemaTrace(ctx, "Found data source type", map[string]interface{}{logging.KeyDataSourceType: typ}) + resp.DataSourceSchemas[typ] = &tfprotov5.Schema{ Version: int64(dat.SchemaVersion), - Block: convert.ConfigSchemaToProto(dat.CoreConfigSchema()), + Block: convert.ConfigSchemaToProto(ctx, dat.CoreConfigSchema()), } } @@ -111,14 +121,17 @@ func (s *GRPCProviderServer) getDatasourceSchemaBlock(name string) *configschema return dat.CoreConfigSchema() } -func (s *GRPCProviderServer) PrepareProviderConfig(_ context.Context, req *tfprotov5.PrepareProviderConfigRequest) (*tfprotov5.PrepareProviderConfigResponse, error) { +func (s *GRPCProviderServer) PrepareProviderConfig(ctx context.Context, req *tfprotov5.PrepareProviderConfigRequest) (*tfprotov5.PrepareProviderConfigResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.PrepareProviderConfigResponse{} + logging.HelperSchemaTrace(ctx, "Preparing provider configuration") + schemaBlock := s.getProviderSchemaBlock() configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -156,8 +169,7 @@ func (s *GRPCProviderServer) PrepareProviderConfig(_ context.Context, req *tfpro // find a default value if it exists def, err := attrSchema.DefaultValue() if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, fmt.Errorf("error getting default for %q: %s", getAttr.Name, err)) - return val, err + return val, fmt.Errorf("error getting default for %q: %w", getAttr.Name, err) } // no default @@ -171,41 +183,43 @@ func (s *GRPCProviderServer) PrepareProviderConfig(_ context.Context, req *tfpro // helper/schema used to allow setting "" to a bool if val.Type() == cty.Bool && tmpVal.RawEquals(cty.StringVal("")) { // return a warning about the conversion - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, "provider set empty string as default value for bool "+getAttr.Name) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, "provider set empty string as default value for bool "+getAttr.Name) tmpVal = cty.False } val, err = ctyconvert.Convert(tmpVal, val.Type()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, fmt.Errorf("error setting default for %q: %s", getAttr.Name, err)) + return val, fmt.Errorf("error setting default for %q: %w", getAttr.Name, err) } - return val, err + return val, nil }) if err != nil { - // any error here was already added to the diagnostics + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } configVal, err = schemaBlock.CoerceValue(configVal) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } // Ensure there are no nulls that will cause helper/schema to panic. - if err := validateConfigNulls(configVal, nil); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + if err := validateConfigNulls(ctx, configVal, nil); err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } config := terraform.NewResourceConfigShimmed(configVal, schemaBlock) - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, s.provider.Validate(config)) + logging.HelperSchemaTrace(ctx, "Calling downstream") + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, s.provider.Validate(config)) + logging.HelperSchemaTrace(ctx, "Called downstream") preparedConfigMP, err := msgpack.Marshal(configVal, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -214,54 +228,61 @@ func (s *GRPCProviderServer) PrepareProviderConfig(_ context.Context, req *tfpro return resp, nil } -func (s *GRPCProviderServer) ValidateResourceTypeConfig(_ context.Context, req *tfprotov5.ValidateResourceTypeConfigRequest) (*tfprotov5.ValidateResourceTypeConfigResponse, error) { +func (s *GRPCProviderServer) ValidateResourceTypeConfig(ctx context.Context, req *tfprotov5.ValidateResourceTypeConfigRequest) (*tfprotov5.ValidateResourceTypeConfigResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.ValidateResourceTypeConfigResponse{} schemaBlock := s.getResourceSchemaBlock(req.TypeName) configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } config := terraform.NewResourceConfigShimmed(configVal, schemaBlock) - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, s.provider.ValidateResource(req.TypeName, config)) + logging.HelperSchemaTrace(ctx, "Calling downstream") + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, s.provider.ValidateResource(req.TypeName, config)) + logging.HelperSchemaTrace(ctx, "Called downstream") return resp, nil } -func (s *GRPCProviderServer) ValidateDataSourceConfig(_ context.Context, req *tfprotov5.ValidateDataSourceConfigRequest) (*tfprotov5.ValidateDataSourceConfigResponse, error) { +func (s *GRPCProviderServer) ValidateDataSourceConfig(ctx context.Context, req *tfprotov5.ValidateDataSourceConfigRequest) (*tfprotov5.ValidateDataSourceConfigResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.ValidateDataSourceConfigResponse{} schemaBlock := s.getDatasourceSchemaBlock(req.TypeName) configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } // Ensure there are no nulls that will cause helper/schema to panic. - if err := validateConfigNulls(configVal, nil); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + if err := validateConfigNulls(ctx, configVal, nil); err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } config := terraform.NewResourceConfigShimmed(configVal, schemaBlock) - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, s.provider.ValidateDataSource(req.TypeName, config)) + logging.HelperSchemaTrace(ctx, "Calling downstream") + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, s.provider.ValidateDataSource(req.TypeName, config)) + logging.HelperSchemaTrace(ctx, "Called downstream") return resp, nil } func (s *GRPCProviderServer) UpgradeResourceState(ctx context.Context, req *tfprotov5.UpgradeResourceStateRequest) (*tfprotov5.UpgradeResourceStateResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.UpgradeResourceStateResponse{} res, ok := s.provider.ResourcesMap[req.TypeName] if !ok { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) return resp, nil } schemaBlock := s.getResourceSchemaBlock(req.TypeName) @@ -275,9 +296,11 @@ func (s *GRPCProviderServer) UpgradeResourceState(ctx context.Context, req *tfpr // We first need to upgrade a flatmap state if it exists. // There should never be both a JSON and Flatmap state in the request. case len(req.RawState.Flatmap) > 0: + logging.HelperSchemaTrace(ctx, "Upgrading flatmap state") + jsonMap, version, err = s.upgradeFlatmapState(ctx, version, req.RawState.Flatmap, res) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } // if there's a JSON state, we need to decode it. @@ -288,29 +311,31 @@ func (s *GRPCProviderServer) UpgradeResourceState(ctx context.Context, req *tfpr err = json.Unmarshal(req.RawState.JSON, &jsonMap) } if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } default: - log.Println("[DEBUG] no state provided to upgrade") + logging.HelperSchemaDebug(ctx, "no state provided to upgrade") return resp, nil } // complete the upgrade of the JSON states + logging.HelperSchemaTrace(ctx, "Upgrading JSON state") + jsonMap, err = s.upgradeJSONState(ctx, version, jsonMap, res) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } // The provider isn't required to clean out removed fields - s.removeAttributes(jsonMap, schemaBlock.ImpliedType()) + s.removeAttributes(ctx, jsonMap, schemaBlock.ImpliedType()) // now we need to turn the state into the default json representation, so // that it can be re-decoded using the actual schema. val, err := JSONMapToStateValue(jsonMap, schemaBlock) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -319,7 +344,7 @@ func (s *GRPCProviderServer) UpgradeResourceState(ctx context.Context, req *tfpr // First we need to CoerceValue to ensure that all object types match. val, err = schemaBlock.CoerceValue(val) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } // Normalize the value and fill in any missing blocks. @@ -328,7 +353,7 @@ func (s *GRPCProviderServer) UpgradeResourceState(ctx context.Context, req *tfpr // encode the final state to the expected msgpack format newStateMP, err := msgpack.Marshal(val, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -341,7 +366,7 @@ func (s *GRPCProviderServer) UpgradeResourceState(ctx context.Context, req *tfpr // map[string]interface{}. // upgradeFlatmapState returns the json map along with the corresponding schema // version. -func (s *GRPCProviderServer) upgradeFlatmapState(ctx context.Context, version int, m map[string]string, res *Resource) (map[string]interface{}, int, error) { +func (s *GRPCProviderServer) upgradeFlatmapState(_ context.Context, version int, m map[string]string, res *Resource) (map[string]interface{}, int, error) { // this will be the version we've upgraded so, defaulting to the given // version in case no migration was called. upgradedVersion := version @@ -433,7 +458,7 @@ func (s *GRPCProviderServer) upgradeJSONState(ctx context.Context, version int, // Remove any attributes no longer present in the schema, so that the json can // be correctly decoded. -func (s *GRPCProviderServer) removeAttributes(v interface{}, ty cty.Type) { +func (s *GRPCProviderServer) removeAttributes(ctx context.Context, v interface{}, ty cty.Type) { // we're only concerned with finding maps that corespond to object // attributes switch v := v.(type) { @@ -442,7 +467,7 @@ func (s *GRPCProviderServer) removeAttributes(v interface{}, ty cty.Type) { if ty.IsListType() || ty.IsSetType() { eTy := ty.ElementType() for _, eV := range v { - s.removeAttributes(eV, eTy) + s.removeAttributes(ctx, eV, eTy) } } return @@ -451,20 +476,20 @@ func (s *GRPCProviderServer) removeAttributes(v interface{}, ty cty.Type) { if ty.IsMapType() { eTy := ty.ElementType() for _, eV := range v { - s.removeAttributes(eV, eTy) + s.removeAttributes(ctx, eV, eTy) } return } if ty == cty.DynamicPseudoType { - log.Printf("[DEBUG] ignoring dynamic block: %#v\n", v) + logging.HelperSchemaDebug(ctx, "ignoring dynamic block", map[string]interface{}{"block": v}) return } if !ty.IsObjectType() { // This shouldn't happen, and will fail to decode further on, so // there's no need to handle it here. - log.Printf("[WARN] unexpected type %#v for map in json state", ty) + logging.HelperSchemaWarn(ctx, "unexpected type for map in JSON state", map[string]interface{}{"type": ty}) return } @@ -472,17 +497,21 @@ func (s *GRPCProviderServer) removeAttributes(v interface{}, ty cty.Type) { for attr, attrV := range v { attrTy, ok := attrTypes[attr] if !ok { - log.Printf("[DEBUG] attribute %q no longer present in schema", attr) + logging.HelperSchemaDebug(ctx, "attribute no longer present in schema", map[string]interface{}{"attribute": attr}) delete(v, attr) continue } - s.removeAttributes(attrV, attrTy) + s.removeAttributes(ctx, attrV, attrTy) } } } -func (s *GRPCProviderServer) StopProvider(_ context.Context, _ *tfprotov5.StopProviderRequest) (*tfprotov5.StopProviderResponse, error) { +func (s *GRPCProviderServer) StopProvider(ctx context.Context, _ *tfprotov5.StopProviderRequest) (*tfprotov5.StopProviderResponse, error) { + ctx = logging.InitContext(ctx) + + logging.HelperSchemaTrace(ctx, "Stopping provider") + s.stopMu.Lock() defer s.stopMu.Unlock() @@ -491,25 +520,28 @@ func (s *GRPCProviderServer) StopProvider(_ context.Context, _ *tfprotov5.StopPr // reset the stop signal s.stopCh = make(chan struct{}) + logging.HelperSchemaTrace(ctx, "Stopped provider") + return &tfprotov5.StopProviderResponse{}, nil } func (s *GRPCProviderServer) ConfigureProvider(ctx context.Context, req *tfprotov5.ConfigureProviderRequest) (*tfprotov5.ConfigureProviderResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.ConfigureProviderResponse{} schemaBlock := s.getProviderSchemaBlock() configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } s.provider.TerraformVersion = req.TerraformVersion // Ensure there are no nulls that will cause helper/schema to panic. - if err := validateConfigNulls(configVal, nil); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + if err := validateConfigNulls(ctx, configVal, nil); err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -520,13 +552,18 @@ func (s *GRPCProviderServer) ConfigureProvider(ctx context.Context, req *tfproto // function. Ideally a provider should migrate to the context aware API that receives // request scoped contexts, however this is a large undertaking for very large providers. ctxHack := context.WithValue(ctx, StopContextKey, s.StopContext(context.Background())) + + logging.HelperSchemaTrace(ctx, "Calling downstream") diags := s.provider.Configure(ctxHack, config) - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags) + logging.HelperSchemaTrace(ctx, "Called downstream") + + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, diags) return resp, nil } func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.ReadResourceRequest) (*tfprotov5.ReadResourceResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.ReadResourceResponse{ // helper/schema did previously handle private data during refresh, but // core is now going to expect this to be maintained in order to @@ -536,27 +573,28 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.Re res, ok := s.provider.ResourcesMap[req.TypeName] if !ok { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) return resp, nil } schemaBlock := s.getResourceSchemaBlock(req.TypeName) stateVal, err := msgpack.Unmarshal(req.CurrentState.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } instanceState, err := res.ShimInstanceStateFromValue(stateVal) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } + instanceState.RawState = stateVal private := make(map[string]interface{}) if len(req.Private) > 0 { if err := json.Unmarshal(req.Private, &private); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } } @@ -566,14 +604,14 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.Re if pmSchemaBlock != nil && req.ProviderMeta != nil { providerSchemaVal, err := msgpack.Unmarshal(req.ProviderMeta.MsgPack, pmSchemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } instanceState.ProviderMeta = providerSchemaVal } newInstanceState, diags := res.RefreshWithoutUpgrade(ctx, instanceState, s.provider.Meta()) - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, diags) if diags.HasError() { return resp, nil } @@ -584,7 +622,7 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.Re // to see a null value (in the cty sense) in that case. newStateMP, err := msgpack.Marshal(cty.NullVal(schemaBlock.ImpliedType()), schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) } resp.NewState = &tfprotov5.DynamicValue{ MsgPack: newStateMP, @@ -597,7 +635,7 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.Re newStateVal, err := hcl2shim.HCL2ValueFromFlatmap(newInstanceState.Attributes, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -606,7 +644,7 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.Re newStateMP, err := msgpack.Marshal(newStateVal, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -618,6 +656,7 @@ func (s *GRPCProviderServer) ReadResource(ctx context.Context, req *tfprotov5.Re } func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprotov5.PlanResourceChangeRequest) (*tfprotov5.PlanResourceChangeResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.PlanResourceChangeResponse{} // This is a signal to Terraform Core that we're doing the best we can to @@ -626,18 +665,18 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot // forward to any new SDK implementations, since setting it prevents us // from catching certain classes of provider bug that can lead to // confusing downstream errors. - resp.UnsafeToUseLegacyTypeSystem = true + resp.UnsafeToUseLegacyTypeSystem = true //nolint:staticcheck res, ok := s.provider.ResourcesMap[req.TypeName] if !ok { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) return resp, nil } schemaBlock := s.getResourceSchemaBlock(req.TypeName) priorStateVal, err := msgpack.Unmarshal(req.PriorState.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -645,7 +684,7 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot proposedNewStateVal, err := msgpack.Unmarshal(req.ProposedNewState.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -656,15 +695,24 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot return resp, nil } + configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) + if err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) + return resp, nil + } + priorState, err := res.ShimInstanceStateFromValue(priorStateVal) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } + priorState.RawState = priorStateVal + priorState.RawPlan = proposedNewStateVal + priorState.RawConfig = configVal priorPrivate := make(map[string]interface{}) if len(req.PriorPrivate) > 0 { if err := json.Unmarshal(req.PriorPrivate, &priorPrivate); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } } @@ -675,15 +723,15 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot if pmSchemaBlock != nil && req.ProviderMeta != nil { providerSchemaVal, err := msgpack.Unmarshal(req.ProviderMeta.MsgPack, pmSchemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } priorState.ProviderMeta = providerSchemaVal } // Ensure there are no nulls that will cause helper/schema to panic. - if err := validateConfigNulls(proposedNewStateVal, nil); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + if err := validateConfigNulls(ctx, proposedNewStateVal, nil); err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -692,7 +740,7 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot diff, err := res.SimpleDiff(ctx, priorState, cfg, s.provider.Meta()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -724,22 +772,27 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot // now we need to apply the diff to the prior state, so get the planned state plannedAttrs, err := diff.Apply(priorState.Attributes, schemaBlock) + if err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) + return resp, nil + } + plannedStateVal, err := hcl2shim.HCL2ValueFromFlatmap(plannedAttrs, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } plannedStateVal, err = schemaBlock.CoerceValue(plannedStateVal) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } plannedStateVal = normalizeNullValues(plannedStateVal, proposedNewStateVal, false) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -767,7 +820,7 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot plannedMP, err := msgpack.Marshal(plannedStateVal, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } resp.PlannedState = &tfprotov5.DynamicValue{ @@ -777,12 +830,12 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot // encode any timeouts into the diff Meta t := &ResourceTimeout{} if err := t.ConfigDecode(res, cfg); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } if err := t.DiffEncode(diff); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -805,7 +858,7 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot // the Meta field gets encoded into PlannedPrivate plannedPrivate, err := json.Marshal(privateMap) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } resp.PlannedPrivate = plannedPrivate @@ -832,7 +885,7 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot requiresReplace, err := hcl2shim.RequiresReplace(requiresNew, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -845,6 +898,7 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot } func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfprotov5.ApplyResourceChangeRequest) (*tfprotov5.ApplyResourceChangeResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.ApplyResourceChangeResponse{ // Start with the existing state as a fallback NewState: req.PriorState, @@ -852,33 +906,39 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro res, ok := s.provider.ResourcesMap[req.TypeName] if !ok { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, fmt.Errorf("unknown resource type: %s", req.TypeName)) return resp, nil } schemaBlock := s.getResourceSchemaBlock(req.TypeName) priorStateVal, err := msgpack.Unmarshal(req.PriorState.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } plannedStateVal, err := msgpack.Unmarshal(req.PlannedState.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) + return resp, nil + } + + configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) + if err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } priorState, err := res.ShimInstanceStateFromValue(priorStateVal) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } private := make(map[string]interface{}) if len(req.PlannedPrivate) > 0 { if err := json.Unmarshal(req.PlannedPrivate, &private); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } } @@ -893,11 +953,14 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro Attributes: make(map[string]*terraform.ResourceAttrDiff), Meta: make(map[string]interface{}), Destroy: true, + RawPlan: plannedStateVal, + RawState: priorStateVal, + RawConfig: configVal, } } else { - diff, err = DiffFromValues(ctx, priorStateVal, plannedStateVal, stripResourceModifiers(res)) + diff, err = DiffFromValues(ctx, priorStateVal, plannedStateVal, configVal, stripResourceModifiers(res)) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } } @@ -906,6 +969,9 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro diff = &terraform.InstanceDiff{ Attributes: make(map[string]*terraform.ResourceAttrDiff), Meta: make(map[string]interface{}), + RawPlan: plannedStateVal, + RawState: priorStateVal, + RawConfig: configVal, } } @@ -946,14 +1012,14 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro if pmSchemaBlock != nil && req.ProviderMeta != nil { providerSchemaVal, err := msgpack.Unmarshal(req.ProviderMeta.MsgPack, pmSchemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } priorState.ProviderMeta = providerSchemaVal } newInstanceState, diags := res.Apply(ctx, priorState, diff, s.provider.Meta()) - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, diags) newStateVal := cty.NullVal(schemaBlock.ImpliedType()) @@ -963,7 +1029,7 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro if destroy || newInstanceState == nil || newInstanceState.Attributes == nil || newInstanceState.ID == "" { newStateMP, err := msgpack.Marshal(newStateVal, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } resp.NewState = &tfprotov5.DynamicValue{ @@ -976,7 +1042,7 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro // entire object, even if the new state was nil. newStateVal, err = StateValueFromInstanceState(newInstanceState, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -986,7 +1052,7 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro newStateMP, err := msgpack.Marshal(newStateVal, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } resp.NewState = &tfprotov5.DynamicValue{ @@ -995,7 +1061,7 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro meta, err := json.Marshal(newInstanceState.Meta) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } resp.Private = meta @@ -1006,12 +1072,13 @@ func (s *GRPCProviderServer) ApplyResourceChange(ctx context.Context, req *tfpro // forward to any new SDK implementations, since setting it prevents us // from catching certain classes of provider bug that can lead to // confusing downstream errors. - resp.UnsafeToUseLegacyTypeSystem = true + resp.UnsafeToUseLegacyTypeSystem = true //nolint:staticcheck return resp, nil } func (s *GRPCProviderServer) ImportResourceState(ctx context.Context, req *tfprotov5.ImportResourceStateRequest) (*tfprotov5.ImportResourceStateResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.ImportResourceStateResponse{} info := &terraform.InstanceInfo{ @@ -1020,7 +1087,7 @@ func (s *GRPCProviderServer) ImportResourceState(ctx context.Context, req *tfpro newInstanceStates, err := s.provider.ImportState(ctx, info, req.ID) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -1036,7 +1103,7 @@ func (s *GRPCProviderServer) ImportResourceState(ctx context.Context, req *tfpro schemaBlock := s.getResourceSchemaBlock(resourceType) newStateVal, err := hcl2shim.HCL2ValueFromFlatmap(is.Attributes, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -1045,13 +1112,13 @@ func (s *GRPCProviderServer) ImportResourceState(ctx context.Context, req *tfpro newStateMP, err := msgpack.Marshal(newStateVal, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } meta, err := json.Marshal(is.Meta) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -1070,19 +1137,20 @@ func (s *GRPCProviderServer) ImportResourceState(ctx context.Context, req *tfpro } func (s *GRPCProviderServer) ReadDataSource(ctx context.Context, req *tfprotov5.ReadDataSourceRequest) (*tfprotov5.ReadDataSourceResponse, error) { + ctx = logging.InitContext(ctx) resp := &tfprotov5.ReadDataSourceResponse{} schemaBlock := s.getDatasourceSchemaBlock(req.TypeName) configVal, err := msgpack.Unmarshal(req.Config.MsgPack, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } // Ensure there are no nulls that will cause helper/schema to panic. - if err := validateConfigNulls(configVal, nil); err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + if err := validateConfigNulls(ctx, configVal, nil); err != nil { + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -1092,25 +1160,31 @@ func (s *GRPCProviderServer) ReadDataSource(ctx context.Context, req *tfprotov5. // the old behavior res, ok := s.provider.DataSourcesMap[req.TypeName] if !ok { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, fmt.Errorf("unknown data source: %s", req.TypeName)) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, fmt.Errorf("unknown data source: %s", req.TypeName)) return resp, nil } diff, err := res.Diff(ctx, nil, config, s.provider.Meta()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } + // Not setting RawConfig here is okay, as ResourceData.GetRawConfig() + // will return a NullVal of the schema if there is no InstanceDiff. + if diff != nil { + diff.RawConfig = configVal + } + // now we can get the new complete data source newInstanceState, diags := res.ReadDataApply(ctx, diff, s.provider.Meta()) - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, diags) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, diags) if diags.HasError() { return resp, nil } newStateVal, err := StateValueFromInstanceState(newInstanceState, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } @@ -1118,7 +1192,7 @@ func (s *GRPCProviderServer) ReadDataSource(ctx context.Context, req *tfprotov5. newStateMP, err := msgpack.Marshal(newStateVal, schemaBlock.ImpliedType()) if err != nil { - resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, err) + resp.Diagnostics = convert.AppendProtoDiag(ctx, resp.Diagnostics, err) return resp, nil } resp.State = &tfprotov5.DynamicValue{ @@ -1152,7 +1226,10 @@ func pathToAttributePath(path cty.Path) *tftypes.AttributePath { } } - return &tftypes.AttributePath{Steps: steps} + if len(steps) < 1 { + return nil + } + return tftypes.NewAttributePathWithSteps(steps) } // helper/schema throws away timeout values from the config and stores them in @@ -1408,7 +1485,7 @@ func normalizeNullValues(dst, src cty.Value, apply bool) cty.Value { // appears in a list-like attribute (list, set, tuple) will present a nil value // to helper/schema which can panic. Return an error to the user in this case, // indicating the attribute with the null value. -func validateConfigNulls(v cty.Value, path cty.Path) []*tfprotov5.Diagnostic { +func validateConfigNulls(ctx context.Context, v cty.Value, path cty.Path) []*tfprotov5.Diagnostic { var diags []*tfprotov5.Diagnostic if v.IsNull() || !v.IsKnown() { return diags @@ -1437,8 +1514,8 @@ func validateConfigNulls(v cty.Value, path cty.Path) []*tfprotov5.Diagnostic { continue } - d := validateConfigNulls(ev, append(path, cty.IndexStep{Key: kv})) - diags = convert.AppendProtoDiag(diags, d) + d := validateConfigNulls(ctx, ev, append(path, cty.IndexStep{Key: kv})) + diags = convert.AppendProtoDiag(ctx, diags, d) } case v.Type().IsMapType() || v.Type().IsObjectType(): @@ -1452,8 +1529,8 @@ func validateConfigNulls(v cty.Value, path cty.Path) []*tfprotov5.Diagnostic { case v.Type().IsObjectType(): step = cty.GetAttrStep{Name: kv.AsString()} } - d := validateConfigNulls(ev, append(path, step)) - diags = convert.AppendProtoDiag(diags, d) + d := validateConfigNulls(ctx, ev, append(path, step)) + diags = convert.AppendProtoDiag(ctx, diags, d) } } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go index 25148e17c..91a21b389 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/provider.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov5" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/configschema" + "github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging" "github.com/hashicorp/terraform-plugin-sdk/v2/meta" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -90,6 +91,9 @@ type Provider struct { // cancellation signal. This function can yield Diagnostics. ConfigureContextFunc ConfigureContextFunc + // configured is enabled after a Configure() call + configured bool + meta interface{} TerraformVersion string @@ -261,6 +265,10 @@ func (p *Provider) Configure(ctx context.Context, c *terraform.ResourceConfig) d return nil } + if p.configured { + logging.HelperSchemaWarn(ctx, "Previously configured provider being re-configured. This can cause issues in concurrent testing if the configurations are not equal.") + } + sm := schemaMap(p.Schema) // Get a ResourceData for this configuration. To do this, we actually @@ -282,15 +290,23 @@ func (p *Provider) Configure(ctx context.Context, c *terraform.ResourceConfig) d } p.meta = meta } + + var diags diag.Diagnostics + if p.ConfigureContextFunc != nil { - meta, diags := p.ConfigureContextFunc(ctx, data) + meta, configureDiags := p.ConfigureContextFunc(ctx, data) + diags = append(diags, configureDiags...) + if diags.HasError() { return diags } + p.meta = meta } - return nil + p.configured = true + + return diags } // Resources returns all the available resource types that this provider @@ -363,11 +379,15 @@ func (p *Provider) ImportState( results := []*ResourceData{data} if r.Importer.State != nil || r.Importer.StateContext != nil { var err error + logging.HelperSchemaTrace(ctx, "Calling downstream") + if r.Importer.StateContext != nil { results, err = r.Importer.StateContext(ctx, data, p.meta) } else { results, err = r.Importer.State(data, p.meta) } + logging.HelperSchemaTrace(ctx, "Called downstream") + if err != nil { return nil, err } @@ -376,6 +396,21 @@ func (p *Provider) ImportState( // Convert the results to InstanceState values and return it states := make([]*terraform.InstanceState, len(results)) for i, r := range results { + if r == nil { + return nil, fmt.Errorf("The provider returned a missing resource during ImportResourceState. " + + "This is generally a bug in the resource implementation for import. " + + "Resource import code should return an error for missing resources and skip returning a missing or empty ResourceData. " + + "Please report this to the provider developers.") + } + + if r.Id() == "" { + return nil, fmt.Errorf("The provider returned a resource missing an identifier during ImportResourceState. " + + "This is generally a bug in the resource implementation for import. " + + "Resource import code should not call d.SetId(\"\") or create an empty ResourceData. " + + "If the resource is missing, instead return an error. " + + "Please report this to the provider developers.") + } + states[i] = r.State() } @@ -383,10 +418,10 @@ func (p *Provider) ImportState( // isn't obvious so we circumvent that with a friendlier error. for _, s := range states { if s == nil { - return nil, fmt.Errorf( - "nil entry in ImportState results. This is always a bug with\n" + - "the resource that is being imported. Please report this as\n" + - "a bug to Terraform.") + return nil, fmt.Errorf("The provider returned a missing resource during ImportResourceState. " + + "This is generally a bug in the resource implementation for import. " + + "Resource import code should return an error for missing resources. " + + "Please report this to the provider developers.") } } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go index 2f5663d35..5b40bec89 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go @@ -4,12 +4,12 @@ import ( "context" "errors" "fmt" - "log" "strconv" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -31,35 +31,44 @@ var ReservedResourceFields = []string{ "provisioner", } -// Resource represents a thing in Terraform that has a set of configurable -// attributes and a lifecycle (create, read, update, delete). +// Resource is an abstraction for multiple Terraform concepts: // -// The Resource schema is an abstraction that allows provider writers to -// worry only about CRUD operations while off-loading validation, diff -// generation, etc. to this higher level library. +// - Managed Resource: An infrastructure component with a schema, lifecycle +// operations such as create, read, update, and delete +// (CRUD), and optional implementation details such as +// import support, upgrade state support, and difference +// customization. +// - Data Resource: Also known as a data source. An infrastructure component +// with a schema and only the read lifecycle operation. +// - Block: When implemented within a Schema type Elem field, a configuration +// block that contains nested schema information such as attributes +// and blocks. // -// In spite of the name, this struct is not used only for terraform resources, -// but also for data sources. In the case of data sources, the Create, -// Update and Delete functions must not be provided. +// To fully implement managed resources, the Provider type ResourcesMap field +// should include a reference to an implementation of this type. To fully +// implement data resources, the Provider type DataSourcesMap field should +// include a reference to an implementation of this type. +// +// Each field further documents any constraints based on the Terraform concept +// being implemented. type Resource struct { - // Schema is the schema for the configuration of this resource. - // - // The keys of this map are the configuration keys, and the values - // describe the schema of the configuration value. + // Schema is the structure and type information for this component. This + // field is required for all Resource concepts. // - // The schema is used to represent both configurable data as well - // as data that might be computed in the process of creating this - // resource. + // The keys of this map are the names used in a practitioner configuration, + // such as the attribute or block name. The values describe the structure + // and type information of that attribute or block. Schema map[string]*Schema // SchemaVersion is the version number for this resource's Schema - // definition. The current SchemaVersion stored in the state for each - // resource. Provider authors can increment this version number - // when Schema semantics change. If the State's SchemaVersion is less than - // the current SchemaVersion, the InstanceState is yielded to the - // MigrateState callback, where the provider can make whatever changes it - // needs to update the state to be compatible to the latest version of the - // Schema. + // definition. This field is only valid when the Resource is a managed + // resource. + // + // The current SchemaVersion stored in the state for each resource. + // Provider authors can increment this version number when Schema semantics + // change in an incompatible manner. If the state's SchemaVersion is less + // than the current SchemaVersion, the MigrateState and StateUpgraders + // functionality is executed to upgrade the state information. // // When unset, SchemaVersion defaults to 0, so provider authors can start // their Versioning at any integer >= 1 @@ -67,6 +76,7 @@ type Resource struct { // MigrateState is responsible for updating an InstanceState with an old // version to the format expected by the current version of the Schema. + // This field is only valid when the Resource is a managed resource. // // It is called during Refresh if the State's stored SchemaVersion is less // than the current SchemaVersion of the Resource. @@ -86,7 +96,8 @@ type Resource struct { // StateUpgraders contains the functions responsible for upgrading an // existing state with an old schema version to a newer schema. It is // called specifically by Terraform when the stored schema version is less - // than the current SchemaVersion of the Resource. + // than the current SchemaVersion of the Resource. This field is only valid + // when the Resource is a managed resource. // // StateUpgraders map specific schema versions to a StateUpgrader // function. The registered versions are expected to be ordered, @@ -95,60 +106,409 @@ type Resource struct { // MigrateState. StateUpgraders []StateUpgrader - // The functions below are the CRUD operations for this resource. + // Create is called when the provider must create a new instance of a + // managed resource. This field is only valid when the Resource is a + // managed resource. Only one of Create, CreateContext, or + // CreateWithoutTimeout should be implemented. + // + // The *ResourceData parameter contains the plan and state data for this + // managed resource instance. The available data in the Get* methods is the + // the proposed state, which is the merged data of the practitioner + // configuration and any CustomizeDiff field logic. + // + // The SetId method must be called with a non-empty value for the managed + // resource instance to be properly saved into the Terraform state and + // avoid a "inconsistent result after apply" error. // - // Deprecated: Please use the context aware equivalents instead. Only one of - // the operations or context aware equivalent can be set, not both. + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The error return parameter, if not nil, will be converted into an error + // diagnostic when passed back to Terraform. + // + // Deprecated: Use CreateContext or CreateWithoutTimeout instead. This + // implementation does not support request cancellation initiated by + // Terraform, such as a system or practitioner sending SIGINT (Ctrl-c). + // This implementation also does not support warning diagnostics. Create CreateFunc - Read ReadFunc + + // Read is called when the provider must refresh the state of a managed + // resource instance or data resource instance. This field is only valid + // when the Resource is a managed resource or data resource. Only one of + // Read, ReadContext, or ReadWithoutTimeout should be implemented. + // + // The *ResourceData parameter contains the state data for this managed + // resource instance or data resource instance. + // + // Managed resources can signal to Terraform that the managed resource + // instance no longer exists and potentially should be recreated by calling + // the SetId method with an empty string ("") parameter and without + // returning an error. + // + // Data resources that are designed to return state for a singular + // infrastructure component should conventionally return an error if that + // infrastructure does not exist and omit any calls to the + // SetId method. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The error return parameter, if not nil, will be converted into an error + // diagnostic when passed back to Terraform. + // + // Deprecated: Use ReadContext or ReadWithoutTimeout instead. This + // implementation does not support request cancellation initiated by + // Terraform, such as a system or practitioner sending SIGINT (Ctrl-c). + // This implementation also does not support warning diagnostics. + Read ReadFunc + + // Update is called when the provider must update an instance of a + // managed resource. This field is only valid when the Resource is a + // managed resource. Only one of Update, UpdateContext, or + // UpdateWithoutTimeout should be implemented. + // + // This implementation is optional. If omitted, all Schema must enable + // the ForceNew field and any practitioner changes that would have + // caused and update will instead destroy and recreate the infrastructure + // compontent. + // + // The *ResourceData parameter contains the plan and state data for this + // managed resource instance. The available data in the Get* methods is the + // the proposed state, which is the merged data of the prior state, + // practitioner configuration, and any CustomizeDiff field logic. The + // available data for the GetChange* and HasChange* methods is the prior + // state and proposed state. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The error return parameter, if not nil, will be converted into an error + // diagnostic when passed back to Terraform. + // + // Deprecated: Use UpdateContext or UpdateWithoutTimeout instead. This + // implementation does not support request cancellation initiated by + // Terraform, such as a system or practitioner sending SIGINT (Ctrl-c). + // This implementation also does not support warning diagnostics. Update UpdateFunc + + // Delete is called when the provider must destroy the instance of a + // managed resource. This field is only valid when the Resource is a + // managed resource. Only one of Delete, DeleteContext, or + // DeleteWithoutTimeout should be implemented. + // + // The *ResourceData parameter contains the state data for this managed + // resource instance. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The error return parameter, if not nil, will be converted into an error + // diagnostic when passed back to Terraform. + // + // Deprecated: Use DeleteContext or DeleteWithoutTimeout instead. This + // implementation does not support request cancellation initiated by + // Terraform, such as a system or practitioner sending SIGINT (Ctrl-c). + // This implementation also does not support warning diagnostics. Delete DeleteFunc // Exists is a function that is called to check if a resource still - // exists. If this returns false, then this will affect the diff + // exists. This field is only valid when the Resource is a managed + // resource. + // + // If this returns false, then this will affect the diff // accordingly. If this function isn't set, it will not be called. You // can also signal existence in the Read method by calling d.SetId("") // if the Resource is no longer present and should be removed from state. // The *ResourceData passed to Exists should _not_ be modified. // - // Deprecated: ReadContext should be able to encapsulate the logic of Exists + // Deprecated: Remove in preference of ReadContext or ReadWithoutTimeout. Exists ExistsFunc - // The functions below are the CRUD operations for this resource. + // CreateContext is called when the provider must create a new instance of + // a managed resource. This field is only valid when the Resource is a + // managed resource. Only one of Create, CreateContext, or + // CreateWithoutTimeout should be implemented. + // + // The Context parameter stores SDK information, such as loggers and + // timeout deadlines. It also is wired to receive any cancellation from + // Terraform such as a system or practitioner sending SIGINT (Ctrl-c). // - // The only optional operation is Update. If Update is not - // implemented, then updates will not be supported for this resource. + // By default, CreateContext has a 20 minute timeout. Use the Timeouts + // field to control the default duration or implement CreateWithoutTimeout + // instead of CreateContext to remove the default timeout. // - // The ResourceData parameter in the functions below are used to - // query configuration and changes for the resource as well as to set - // the ID, computed data, etc. + // The *ResourceData parameter contains the plan and state data for this + // managed resource instance. The available data in the Get* methods is the + // the proposed state, which is the merged data of the practitioner + // configuration and any CustomizeDiff field logic. // - // The interface{} parameter is the result of the ConfigureFunc in - // the provider for this resource. If the provider does not define - // a ConfigureFunc, this will be nil. This parameter should be used - // to store API clients, configuration structures, etc. + // The SetId method must be called with a non-empty value for the managed + // resource instance to be properly saved into the Terraform state and + // avoid a "inconsistent result after apply" error. // - // These functions are passed a context configured to timeout with whatever - // was set as the timeout for this operation. Useful for forwarding on to - // backend SDK's that accept context. The context will also cancel if - // Terraform sends a cancellation signal. + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. // - // These functions return diagnostics, allowing developers to build - // a list of warnings and errors to be presented to the Terraform user. - // The AttributePath of those diagnostics should be built within these - // functions, please consult go-cty documentation for building a cty.Path + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. CreateContext CreateContextFunc - ReadContext ReadContextFunc + + // ReadContext is called when the provider must refresh the state of a managed + // resource instance or data resource instance. This field is only valid + // when the Resource is a managed resource or data resource. Only one of + // Read, ReadContext, or ReadWithoutTimeout should be implemented. + // + // The Context parameter stores SDK information, such as loggers and + // timeout deadlines. It also is wired to receive any cancellation from + // Terraform such as a system or practitioner sending SIGINT (Ctrl-c). + // + // By default, ReadContext has a 20 minute timeout. Use the Timeouts + // field to control the default duration or implement ReadWithoutTimeout + // instead of ReadContext to remove the default timeout. + // + // The *ResourceData parameter contains the state data for this managed + // resource instance or data resource instance. + // + // Managed resources can signal to Terraform that the managed resource + // instance no longer exists and potentially should be recreated by calling + // the SetId method with an empty string ("") parameter and without + // returning an error. + // + // Data resources that are designed to return state for a singular + // infrastructure component should conventionally return an error if that + // infrastructure does not exist and omit any calls to the + // SetId method. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. + ReadContext ReadContextFunc + + // UpdateContext is called when the provider must update an instance of a + // managed resource. This field is only valid when the Resource is a + // managed resource. Only one of Update, UpdateContext, or + // UpdateWithoutTimeout should be implemented. + // + // This implementation is optional. If omitted, all Schema must enable + // the ForceNew field and any practitioner changes that would have + // caused and update will instead destroy and recreate the infrastructure + // compontent. + // + // The Context parameter stores SDK information, such as loggers and + // timeout deadlines. It also is wired to receive any cancellation from + // Terraform such as a system or practitioner sending SIGINT (Ctrl-c). + // + // By default, UpdateContext has a 20 minute timeout. Use the Timeouts + // field to control the default duration or implement UpdateWithoutTimeout + // instead of UpdateContext to remove the default timeout. + // + // The *ResourceData parameter contains the plan and state data for this + // managed resource instance. The available data in the Get* methods is the + // the proposed state, which is the merged data of the prior state, + // practitioner configuration, and any CustomizeDiff field logic. The + // available data for the GetChange* and HasChange* methods is the prior + // state and proposed state. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. UpdateContext UpdateContextFunc + + // DeleteContext is called when the provider must destroy the instance of a + // managed resource. This field is only valid when the Resource is a + // managed resource. Only one of Delete, DeleteContext, or + // DeleteWithoutTimeout should be implemented. + // + // The Context parameter stores SDK information, such as loggers and + // timeout deadlines. It also is wired to receive any cancellation from + // Terraform such as a system or practitioner sending SIGINT (Ctrl-c). + // + // By default, DeleteContext has a 20 minute timeout. Use the Timeouts + // field to control the default duration or implement DeleteWithoutTimeout + // instead of DeleteContext to remove the default timeout. + // + // The *ResourceData parameter contains the state data for this managed + // resource instance. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. DeleteContext DeleteContextFunc - // CustomizeDiff is a custom function for working with the diff that - // Terraform has created for this resource - it can be used to customize the - // diff that has been created, diff values not controlled by configuration, - // or even veto the diff altogether and abort the plan. It is passed a - // *ResourceDiff, a structure similar to ResourceData but lacking most write - // functions like Set, while introducing new functions that work with the - // diff such as SetNew, SetNewComputed, and ForceNew. + // CreateWithoutTimeout is called when the provider must create a new + // instance of a managed resource. This field is only valid when the + // Resource is a managed resource. Only one of Create, CreateContext, or + // CreateWithoutTimeout should be implemented. + // + // Most resources should prefer CreateContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + // + // The Context parameter stores SDK information, such as loggers. It also + // is wired to receive any cancellation from Terraform such as a system or + // practitioner sending SIGINT (Ctrl-c). + // + // The *ResourceData parameter contains the plan and state data for this + // managed resource instance. The available data in the Get* methods is the + // the proposed state, which is the merged data of the practitioner + // configuration and any CustomizeDiff field logic. + // + // The SetId method must be called with a non-empty value for the managed + // resource instance to be properly saved into the Terraform state and + // avoid a "inconsistent result after apply" error. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. + CreateWithoutTimeout CreateContextFunc + + // ReadWithoutTimeout is called when the provider must refresh the state of + // a managed resource instance or data resource instance. This field is + // only valid when the Resource is a managed resource or data resource. + // Only one of Read, ReadContext, or ReadWithoutTimeout should be + // implemented. + // + // Most resources should prefer ReadContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + // + // The Context parameter stores SDK information, such as loggers. It also + // is wired to receive any cancellation from Terraform such as a system or + // practitioner sending SIGINT (Ctrl-c). + // + // The *ResourceData parameter contains the state data for this managed + // resource instance or data resource instance. + // + // Managed resources can signal to Terraform that the managed resource + // instance no longer exists and potentially should be recreated by calling + // the SetId method with an empty string ("") parameter and without + // returning an error. + // + // Data resources that are designed to return state for a singular + // infrastructure component should conventionally return an error if that + // infrastructure does not exist and omit any calls to the + // SetId method. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. + ReadWithoutTimeout ReadContextFunc + + // UpdateWithoutTimeout is called when the provider must update an instance + // of a managed resource. This field is only valid when the Resource is a + // managed resource. Only one of Update, UpdateContext, or + // UpdateWithoutTimeout should be implemented. + // + // Most resources should prefer UpdateContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + // + // This implementation is optional. If omitted, all Schema must enable + // the ForceNew field and any practitioner changes that would have + // caused and update will instead destroy and recreate the infrastructure + // compontent. + // + // The Context parameter stores SDK information, such as loggers. It also + // is wired to receive any cancellation from Terraform such as a system or + // practitioner sending SIGINT (Ctrl-c). + // + // The *ResourceData parameter contains the plan and state data for this + // managed resource instance. The available data in the Get* methods is the + // the proposed state, which is the merged data of the prior state, + // practitioner configuration, and any CustomizeDiff field logic. The + // available data for the GetChange* and HasChange* methods is the prior + // state and proposed state. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. + UpdateWithoutTimeout UpdateContextFunc + + // DeleteWithoutTimeout is called when the provider must destroy the + // instance of a managed resource. This field is only valid when the + // Resource is a managed resource. Only one of Delete, DeleteContext, or + // DeleteWithoutTimeout should be implemented. + // + // Most resources should prefer DeleteContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + // + // The Context parameter stores SDK information, such as loggers. It also + // is wired to receive any cancellation from Terraform such as a system or + // practitioner sending SIGINT (Ctrl-c). + // + // The *ResourceData parameter contains the state data for this managed + // resource instance. + // + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. + // + // The diagnostics return parameter, if not nil, can contain any + // combination and multiple of warning and/or error diagnostics. + DeleteWithoutTimeout DeleteContextFunc + + // CustomizeDiff is called after a difference (plan) has been generated + // for the Resource and allows for customizations, such as setting values + // not controlled by configuration, conditionally triggering resource + // recreation, or implementing additional validation logic to abort a plan. + // This field is only valid when the Resource is a managed resource. + // + // The Context parameter stores SDK information, such as loggers. It also + // is wired to receive any cancellation from Terraform such as a system or + // practitioner sending SIGINT (Ctrl-c). + // + // The *ResourceDiff parameter is similar to ResourceData but replaces the + // Set method with other difference handling methods, such as SetNew, + // SetNewComputed, and ForceNew. In general, only Schema with Computed + // enabled can have those methods executed against them. // // The phases Terraform runs this in, and the state available via functions // like Get and GetChange, are as follows: @@ -162,41 +522,60 @@ type Resource struct { // // This function needs to be resilient to support all scenarios. // - // For the most part, only computed fields can be customized by this - // function. + // The interface{} parameter is the result of the Provider type + // ConfigureFunc field execution. If the Provider does not define + // a ConfigureFunc, this will be nil. This parameter is conventionally + // used to store API clients and other provider instance specific data. // - // This function is only allowed on regular resources (not data sources). + // The error return parameter, if not nil, will be converted into an error + // diagnostic when passed back to Terraform. CustomizeDiff CustomizeDiffFunc - // Importer is the ResourceImporter implementation for this resource. + // Importer is called when the provider must import an instance of a + // managed resource. This field is only valid when the Resource is a + // managed resource. + // // If this is nil, then this resource does not support importing. If // this is non-nil, then it supports importing and ResourceImporter // must be validated. The validity of ResourceImporter is verified // by InternalValidate on Resource. Importer *ResourceImporter - // If non-empty, this string is emitted as a warning during Validate. + // If non-empty, this string is emitted as the details of a warning + // diagnostic during validation (validate, plan, and apply operations). + // This field is only valid when the Resource is a managed resource or + // data resource. DeprecationMessage string - // Timeouts allow users to specify specific time durations in which an - // operation should time out, to allow them to extend an action to suit their - // usage. For example, a user may specify a large Creation timeout for their - // AWS RDS Instance due to it's size, or restoring from a snapshot. - // Resource implementors must enable Timeout support by adding the allowed - // actions (Create, Read, Update, Delete, Default) to the Resource struct, and - // accessing them in the matching methods. + // Timeouts configures the default time duration allowed before a create, + // read, update, or delete operation is considered timed out, which returns + // an error to practitioners. This field is only valid when the Resource is + // a managed resource or data resource. + // + // When implemented, practitioners can add a timeouts configuration block + // within their managed resource or data resource configuration to further + // customize the create, read, update, or delete operation timeouts. For + // example, a configuration may specify a longer create timeout for a + // database resource due to its data size. + // + // The ResourceData that is passed to create, read, update, and delete + // functionality can access the merged time duration of the Resource + // default timeouts configured in this field and the practitioner timeouts + // configuration via the Timeout method. Practitioner configuration + // always overrides any default values set here, whether shorter or longer. Timeouts *ResourceTimeout // Description is used as the description for docs, the language server and // other user facing usage. It can be plain-text or markdown depending on the - // global DescriptionKind setting. + // global DescriptionKind setting. This field is valid for any Resource. Description string // UseJSONNumber should be set when state upgraders will expect // json.Numbers instead of float64s for numbers. This is added as a // toggle for backwards compatibility for type assertions, but should // be used in all new resources to avoid bugs with sufficiently large - // user input. + // user input. This field is only valid when the Resource is a managed + // resource. // // See github.com/hashicorp/terraform-plugin-sdk/issues/655 for more // details. @@ -228,9 +607,17 @@ func (r *Resource) ShimInstanceStateFromValue(state cty.Value) (*terraform.Insta // // Deprecated: Please use the context aware equivalents instead. type CreateFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type ReadFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type UpdateFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type DeleteFunc func(*ResourceData, interface{}) error + +// Deprecated: Please use the context aware equivalents instead. type ExistsFunc func(*ResourceData, interface{}) (bool, error) // See Resource documentation. @@ -249,6 +636,7 @@ type DeleteContextFunc func(context.Context, *ResourceData, interface{}) diag.Di type StateMigrateFunc func( int, *terraform.InstanceState, interface{}) (*terraform.InstanceState, error) +// Implementation of a single schema version state upgrade. type StateUpgrader struct { // Version is the version schema that this Upgrader will handle, converting // it to Version+1. @@ -267,7 +655,36 @@ type StateUpgrader struct { Upgrade StateUpgradeFunc } -// See StateUpgrader +// Function signature for a schema version state upgrade handler. +// +// The Context parameter stores SDK information, such as loggers. It also +// is wired to receive any cancellation from Terraform such as a system or +// practitioner sending SIGINT (Ctrl-c). +// +// The map[string]interface{} parameter contains the previous schema version +// state data for a managed resource instance. The keys are top level attribute +// or block names mapped to values that can be type asserted similar to +// fetching values using the ResourceData Get* methods: +// +// - TypeBool: bool +// - TypeFloat: float +// - TypeInt: int +// - TypeList: []interface{} +// - TypeMap: map[string]interface{} +// - TypeSet: *Set +// - TypeString: string +// +// In certain scenarios, the map may be nil, so checking for that condition +// upfront is recommended to prevent potential panics. +// +// The interface{} parameter is the result of the Provider type +// ConfigureFunc field execution. If the Provider does not define +// a ConfigureFunc, this will be nil. This parameter is conventionally +// used to store API clients and other provider instance specific data. +// +// The map[string]interface{} return parameter should contain the upgraded +// schema version state data for a managed resource instance. Values must +// align to the typing mentioned above. type StateUpgradeFunc func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) // See Resource documentation. @@ -280,6 +697,11 @@ func (r *Resource) create(ctx context.Context, d *ResourceData, meta interface{} } return nil } + + if r.CreateWithoutTimeout != nil { + return r.CreateWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutCreate)) defer cancel() return r.CreateContext(ctx, d, meta) @@ -292,6 +714,11 @@ func (r *Resource) read(ctx context.Context, d *ResourceData, meta interface{}) } return nil } + + if r.ReadWithoutTimeout != nil { + return r.ReadWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutRead)) defer cancel() return r.ReadContext(ctx, d, meta) @@ -304,6 +731,11 @@ func (r *Resource) update(ctx context.Context, d *ResourceData, meta interface{} } return nil } + + if r.UpdateWithoutTimeout != nil { + return r.UpdateWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutUpdate)) defer cancel() return r.UpdateContext(ctx, d, meta) @@ -316,6 +748,11 @@ func (r *Resource) delete(ctx context.Context, d *ResourceData, meta interface{} } return nil } + + if r.DeleteWithoutTimeout != nil { + return r.DeleteWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutDelete)) defer cancel() return r.DeleteContext(ctx, d, meta) @@ -341,16 +778,16 @@ func (r *Resource) Apply( rt := ResourceTimeout{} if _, ok := d.Meta[TimeoutKey]; ok { if err := rt.DiffDecode(d); err != nil { - log.Printf("[ERR] Error decoding ResourceTimeout: %s", err) + logging.HelperSchemaError(ctx, "Error decoding ResourceTimeout", map[string]interface{}{logging.KeyError: err}) } } else if s != nil { if _, ok := s.Meta[TimeoutKey]; ok { if err := rt.StateDecode(s); err != nil { - log.Printf("[ERR] Error decoding ResourceTimeout: %s", err) + logging.HelperSchemaError(ctx, "Error decoding ResourceTimeout", map[string]interface{}{logging.KeyError: err}) } } } else { - log.Printf("[DEBUG] No meta timeoutkey found in Apply()") + logging.HelperSchemaDebug(ctx, "No meta timeoutkey found in Apply()") } data.timeouts = &rt @@ -365,7 +802,10 @@ func (r *Resource) Apply( if d.Destroy || d.RequiresNew() { if s.ID != "" { // Destroy the resource since it is created + logging.HelperSchemaTrace(ctx, "Calling downstream") diags = append(diags, r.delete(ctx, data, meta)...) + logging.HelperSchemaTrace(ctx, "Called downstream") + if diags.HasError() { return r.recordCurrentSchemaVersion(data.State()), diags } @@ -393,7 +833,9 @@ func (r *Resource) Apply( if data.Id() == "" { // We're creating, it is a new resource. data.MarkNewResource() + logging.HelperSchemaTrace(ctx, "Calling downstream") diags = append(diags, r.create(ctx, data, meta)...) + logging.HelperSchemaTrace(ctx, "Called downstream") } else { if !r.updateFuncSet() { return s, append(diags, diag.Diagnostic{ @@ -401,7 +843,9 @@ func (r *Resource) Apply( Summary: "doesn't support update", }) } + logging.HelperSchemaTrace(ctx, "Calling downstream") diags = append(diags, r.update(ctx, data, meta)...) + logging.HelperSchemaTrace(ctx, "Called downstream") } return r.recordCurrentSchemaVersion(data.State()), diags @@ -428,10 +872,10 @@ func (r *Resource) Diff( if instanceDiff != nil { if err := t.DiffEncode(instanceDiff); err != nil { - log.Printf("[ERR] Error encoding timeout to instance diff: %s", err) + logging.HelperSchemaError(ctx, "Error encoding timeout to instance diff", map[string]interface{}{logging.KeyError: err}) } } else { - log.Printf("[DEBUG] Instance Diff is nil in Diff()") + logging.HelperSchemaDebug(ctx, "Instance Diff is nil in Diff()") } return instanceDiff, err @@ -495,7 +939,10 @@ func (r *Resource) ReadDataApply( return nil, diag.FromErr(err) } + logging.HelperSchemaTrace(ctx, "Calling downstream") diags := r.read(ctx, data, meta) + logging.HelperSchemaTrace(ctx, "Called downstream") + state := data.State() if state != nil && state.ID == "" { // Data sources can set an ID if they want, but they aren't @@ -524,7 +971,7 @@ func (r *Resource) RefreshWithoutUpgrade( rt := ResourceTimeout{} if _, ok := s.Meta[TimeoutKey]; ok { if err := rt.StateDecode(s); err != nil { - log.Printf("[ERR] Error decoding ResourceTimeout: %s", err) + logging.HelperSchemaError(ctx, "Error decoding ResourceTimeout", map[string]interface{}{logging.KeyError: err}) } } @@ -541,7 +988,10 @@ func (r *Resource) RefreshWithoutUpgrade( data.providerMeta = s.ProviderMeta } + logging.HelperSchemaTrace(ctx, "Calling downstream") exists, err := r.Exists(data, meta) + logging.HelperSchemaTrace(ctx, "Called downstream") + if err != nil { return s, diag.FromErr(err) } @@ -561,29 +1011,33 @@ func (r *Resource) RefreshWithoutUpgrade( data.providerMeta = s.ProviderMeta } + logging.HelperSchemaTrace(ctx, "Calling downstream") diags := r.read(ctx, data, meta) + logging.HelperSchemaTrace(ctx, "Called downstream") + state := data.State() if state != nil && state.ID == "" { state = nil } + schemaMap(r.Schema).handleDiffSuppressOnRefresh(ctx, s, state) return r.recordCurrentSchemaVersion(state), diags } func (r *Resource) createFuncSet() bool { - return (r.Create != nil || r.CreateContext != nil) + return (r.Create != nil || r.CreateContext != nil || r.CreateWithoutTimeout != nil) } func (r *Resource) readFuncSet() bool { - return (r.Read != nil || r.ReadContext != nil) + return (r.Read != nil || r.ReadContext != nil || r.ReadWithoutTimeout != nil) } func (r *Resource) updateFuncSet() bool { - return (r.Update != nil || r.UpdateContext != nil) + return (r.Update != nil || r.UpdateContext != nil || r.UpdateWithoutTimeout != nil) } func (r *Resource) deleteFuncSet() bool { - return (r.Delete != nil || r.DeleteContext != nil) + return (r.Delete != nil || r.DeleteContext != nil || r.DeleteWithoutTimeout != nil) } // InternalValidate should be called to validate the structure @@ -666,8 +1120,8 @@ func (r *Resource) InternalValidate(topSchemaMap schemaMap, writable bool) error } } - for k, f := range tsm { - if isReservedResourceFieldName(k, f) { + for k := range tsm { + if isReservedResourceFieldName(k) { return fmt.Errorf("%s is a reserved field name", k) } } @@ -722,6 +1176,34 @@ func (r *Resource) InternalValidate(topSchemaMap schemaMap, writable bool) error return fmt.Errorf("DeleteContext and Delete should not both be set") } + // check context funcs are not set alongside their without timeout counterparts + if r.CreateContext != nil && r.CreateWithoutTimeout != nil { + return fmt.Errorf("CreateContext and CreateWithoutTimeout should not both be set") + } + if r.ReadContext != nil && r.ReadWithoutTimeout != nil { + return fmt.Errorf("ReadContext and ReadWithoutTimeout should not both be set") + } + if r.UpdateContext != nil && r.UpdateWithoutTimeout != nil { + return fmt.Errorf("UpdateContext and UpdateWithoutTimeout should not both be set") + } + if r.DeleteContext != nil && r.DeleteWithoutTimeout != nil { + return fmt.Errorf("DeleteContext and DeleteWithoutTimeout should not both be set") + } + + // check non-context funcs are not set alongside the context without timeout counterparts + if r.Create != nil && r.CreateWithoutTimeout != nil { + return fmt.Errorf("Create and CreateWithoutTimeout should not both be set") + } + if r.Read != nil && r.ReadWithoutTimeout != nil { + return fmt.Errorf("Read and ReadWithoutTimeout should not both be set") + } + if r.Update != nil && r.UpdateWithoutTimeout != nil { + return fmt.Errorf("Update and UpdateWithoutTimeout should not both be set") + } + if r.Delete != nil && r.DeleteWithoutTimeout != nil { + return fmt.Errorf("Delete and DeleteWithoutTimeout should not both be set") + } + return schemaMap(r.Schema).InternalValidate(tsm) } @@ -745,13 +1227,13 @@ func validateResourceID(s *Schema) error { // ID should at least be computed. If unspecified it will be set to Computed and Optional, // but Optional is unnecessary if undesired. - if s.Computed != true { + if !s.Computed { return fmt.Errorf(`the "id" attribute must be marked Computed`) } return nil } -func isReservedResourceFieldName(name string, s *Schema) bool { +func isReservedResourceFieldName(name string) bool { for _, reservedName := range ReservedResourceFields { if name == reservedName { return true diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go index d12e75460..396b5bc6f 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go @@ -7,6 +7,7 @@ import ( "sync" "time" + "github.com/google/go-cmp/cmp" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/go-cty/cty/gocty" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -132,6 +133,9 @@ func (d *ResourceData) HasChanges(keys ...string) bool { // // This function only works with root attribute keys. func (d *ResourceData) HasChangesExcept(keys ...string) bool { + if d == nil || d.diff == nil { + return false + } for attr := range d.diff.Attributes { rootAttr := strings.Split(attr, ".")[0] var skipAttr bool @@ -155,20 +159,16 @@ func (d *ResourceData) HasChangesExcept(keys ...string) bool { func (d *ResourceData) HasChange(key string) bool { o, n := d.GetChange(key) - // If the type implements the Equal interface, then call that - // instead of just doing a reflect.DeepEqual. An example where this is - // needed is *Set - if eq, ok := o.(Equal); ok { - return !eq.Equal(n) - } - - return !reflect.DeepEqual(o, n) + return !cmp.Equal(n, o) } // HasChangeExcept returns whether any keys outside the given key have been changed. // // This function only works with root attribute keys. func (d *ResourceData) HasChangeExcept(key string) bool { + if d == nil || d.diff == nil { + return false + } for attr := range d.diff.Attributes { rootAttr := strings.Split(attr, ".")[0] @@ -528,7 +528,7 @@ func (d *ResourceData) getChange( func (d *ResourceData) get(addr []string, source getSource) getResult { d.once.Do(d.init) - level := "set" + var level string flags := source & ^getSourceLevelMask exact := flags&getSourceExact != 0 source = source & getSourceLevelMask @@ -580,3 +580,51 @@ func (d *ResourceData) GetProviderMeta(dst interface{}) error { } return gocty.FromCtyValue(d.providerMeta, &dst) } + +// GetRawConfig returns the cty.Value that Terraform sent the SDK for the +// config. If no value was sent, or if a null value was sent, the value will be +// a null value of the resource's type. +// +// GetRawConfig is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceData) GetRawConfig() cty.Value { + if d.diff != nil && !d.diff.RawConfig.IsNull() { + return d.diff.RawConfig + } + if d.state != nil && !d.state.RawConfig.IsNull() { + return d.state.RawConfig + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawState returns the cty.Value that Terraform sent the SDK for the state. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawState is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceData) GetRawState() cty.Value { + if d.diff != nil && !d.diff.RawState.IsNull() { + return d.diff.RawState + } + if d.state != nil && !d.state.RawState.IsNull() { + return d.state.RawState + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawPlan returns the cty.Value that Terraform sent the SDK for the plan. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawPlan is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceData) GetRawPlan() cty.Value { + if d.diff != nil && !d.diff.RawPlan.IsNull() { + return d.diff.RawPlan + } + if d.state != nil && !d.state.RawPlan.IsNull() { + return d.state.RawPlan + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go index 984929df7..27575b297 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_diff.go @@ -7,6 +7,7 @@ import ( "strings" "sync" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -246,20 +247,20 @@ func (d *ResourceDiff) clear(key string) error { } for k := range d.diff.Attributes { - if strings.HasPrefix(k, key) { + if k == key || childAddrOf(k, key) { delete(d.diff.Attributes, k) } } return nil } -// GetChangedKeysPrefix helps to implement Resource.CustomizeDiff -// where we need to act on all nested fields -// without calling out each one separately +// GetChangedKeysPrefix helps to implement Resource.CustomizeDiff where we need to act +// on all nested fields without calling out each one separately. +// An empty prefix is supported, returning all changed keys. func (d *ResourceDiff) GetChangedKeysPrefix(prefix string) []string { keys := make([]string, 0) for k := range d.diff.Attributes { - if strings.HasPrefix(k, prefix) { + if k == prefix || childAddrOf(k, prefix) || prefix == "" { keys = append(keys, k) } } @@ -269,16 +270,16 @@ func (d *ResourceDiff) GetChangedKeysPrefix(prefix string) []string { // diffChange helps to implement resourceDiffer and derives its change values // from ResourceDiff's own change data, in addition to existing diff, config, and state. func (d *ResourceDiff) diffChange(key string) (interface{}, interface{}, bool, bool, bool) { - old, new, customized := d.getChange(key) + oldValue, newValue, customized := d.getChange(key) - if !old.Exists { - old.Value = nil + if !oldValue.Exists { + oldValue.Value = nil } - if !new.Exists || d.removed(key) { - new.Value = nil + if !newValue.Exists || d.removed(key) { + newValue.Value = nil } - return old.Value, new.Value, !reflect.DeepEqual(old.Value, new.Value), new.Computed, customized + return oldValue.Value, newValue.Value, !reflect.DeepEqual(oldValue.Value, newValue.Value), newValue.Computed, customized } // SetNew is used to set a new diff value for the mentioned key. The value must @@ -307,12 +308,12 @@ func (d *ResourceDiff) SetNewComputed(key string) error { } // setDiff performs common diff setting behaviour. -func (d *ResourceDiff) setDiff(key string, new interface{}, computed bool) error { +func (d *ResourceDiff) setDiff(key string, newValue interface{}, computed bool) error { if err := d.clear(key); err != nil { return err } - if err := d.newWriter.WriteField(strings.Split(key, "."), new, computed); err != nil { + if err := d.newWriter.WriteField(strings.Split(key, "."), newValue, computed); err != nil { return fmt.Errorf("Cannot set new diff value for key %s: %s", key, err) } @@ -373,8 +374,8 @@ func (d *ResourceDiff) Get(key string) interface{} { // results from the exact levels for the new diff, then from state and diff as // per normal. func (d *ResourceDiff) GetChange(key string) (interface{}, interface{}) { - old, new, _ := d.getChange(key) - return old.Value, new.Value + oldValue, newValue, _ := d.getChange(key) + return oldValue.Value, newValue.Value } // GetOk functions the same way as ResourceData.GetOk, but it also checks the @@ -421,19 +422,29 @@ func (d *ResourceDiff) NewValueKnown(key string) bool { return !r.Computed } +// HasChanges returns whether or not any of the given keys has been changed. +func (d *ResourceDiff) HasChanges(keys ...string) bool { + for _, key := range keys { + if d.HasChange(key) { + return true + } + } + return false +} + // HasChange checks to see if there is a change between state and the diff, or // in the overridden diff. func (d *ResourceDiff) HasChange(key string) bool { - old, new := d.GetChange(key) + oldValue, newValue := d.GetChange(key) // If the type implements the Equal interface, then call that // instead of just doing a reflect.DeepEqual. An example where this is // needed is *Set - if eq, ok := old.(Equal); ok { - return !eq.Equal(new) + if eq, ok := oldValue.(Equal); ok { + return !eq.Equal(newValue) } - return !reflect.DeepEqual(old, new) + return !reflect.DeepEqual(oldValue, newValue) } // Id returns the ID of this resource. @@ -450,6 +461,54 @@ func (d *ResourceDiff) Id() string { return result } +// GetRawConfig returns the cty.Value that Terraform sent the SDK for the +// config. If no value was sent, or if a null value was sent, the value will be +// a null value of the resource's type. +// +// GetRawConfig is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceDiff) GetRawConfig() cty.Value { + if d.diff != nil { + return d.diff.RawConfig + } + if d.state != nil { + return d.state.RawConfig + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawState returns the cty.Value that Terraform sent the SDK for the state. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawState is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceDiff) GetRawState() cty.Value { + if d.diff != nil { + return d.diff.RawState + } + if d.state != nil { + return d.state.RawState + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + +// GetRawPlan returns the cty.Value that Terraform sent the SDK for the plan. +// If no value was sent, or if a null value was sent, the value will be a null +// value of the resource's type. +// +// GetRawPlan is considered experimental and advanced functionality, and +// familiarity with the Terraform protocol is suggested when using it. +func (d *ResourceDiff) GetRawPlan() cty.Value { + if d.diff != nil { + return d.diff.RawPlan + } + if d.state != nil { + return d.state.RawPlan + } + return cty.NullVal(schemaMap(d.schema).CoreConfigSchema().ImpliedType()) +} + // getChange gets values from two different levels, designed for use in // diffChange, HasChange, and GetChange. // @@ -457,16 +516,16 @@ func (d *ResourceDiff) Id() string { // results from the exact levels for the new diff, then from state and diff as // per normal. func (d *ResourceDiff) getChange(key string) (getResult, getResult, bool) { - old := d.get(strings.Split(key, "."), "state") - var new getResult + oldValue := d.get(strings.Split(key, "."), "state") + var newValue getResult for p := range d.updatedKeys { if childAddrOf(key, p) { - new = d.getExact(strings.Split(key, "."), "newDiff") - return old, new, true + newValue = d.getExact(strings.Split(key, "."), "newDiff") + return oldValue, newValue, true } } - new = d.get(strings.Split(key, "."), "newDiff") - return old, new, false + newValue = d.get(strings.Split(key, "."), "newDiff") + return oldValue, newValue, false } // removed checks to see if the key is present in the existing, pre-customized diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_timeout.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_timeout.go index cee0b6781..2594677f5 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_timeout.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_timeout.go @@ -137,7 +137,13 @@ func (t *ResourceTimeout) ConfigDecode(s *Resource, c *terraform.ResourceConfig) *timeout = rt } - return nil + + // This early return, which makes this function handle a single + // timeout configuration block, should likely not be here but the + // SDK has never raised an error for multiple blocks nor made any + // precedence decisions for them in the past. + // It is left here for compatibility reasons. + return nil //nolint:staticcheck } } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go index 7146bef76..7cbd58589 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/schema.go @@ -23,17 +23,24 @@ import ( "strings" "github.com/hashicorp/go-cty/cty" + "github.com/hashicorp/terraform-plugin-log/tfsdklog" "github.com/mitchellh/copystructure" "github.com/mitchellh/mapstructure" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim" + "github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -// Schema is used to describe the structure of a value. +// Schema describes the structure and type information of a value, whether +// sourced from configuration, plan, or state data. Schema is used in Provider +// and Resource types (for managed resources and data resources) and is +// fundamental to the implementations of ResourceData and ResourceDiff. // -// Read the documentation of the struct elements for important details. +// The Type field must always be set. At least one of Required, Optional, +// Optional and Computed, or Computed must be enabled unless the Schema is +// directly an implementation of an Elem field of another Schema. type Schema struct { // Type is the type of the value and must be one of the ValueType values. // @@ -71,14 +78,37 @@ type Schema struct { // behavior, and SchemaConfigModeBlock is not permitted. ConfigMode SchemaConfigMode - // If one of these is set, then this item can come from the configuration. - // Both cannot be set. If Optional is set, the value is optional. If - // Required is set, the value is required. + // Required indicates whether the practitioner must enter a value in the + // configuration for this attribute. Required cannot be used with Computed + // Default, DefaultFunc, DiffSuppressFunc, DiffSuppressOnRefresh, + // InputDefault, Optional, or StateFunc. At least one of Required, + // Optional, Optional and Computed, or Computed must be enabled. + Required bool + + // Optional indicates whether the practitioner can choose to not enter + // a value in the configuration for this attribute. Optional cannot be used + // with Required. // - // One of these must be set if the value is not computed. That is: - // value either comes from the config, is computed, or is both. + // If also using Default or DefaultFunc, Computed should also be enabled, + // otherwise Terraform can output warning logs or "inconsistent result + // after apply" errors. Optional bool - Required bool + + // Computed indicates whether the provider may return its own value for + // this attribute or not. Computed cannot be used with Required. If + // Required and Optional are both false, the attribute will be considered + // "read only" for the practitioner, with only the provider able to set + // its value. + Computed bool + + // ForceNew indicates whether a change in this value requires the + // replacement (destroy and create) of the managed resource instance, + // rather than an in-place update. This field is only valid when the + // encapsulating Resource is a managed resource. + // + // If conditional replacement logic is needed, use the Resource type + // CustomizeDiff field to call the ResourceDiff type ForceNew method. + ForceNew bool // If this is non-nil, the provided function will be used during diff // of this field. If this is nil, a default diff for the type of the @@ -87,31 +117,74 @@ type Schema struct { // This allows comparison based on something other than primitive, list // or map equality - for example SSH public keys may be considered // equivalent regardless of trailing whitespace. + // + // If CustomizeDiffFunc makes this field ForceNew=true, the + // following DiffSuppressFunc will come in with the value of old being + // empty, as if creating a new resource. + // + // By default, DiffSuppressFunc is considered only when deciding whether + // a configuration value is significantly different than the prior state + // value during planning. Set DiffSuppressOnRefresh to opt in to checking + // this also during the refresh step. DiffSuppressFunc SchemaDiffSuppressFunc - // If this is non-nil, then this will be a default value that is used - // when this item is not set in the configuration. + // DiffSuppressOnRefresh enables using the DiffSuppressFunc to ignore + // normalization-classified changes returned by the resource type's + // "Read" or "ReadContext" function, in addition to the default behavior of + // doing so during planning. + // + // This is a particularly good choice for attributes which take strings + // containing "microsyntaxes" where various different values are packed + // together in some serialization where there are many ways to express the + // same information. For example, attributes which accept JSON data can + // include different whitespace characters without changing meaning, and + // case-insensitive identifiers may refer to the same object using different + // characters. + // + // This is valid only for attributes of primitive types, because + // DiffSuppressFunc itself is only compatible with primitive types. // - // DefaultFunc can be specified to compute a dynamic default. - // Only one of Default or DefaultFunc can be set. If DefaultFunc is - // used then its return value should be stable to avoid generating - // confusing/perpetual diffs. + // The key benefit of activating this flag is that the result of Read or + // ReadContext will be cleaned of normalization-only changes in the same + // way as the planning result would normaly be, which therefore prevents + // churn for downstream expressions deriving from this attribute and + // prevents incorrect "Values changed outside of Terraform" messages + // when the remote API returns values which have the same meaning as the + // prior state but in a different serialization. // - // Changing either Default or the return value of DefaultFunc can be - // a breaking change, especially if the attribute in question has - // ForceNew set. If a default needs to change to align with changing - // assumptions in an upstream API then it may be necessary to also use - // the MigrateState function on the resource to change the state to match, - // or have the Read function adjust the state value to align with the - // new default. + // This is an opt-in because it was a later addition to the DiffSuppressFunc + // functionality which would cause some significant changes in behavior + // for existing providers if activated everywhere all at once. + DiffSuppressOnRefresh bool + + // Default indicates a value to set if this attribute is not set in the + // configuration. Default cannot be used with DefaultFunc or Required. + // Default is only supported if the Type is TypeBool, TypeFloat, TypeInt, + // or TypeString. Default cannot be used if the Schema is directly an + // implementation of an Elem field of another Schema, such as trying to + // set a default value for a TypeList or TypeSet. // - // If Required is true above, then Default cannot be set. DefaultFunc - // can be set with Required. If the DefaultFunc returns nil, then there - // will be no default and the user will be asked to fill it in. + // Changing either Default can be a breaking change, especially if the + // attribute has ForceNew enabled. If a default needs to change to align + // with changing assumptions in an upstream API, then it may be necessary + // to also implement resource state upgrade functionality to change the + // state to match or update read operation logic to align with the new + // default. + Default interface{} + + // DefaultFunc can be specified to compute a dynamic default when this + // attribute is not set in the configuration. DefaultFunc cannot be used + // with Default. For legacy reasons, DefaultFunc can be used with Required + // attributes in a Provider schema, which will prompt practitioners for + // input if the result of this function is nil. // - // If either of these is set, then the user won't be asked for input - // for this key if the default is not nil. - Default interface{} + // The return value should be stable to avoid generating confusing + // plan differences. Changing the return value can be a breaking change, + // especially if ForceNew is enabled. If a default needs to change to align + // with changing assumptions in an upstream API, then it may be necessary + // to also implement resource state upgrade functionality to change the + // state to match or update read operation logic to align with the new + // default. DefaultFunc SchemaDefaultFunc // Description is used as the description for docs, the language server and @@ -124,85 +197,125 @@ type Schema struct { // asked for. If Input is asked, this will be the default value offered. InputDefault string - // The fields below relate to diffs. - // - // If Computed is true, then the result of this value is computed - // (unless specified by config) on creation. - // - // If ForceNew is true, then a change in this resource necessitates - // the creation of a new resource. - // // StateFunc is a function called to change the value of this before // storing it in the state (and likewise before comparing for diffs). // The use for this is for example with large strings, you may want // to simply store the hash of it. - Computed bool - ForceNew bool StateFunc SchemaStateFunc - // The following fields are only set for a TypeList, TypeSet, or TypeMap. + // Elem represents the element type for a TypeList, TypeSet, or TypeMap + // attribute or block. The only valid types are *Schema and *Resource. + // Only TypeList and TypeSet support *Resource. + // + // If the Elem is a *Schema, the surrounding Schema represents a single + // attribute with a single element type for underlying elements. In + // practitioner configurations, an equals sign (=) is required to set + // the value. Refer to the following documentation: + // + // https://www.terraform.io/docs/language/syntax/configuration.html + // + // The underlying *Schema is only required to implement Type. ValidateFunc + // or ValidateDiagFunc can be used to validate each element value. + // + // If the Elem is a *Resource, the surrounding Schema represents a + // configuration block. Blocks can contain underlying attributes or blocks. + // In practitioner configurations, an equals sign (=) cannot be used to + // set the value. Blocks are instead repeated as necessary, or require + // the use of dynamic block expressions. Refer to the following + // documentation: + // + // https://www.terraform.io/docs/language/syntax/configuration.html + // https://www.terraform.io/docs/language/expressions/dynamic-blocks.html // - // Elem represents the element type. For a TypeMap, it must be a *Schema - // with a Type that is one of the primitives: TypeString, TypeBool, - // TypeInt, or TypeFloat. Otherwise it may be either a *Schema or a - // *Resource. If it is *Schema, the element type is just a simple value. - // If it is *Resource, the element type is a complex structure, - // potentially managed via its own CRUD actions on the API. + // The underlying *Resource must only implement the Schema field. Elem interface{} - // The following fields are only set for a TypeList or TypeSet. - // // MaxItems defines a maximum amount of items that can exist within a - // TypeSet or TypeList. Specific use cases would be if a TypeSet is being - // used to wrap a complex structure, however more than one instance would - // cause instability. - // + // TypeSet or TypeList. + MaxItems int + // MinItems defines a minimum amount of items that can exist within a - // TypeSet or TypeList. Specific use cases would be if a TypeSet is being - // used to wrap a complex structure, however less than one instance would - // cause instability. + // TypeSet or TypeList. // // If the field Optional is set to true then MinItems is ignored and thus // effectively zero. - MaxItems int MinItems int - // The following fields are only valid for a TypeSet type. - // - // Set defines a function to determine the unique ID of an item so that - // a proper set can be built. + // Set defines custom hash algorithm for each TypeSet element. If not + // defined, the SDK implements a default hash algorithm based on the + // underlying structure and type information of the Elem field. Set SchemaSetFunc // ComputedWhen is a set of queries on the configuration. Whenever any // of these things is changed, it will require a recompute (this requires // that Computed is set to true). // - // NOTE: This currently does not work. + // Deprecated: This functionality is not implemented and this field + // declaration should be removed. ComputedWhen []string - // ConflictsWith is a set of schema keys that conflict with this schema. - // This will only check that they're set in the _config_. This will not - // raise an error for a malfunctioning resource that sets a conflicting - // key. - // - // ExactlyOneOf is a set of schema keys that, when set, only one of the - // keys in that list can be specified. It will error if none are - // specified as well. - // - // AtLeastOneOf is a set of schema keys that, when set, at least one of - // the keys in that list must be specified. + // ConflictsWith is a set of attribute paths, including this attribute, + // whose configurations cannot be set simultaneously. This implements the + // validation logic declaratively within the schema and can trigger earlier + // in Terraform operations, rather than using create or update logic which + // only triggers during apply. // - // RequiredWith is a set of schema keys that must be set simultaneously. + // Only absolute attribute paths, ones starting with top level attribute + // names, are supported. Attribute paths cannot be accurately declared + // for TypeList (if MaxItems is greater than 1), TypeMap, or TypeSet + // attributes. To reference an attribute under a single configuration block + // (TypeList with Elem of *Resource and MaxItems of 1), the syntax is + // "parent_block_name.0.child_attribute_name". ConflictsWith []string - ExactlyOneOf []string - AtLeastOneOf []string - RequiredWith []string - // When Deprecated is set, this attribute is deprecated. + // ExactlyOneOf is a set of attribute paths, including this attribute, + // where only one attribute out of all specified can be configured. It will + // return a validation error if none are specified as well. This implements + // the validation logic declaratively within the schema and can trigger + // earlier in Terraform operations, rather than using create or update + // logic which only triggers during apply. // - // A deprecated field still works, but will probably stop working in near - // future. This string is the message shown to the user with instructions on - // how to address the deprecation. + // Only absolute attribute paths, ones starting with top level attribute + // names, are supported. Attribute paths cannot be accurately declared + // for TypeList (if MaxItems is greater than 1), TypeMap, or TypeSet + // attributes. To reference an attribute under a single configuration block + // (TypeList with Elem of *Resource and MaxItems of 1), the syntax is + // "parent_block_name.0.child_attribute_name". + ExactlyOneOf []string + + // AtLeastOneOf is a set of attribute paths, including this attribute, + // in which at least one of the attributes must be configured. This + // implements the validation logic declaratively within the schema and can + // trigger earlier in Terraform operations, rather than using create or + // update logic which only triggers during apply. + // + // Only absolute attribute paths, ones starting with top level attribute + // names, are supported. Attribute paths cannot be accurately declared + // for TypeList (if MaxItems is greater than 1), TypeMap, or TypeSet + // attributes. To reference an attribute under a single configuration block + // (TypeList with Elem of *Resource and MaxItems of 1), the syntax is + // "parent_block_name.0.child_attribute_name". + AtLeastOneOf []string + + // RequiredWith is a set of attribute paths, including this attribute, + // that must be set simultaneously. This implements the validation logic + // declaratively within the schema and can trigger earlier in Terraform + // operations, rather than using create or update logic which only triggers + // during apply. + // + // Only absolute attribute paths, ones starting with top level attribute + // names, are supported. Attribute paths cannot be accurately declared + // for TypeList (if MaxItems is greater than 1), TypeMap, or TypeSet + // attributes. To reference an attribute under a single configuration block + // (TypeList with Elem of *Resource and MaxItems of 1), the syntax is + // "parent_block_name.0.child_attribute_name". + RequiredWith []string + + // Deprecated indicates the message to include in a warning diagnostic to + // practitioners when this attribute is configured. Typically this is used + // to signal that this attribute will be removed in the future and provide + // next steps to the practitioner, such as using a different attribute, + // different resource, or if it should just be removed. Deprecated string // ValidateFunc allows individual fields to define arbitrary validation @@ -238,9 +351,28 @@ type Schema struct { ValidateDiagFunc SchemaValidateDiagFunc // Sensitive ensures that the attribute's value does not get displayed in - // logs or regular output. It should be used for passwords or other - // secret fields. Future versions of Terraform may encrypt these - // values. + // the Terraform user interface output. It should be used for password or + // other values which should be hidden. + // + // Terraform does not support conditional sensitivity, so if the value may + // only be sensitive in certain scenarios, a pragmatic choice will be + // necessary upfront of whether or not to always hide the value. Some + // providers may opt to split up resources based on sensitivity, to ensure + // that practitioners without sensitive values do not have values + // unnecessarily hidden. + // + // Terraform does not support passing sensitivity from configurations to + // providers. For example, if a sensitive value is configured via another + // attribute, this attribute is not marked Sensitive, and the value is used + // in this attribute value, the sensitivity is not transitive. The value + // will be displayed as normal. + // + // Sensitive values propagate when referenced in other parts of a + // configuration unless the nonsensitive() configuration function is used. + // Certain configuration usage may also expand the sensitivity. For + // example, including the sensitive value in a set may mark the whole set + // as sensitive. Any outputs containing a sensitive value must enable the + // output sensitive argument. Sensitive bool } @@ -260,7 +392,7 @@ const ( // suppress it from the plan if necessary. // // Return true if the diff should be suppressed, false to retain it. -type SchemaDiffSuppressFunc func(k, old, new string, d *ResourceData) bool +type SchemaDiffSuppressFunc func(k, oldValue, newValue string, d *ResourceData) bool // SchemaDefaultFunc is a function called to return a default value for // a field. @@ -487,11 +619,11 @@ func (m schemaMap) Data( // DeepCopy returns a copy of this schemaMap. The copy can be safely modified // without affecting the original. func (m *schemaMap) DeepCopy() schemaMap { - copy, err := copystructure.Config{Lock: true}.Copy(m) + copiedMap, err := copystructure.Config{Lock: true}.Copy(m) if err != nil { panic(err) } - return *copy.(*schemaMap) + return *copiedMap.(*schemaMap) } // Diff returns the diff for a resource given the schema map, @@ -509,6 +641,9 @@ func (m schemaMap) Diff( // Make sure to mark if the resource is tainted if s != nil { result.DestroyTainted = s.Tainted + result.RawConfig = s.RawConfig + result.RawState = s.RawState + result.RawPlan = s.RawPlan } d := &ResourceData{ @@ -519,7 +654,7 @@ func (m schemaMap) Diff( } for k, schema := range m { - err := m.diff(k, schema, result, d, false) + err := m.diff(ctx, k, schema, result, d, false) if err != nil { return nil, err } @@ -537,11 +672,16 @@ func (m schemaMap) Diff( if !result.DestroyTainted && customizeDiff != nil { mc := m.DeepCopy() rd := newResourceDiff(mc, c, s, result) - if err := customizeDiff(ctx, rd, meta); err != nil { + + logging.HelperSchemaTrace(ctx, "Calling downstream") + err := customizeDiff(ctx, rd, meta) + logging.HelperSchemaTrace(ctx, "Called downstream") + + if err != nil { return nil, err } for _, k := range rd.UpdatedKeys() { - err := m.diff(k, mc[k], result, rd, false) + err := m.diff(ctx, k, mc[k], result, rd, false) if err != nil { return nil, err } @@ -568,7 +708,7 @@ func (m schemaMap) Diff( // Perform the diff again for k, schema := range m { - err := m.diff(k, schema, result2, d, false) + err := m.diff(ctx, k, schema, result2, d, false) if err != nil { return nil, err } @@ -582,7 +722,7 @@ func (m schemaMap) Diff( return nil, err } for _, k := range rd.UpdatedKeys() { - err := m.diff(k, mc[k], result2, rd, false) + err := m.diff(ctx, k, mc[k], result2, rd, false) if err != nil { return nil, err } @@ -754,6 +894,10 @@ func (m schemaMap) internalValidate(topSchemaMap schemaMap, attrsOnly bool) erro } } + if v.DiffSuppressOnRefresh && v.DiffSuppressFunc == nil { + return fmt.Errorf("%s: cannot set DiffSuppressOnRefresh without DiffSuppressFunc", k) + } + if v.Type == TypeList || v.Type == TypeSet { if v.Elem == nil { return fmt.Errorf("%s: Elem must be set for lists", k) @@ -938,10 +1082,12 @@ type resourceDiffer interface { GetChange(string) (interface{}, interface{}) GetOk(string) (interface{}, bool) HasChange(string) bool + HasChanges(...string) bool Id() string } func (m schemaMap) diff( + ctx context.Context, k string, schema *Schema, diff *terraform.InstanceDiff, @@ -956,11 +1102,11 @@ func (m schemaMap) diff( case TypeBool, TypeInt, TypeFloat, TypeString: err = m.diffString(k, schema, unsupressedDiff, d, all) case TypeList: - err = m.diffList(k, schema, unsupressedDiff, d, all) + err = m.diffList(ctx, k, schema, unsupressedDiff, d, all) case TypeMap: err = m.diffMap(k, schema, unsupressedDiff, d, all) case TypeSet: - err = m.diffSet(k, schema, unsupressedDiff, d, all) + err = m.diffSet(ctx, k, schema, unsupressedDiff, d, all) default: err = fmt.Errorf("%s: unknown type %#v", k, schema.Type) } @@ -977,6 +1123,7 @@ func (m schemaMap) diff( continue } + logging.HelperSchemaDebug(ctx, "Ignoring change due to DiffSuppressFunc", map[string]interface{}{logging.KeyAttributePath: attrK}) attrV = &terraform.ResourceAttrDiff{ Old: attrV.Old, New: attrV.Old, @@ -990,6 +1137,7 @@ func (m schemaMap) diff( } func (m schemaMap) diffList( + ctx context.Context, k string, schema *Schema, diff *terraform.InstanceDiff, @@ -1088,7 +1236,7 @@ func (m schemaMap) diffList( for i := 0; i < maxLen; i++ { for k2, schema := range t.Schema { subK := fmt.Sprintf("%s.%d.%s", k, i, k2) - err := m.diff(subK, schema, diff, d, all) + err := m.diff(ctx, subK, schema, diff, d, all) if err != nil { return err } @@ -1104,7 +1252,7 @@ func (m schemaMap) diffList( // just diff each. for i := 0; i < maxLen; i++ { subK := fmt.Sprintf("%s.%d", k, i) - err := m.diff(subK, &t2, diff, d, all) + err := m.diff(ctx, subK, &t2, diff, d, all) if err != nil { return err } @@ -1229,6 +1377,7 @@ func (m schemaMap) diffMap( } func (m schemaMap) diffSet( + ctx context.Context, k string, schema *Schema, diff *terraform.InstanceDiff, @@ -1334,7 +1483,7 @@ func (m schemaMap) diffSet( // This is a complex resource for k2, schema := range t.Schema { subK := fmt.Sprintf("%s.%s.%s", k, code, k2) - err := m.diff(subK, schema, diff, d, true) + err := m.diff(ctx, subK, schema, diff, d, true) if err != nil { return err } @@ -1348,7 +1497,7 @@ func (m schemaMap) diffSet( // This is just a primitive element, so go through each and // just diff each. subK := fmt.Sprintf("%s.%s", k, code) - err := m.diff(subK, &t2, diff, d, true) + err := m.diff(ctx, subK, &t2, diff, d, true) if err != nil { return err } @@ -1423,6 +1572,60 @@ func (m schemaMap) diffString( return nil } +// handleDiffSuppressOnRefresh visits each of the attributes set in "new" and, +// if the corresponding schema sets both DiffSuppressFunc and +// DiffSuppressOnRefresh, checks whether the new value is materially different +// than the old and if not it overwrites the new value with the old one, +// in-place. +func (m schemaMap) handleDiffSuppressOnRefresh(ctx context.Context, oldState, newState *terraform.InstanceState) { + if newState == nil || oldState == nil { + return // nothing to do, then + } + + // We'll populate this in the loop below only if we find at least one + // attribute which needs this analysis. + var d *ResourceData + + oldAttrs := oldState.Attributes + newAttrs := newState.Attributes + for k, newV := range newAttrs { + oldV, ok := oldAttrs[k] + if !ok { + continue // no old value to compare with + } + if newV == oldV { + continue // no change to test + } + + schemaList := addrToSchema(strings.Split(k, "."), m) + if len(schemaList) == 0 { + continue // no schema? weird, but not our responsibility to handle + } + schema := schemaList[len(schemaList)-1] + if !schema.DiffSuppressOnRefresh || schema.DiffSuppressFunc == nil { + continue // not relevant + } + + if d == nil { + // We populate "d" only on demand, to avoid the cost for most + // existing schemas where DiffSuppressOnRefresh won't be set. + var err error + d, err = m.Data(newState, nil) + if err != nil { + // Should not happen if we got far enough to be doing this + // analysis, but if it does then we'll bail out. + tfsdklog.Warn(ctx, fmt.Sprintf("schemaMap.handleDiffSuppressOnRefresh failed to construct ResourceData: %s", err)) + return + } + } + + if schema.DiffSuppressFunc(k, oldV, newV, d) { + tfsdklog.Debug(ctx, fmt.Sprintf("ignoring change of %q due to DiffSuppressFunc", k)) + newState.Attributes[k] = oldV // keep the old value, then + } + } +} + func (m schemaMap) validate( k string, schema *Schema, @@ -1439,7 +1642,7 @@ func (m schemaMap) validate( if err != nil { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "Loading Default", + Summary: "Failed to determine default value", Detail: err.Error(), AttributePath: path, }) @@ -1453,7 +1656,7 @@ func (m schemaMap) validate( if err != nil { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "ExactlyOne", + Summary: "Invalid combination of arguments", Detail: err.Error(), AttributePath: path, }) @@ -1463,7 +1666,7 @@ func (m schemaMap) validate( if err != nil { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "AtLeastOne", + Summary: "Missing required argument", Detail: err.Error(), AttributePath: path, }) @@ -1485,8 +1688,8 @@ func (m schemaMap) validate( // This is a computed-only field return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "Computed attributes cannot be set", - Detail: fmt.Sprintf("Computed attributes cannot be set, but a value was set for %q.", k), + Summary: "Value for unconfigurable attribute", + Detail: fmt.Sprintf("Can't configure a value for %q: its value will be decided automatically based on the result of applying this configuration.", k), AttributePath: path, }) } @@ -1495,7 +1698,7 @@ func (m schemaMap) validate( if err != nil { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "RequiredWith", + Summary: "Missing required argument", Detail: err.Error(), AttributePath: path, }) @@ -1510,7 +1713,7 @@ func (m schemaMap) validate( if schema.Deprecated != "" { return append(diags, diag.Diagnostic{ Severity: diag.Warning, - Summary: "Attribute is deprecated", + Summary: "Argument is deprecated", Detail: schema.Deprecated, AttributePath: path, }) @@ -1522,7 +1725,7 @@ func (m schemaMap) validate( if err != nil { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "ConflictsWith", + Summary: "Conflicting configuration arguments", Detail: err.Error(), AttributePath: path, }) @@ -1699,7 +1902,7 @@ func (m schemaMap) validateList( if rawV.Kind() != reflect.Slice { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "Attribute should be a list", + Summary: "Attribute must be a list", AttributePath: path, }) } @@ -1717,8 +1920,8 @@ func (m schemaMap) validateList( if schema.MaxItems > 0 && rawV.Len() > schema.MaxItems { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "List longer than MaxItems", - Detail: fmt.Sprintf("Attribute supports %d item maximum, config has %d declared", schema.MaxItems, rawV.Len()), + Summary: "Too many list items", + Detail: fmt.Sprintf("Attribute supports %d item maximum, but config has %d declared.", schema.MaxItems, rawV.Len()), AttributePath: path, }) } @@ -1726,8 +1929,8 @@ func (m schemaMap) validateList( if schema.MinItems > 0 && rawV.Len() < schema.MinItems { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "List shorter than MinItems", - Detail: fmt.Sprintf("Attribute supports %d item minimum, config has %d declared", schema.MinItems, rawV.Len()), + Summary: "Not enough list items", + Detail: fmt.Sprintf("Attribute requires %d item minimum, but config has only %d declared.", schema.MinItems, rawV.Len()), AttributePath: path, }) } @@ -1794,7 +1997,7 @@ func (m schemaMap) validateMap( if reifiedOk && raw == reified && !c.IsComputed(k) { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "Attribute should be a map", + Summary: "Attribute must be a map", AttributePath: path, }) } @@ -1805,7 +2008,7 @@ func (m schemaMap) validateMap( default: return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "Attribute should be a map", + Summary: "Attribute must be a map", AttributePath: path, }) } @@ -1832,7 +2035,7 @@ func (m schemaMap) validateMap( if v.Kind() != reflect.Map { return append(diags, diag.Diagnostic{ Severity: diag.Error, - Summary: "Attribute should be a map", + Summary: "Attribute must be a map", AttributePath: path, }) } @@ -2045,8 +2248,19 @@ func (m schemaMap) validatePrimitive( // decode a float as an integer. // the config shims only use int for integral number values + // also accept a string, just as the TypeBool and TypeFloat cases do if v, ok := raw.(int); ok { decoded = v + } else if _, ok := raw.(string); ok { + var n int + if err := mapstructure.WeakDecode(raw, &n); err != nil { + return append(diags, diag.Diagnostic{ + Severity: diag.Error, + Summary: err.Error(), + AttributePath: path, + }) + } + decoded = n } else { return append(diags, diag.Diagnostic{ Severity: diag.Error, @@ -2055,7 +2269,7 @@ func (m schemaMap) validatePrimitive( }) } case TypeFloat: - // Verify that we can parse this as an int + // Verify that we can parse this as a float var n float64 if err := mapstructure.WeakDecode(raw, &n); err != nil { return append(diags, diag.Diagnostic{ @@ -2098,9 +2312,11 @@ func (m schemaMap) validateType( // indexing into sets is not representable in the current protocol // best we can do is associate the path up to this attribute. diags = m.validateList(k, raw, schema, c, path) - log.Printf("[WARN] Truncating attribute path of %d diagnostics for TypeSet", len(diags)) - for i := range diags { - diags[i].AttributePath = path + if len(diags) > 0 { + log.Printf("[WARN] Truncating attribute path of %d diagnostics for TypeSet", len(diags)) + for i := range diags { + diags[i].AttributePath = path + } } case TypeMap: diags = m.validateMap(k, raw, schema, c, path) @@ -2111,7 +2327,7 @@ func (m schemaMap) validateType( if schema.Deprecated != "" { diags = append(diags, diag.Diagnostic{ Severity: diag.Warning, - Summary: "Deprecated Attribute", + Summary: "Argument is deprecated", Detail: schema.Deprecated, AttributePath: path, }) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go index a510e60ff..b937ab6e5 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/set.go @@ -8,6 +8,7 @@ import ( "strconv" "sync" + "github.com/google/go-cmp/cmp" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/helper/hashcode" ) @@ -150,46 +151,12 @@ func (s *Set) Union(other *Set) *Set { return result } -func checkSetMapEqual(m1, m2 map[string]interface{}) bool { - if (m1 == nil) != (m2 == nil) { - return false - } - if len(m1) != len(m2) { - return false - } - for k := range m1 { - v1 := m1[k] - v2, ok := m2[k] - if !ok { - return false - } - switch v1.(type) { - case map[string]interface{}: - same := checkSetMapEqual(v1.(map[string]interface{}), v2.(map[string]interface{})) - if !same { - return false - } - case *Set: - same := v1.(*Set).Equal(v2) - if !same { - return false - } - default: - same := reflect.DeepEqual(v1, v2) - if !same { - return false - } - } - } - return true -} - func (s *Set) Equal(raw interface{}) bool { other, ok := raw.(*Set) if !ok { return false } - return checkSetMapEqual(s.m, other.m) + return cmp.Equal(s.m, other.m) } // HashEqual simply checks to the keys the top-level map to the keys in the @@ -271,6 +238,6 @@ func (s *Set) listCode() []string { for k := range s.m { keys = append(keys, k) } - sort.Sort(sort.StringSlice(keys)) + sort.Strings(keys) return keys } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go index e1575a0f8..9c7f0906c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/shims.go @@ -16,20 +16,24 @@ import ( // derives a terraform.InstanceDiff to give to the legacy providers. This is // used to take the states provided by the new ApplyResourceChange method and // convert them to a state+diff required for the legacy Apply method. -func DiffFromValues(ctx context.Context, prior, planned cty.Value, res *Resource) (*terraform.InstanceDiff, error) { - return diffFromValues(ctx, prior, planned, res, nil) +func DiffFromValues(ctx context.Context, prior, planned, config cty.Value, res *Resource) (*terraform.InstanceDiff, error) { + return diffFromValues(ctx, prior, planned, config, res, nil) } // diffFromValues takes an additional CustomizeDiffFunc, so we can generate our // test fixtures from the legacy tests. In the new provider protocol the diff // only needs to be created for the apply operation, and any customizations // have already been done. -func diffFromValues(ctx context.Context, prior, planned cty.Value, res *Resource, cust CustomizeDiffFunc) (*terraform.InstanceDiff, error) { +func diffFromValues(ctx context.Context, prior, planned, config cty.Value, res *Resource, cust CustomizeDiffFunc) (*terraform.InstanceDiff, error) { instanceState, err := res.ShimInstanceStateFromValue(prior) if err != nil { return nil, err } + instanceState.RawConfig = config + instanceState.RawPlan = planned + instanceState.RawState = prior + configSchema := res.CoreConfigSchema() cfg := terraform.NewResourceConfigShimmed(planned, configSchema) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure/suppress_json_diff.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure/suppress_json_diff.go index 741ca0ac2..c99b73846 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure/suppress_json_diff.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure/suppress_json_diff.go @@ -6,13 +6,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func SuppressJsonDiff(k, old, new string, d *schema.ResourceData) bool { - oldMap, err := ExpandJsonFromString(old) +func SuppressJsonDiff(k, oldValue, newValue string, d *schema.ResourceData) bool { + oldMap, err := ExpandJsonFromString(oldValue) if err != nil { return false } - newMap, err := ExpandJsonFromString(new) + newMap, err := ExpandJsonFromString(newValue) if err != nil { return false } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/map.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/map.go index 3e8068a8c..9e4510b1e 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/map.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/map.go @@ -17,12 +17,12 @@ func MapKeyLenBetween(min, max int) schema.SchemaValidateDiagFunc { var diags diag.Diagnostics for _, key := range sortedKeys(v.(map[string]interface{})) { - len := len(key) - if len < min || len > max { + keyLen := len(key) + if keyLen < min || keyLen > max { diags = append(diags, diag.Diagnostic{ Severity: diag.Error, Summary: "Bad map key length", - Detail: fmt.Sprintf("Map key lengths should be in the range (%d - %d): %s (length = %d)", min, max, key, len), + Detail: fmt.Sprintf("Map key lengths should be in the range (%d - %d): %s (length = %d)", min, max, key, keyLen), AttributePath: append(path, cty.IndexStep{Key: cty.StringVal(key)}), }) } @@ -53,12 +53,12 @@ func MapValueLenBetween(min, max int) schema.SchemaValidateDiagFunc { continue } - len := len(val.(string)) - if len < min || len > max { + valLen := len(val.(string)) + if valLen < min || valLen > max { diags = append(diags, diag.Diagnostic{ Severity: diag.Error, Summary: "Bad map value length", - Detail: fmt.Sprintf("Map value lengths should be in the range (%d - %d): %s => %v (length = %d)", min, max, key, val, len), + Detail: fmt.Sprintf("Map value lengths should be in the range (%d - %d): %s => %v (length = %d)", min, max, key, val, valLen), AttributePath: append(path, cty.IndexStep{Key: cty.StringVal(key)}), }) } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/meta.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/meta.go index f1376c2d3..b0515c8d0 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/meta.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/meta.go @@ -66,8 +66,21 @@ func ToDiagFunc(validator schema.SchemaValidateFunc) schema.SchemaValidateDiagFu return func(i interface{}, p cty.Path) diag.Diagnostics { var diags diag.Diagnostics - attr := p[len(p)-1].(cty.GetAttrStep) - ws, es := validator(i, attr.Name) + // A practitioner-friendly key for any SchemaValidateFunc output. + // Generally this should be the last attribute name on the path. + // If not found for some unexpected reason, an empty string is fine + // as the diagnostic will have the full attribute path anyways. + var key string + + // Reverse search for last cty.GetAttrStep + for i := len(p) - 1; i >= 0; i-- { + if pathStep, ok := p[i].(cty.GetAttrStep); ok { + key = pathStep.Name + break + } + } + + ws, es := validator(i, key) for _, w := range ws { diags = append(diags, diag.Diagnostic{ diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/strings.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/strings.go index c0c17d011..e739a1a1b 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/strings.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/strings.go @@ -138,7 +138,7 @@ func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc { } for _, str := range valid { - if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) { + if v == str || (ignoreCase && strings.EqualFold(v, str)) { return warnings, errors } } @@ -160,7 +160,7 @@ func StringNotInSlice(invalid []string, ignoreCase bool) schema.SchemaValidateFu } for _, str := range invalid { - if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) { + if v == str || (ignoreCase && strings.EqualFold(v, str)) { errors = append(errors, fmt.Errorf("expected %s to not be any of %v, got %s", k, invalid, v)) return warnings, errors } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/testing.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/testing.go index 596c5754a..d861f5a2a 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/testing.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/testing.go @@ -5,7 +5,6 @@ import ( testing "github.com/mitchellh/go-testing-interface" - "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -16,12 +15,6 @@ type testCase struct { expectedErr *regexp.Regexp } -type diagTestCase struct { - val interface{} - f schema.SchemaValidateDiagFunc - expectedErr *regexp.Regexp -} - func runTestCases(t testing.T, cases []testCase) { t.Helper() @@ -52,29 +45,6 @@ func matchAnyError(errs []error, r *regexp.Regexp) bool { return false } -func runDiagTestCases(t testing.T, cases []diagTestCase) { - t.Helper() - - for i, tc := range cases { - p := cty.Path{ - cty.GetAttrStep{Name: "test_property"}, - } - diags := tc.f(tc.val, p) - - if !diags.HasError() && tc.expectedErr == nil { - continue - } - - if diags.HasError() && tc.expectedErr == nil { - t.Fatalf("expected test case %d to produce no errors, got %v", i, diags) - } - - if !matchAnyDiagSummary(diags, tc.expectedErr) { - t.Fatalf("expected test case %d to produce error matching \"%s\", got %v", i, tc.expectedErr, diags) - } - } -} - func matchAnyDiagSummary(ds diag.Diagnostics, r *regexp.Regexp) bool { for _, d := range ds { if r.MatchString(d.Summary) { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/time.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/time.go index df3e2620c..fde3a0199 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/time.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation/time.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -// IsDayOfTheWeek id a SchemaValidateFunc which tests if the provided value is of type string and a valid english day of the week +// IsDayOfTheWeek is a SchemaValidateFunc which tests if the provided value is of type string and a valid english day of the week func IsDayOfTheWeek(ignoreCase bool) schema.SchemaValidateFunc { return StringInSlice([]string{ "Monday", @@ -20,7 +20,7 @@ func IsDayOfTheWeek(ignoreCase bool) schema.SchemaValidateFunc { }, ignoreCase) } -// IsMonth id a SchemaValidateFunc which tests if the provided value is of type string and a valid english month +// IsMonth is a SchemaValidateFunc which tests if the provided value is of type string and a valid english month func IsMonth(ignoreCase bool) schema.SchemaValidateFunc { return StringInSlice([]string{ "January", diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/addrs/module_instance.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/addrs/module_instance.go index f31d833d2..113d3d675 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/addrs/module_instance.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/addrs/module_instance.go @@ -92,7 +92,6 @@ func parseModuleInstancePrefix(traversal hcl.Traversal) (ModuleInstance, hcl.Tra "Invalid address operator", "Module address prefix must be followed by dot and then a name.", )) - break } if next != "module" { @@ -122,7 +121,6 @@ func parseModuleInstancePrefix(traversal hcl.Traversal) (ModuleInstance, hcl.Tra "Invalid address operator", "Prefix \"module.\" must be followed by a module name.", )) - break } remain = remain[1:] step := ModuleInstanceStep{ diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/flatmap.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/flatmap.go index e620e76a9..b96e17c58 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/flatmap.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/flatmap.go @@ -85,15 +85,15 @@ func flatmapValueFromHCL2Map(m map[string]string, prefix string, val cty.Value) return } - len := 0 + valLen := 0 for it := val.ElementIterator(); it.Next(); { ak, av := it.Element() name := ak.AsString() flatmapValueFromHCL2Value(m, prefix+name, av) - len++ + valLen++ } if !val.Type().IsObjectType() { // objects don't have an explicit count included, since their attribute count is fixed - m[prefix+"%"] = strconv.Itoa(len) + m[prefix+"%"] = strconv.Itoa(valLen) } } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/single_attr_body.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/single_attr_body.go deleted file mode 100644 index 68f48da8f..000000000 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim/single_attr_body.go +++ /dev/null @@ -1,85 +0,0 @@ -package hcl2shim - -import ( - "fmt" - - hcl2 "github.com/hashicorp/hcl/v2" -) - -// SingleAttrBody is a weird implementation of hcl2.Body that acts as if -// it has a single attribute whose value is the given expression. -// -// This is used to shim Resource.RawCount and Output.RawConfig to behave -// more like they do in the old HCL loader. -type SingleAttrBody struct { - Name string - Expr hcl2.Expression -} - -var _ hcl2.Body = SingleAttrBody{} - -func (b SingleAttrBody) Content(schema *hcl2.BodySchema) (*hcl2.BodyContent, hcl2.Diagnostics) { - content, all, diags := b.content(schema) - if !all { - // This should never happen because this body implementation should only - // be used by code that is aware that it's using a single-attr body. - diags = append(diags, &hcl2.Diagnostic{ - Severity: hcl2.DiagError, - Summary: "Invalid attribute", - Detail: fmt.Sprintf("The correct attribute name is %q.", b.Name), - Subject: b.Expr.Range().Ptr(), - }) - } - return content, diags -} - -func (b SingleAttrBody) PartialContent(schema *hcl2.BodySchema) (*hcl2.BodyContent, hcl2.Body, hcl2.Diagnostics) { - content, all, diags := b.content(schema) - var remain hcl2.Body - if all { - // If the request matched the one attribute we represent, then the - // remaining body is empty. - remain = hcl2.EmptyBody() - } else { - remain = b - } - return content, remain, diags -} - -func (b SingleAttrBody) content(schema *hcl2.BodySchema) (*hcl2.BodyContent, bool, hcl2.Diagnostics) { - ret := &hcl2.BodyContent{} - all := false - var diags hcl2.Diagnostics - - for _, attrS := range schema.Attributes { - if attrS.Name == b.Name { - attrs, _ := b.JustAttributes() - ret.Attributes = attrs - all = true - } else if attrS.Required { - diags = append(diags, &hcl2.Diagnostic{ - Severity: hcl2.DiagError, - Summary: "Missing attribute", - Detail: fmt.Sprintf("The attribute %q is required.", attrS.Name), - Subject: b.Expr.Range().Ptr(), - }) - } - } - - return ret, all, diags -} - -func (b SingleAttrBody) JustAttributes() (hcl2.Attributes, hcl2.Diagnostics) { - return hcl2.Attributes{ - b.Name: { - Expr: b.Expr, - Name: b.Name, - NameRange: b.Expr.Range(), - Range: b.Expr.Range(), - }, - }, nil -} - -func (b SingleAttrBody) MissingItemRange() hcl2.Range { - return b.Expr.Range() -} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/context.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/context.go new file mode 100644 index 000000000..5bce8140f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/context.go @@ -0,0 +1,75 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tfsdklog" + helperlogging "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" + testing "github.com/mitchellh/go-testing-interface" +) + +// InitContext creates SDK logger contexts when the provider is running in +// "production" (not under acceptance testing). The incoming context will +// already have the root SDK logger and root provider logger setup from +// terraform-plugin-go tf5server RPC handlers. +func InitContext(ctx context.Context) context.Context { + ctx = tfsdklog.NewSubsystem(ctx, SubsystemHelperSchema, + // All calls are through the HelperSchema* helper functions + tfsdklog.WithAdditionalLocationOffset(1), + tfsdklog.WithLevelFromEnv(EnvTfLogSdkHelperSchema), + // Propagate tf_req_id, tf_rpc, etc. fields + tfsdklog.WithRootFields(), + ) + + return ctx +} + +// InitTestContext registers the terraform-plugin-log/tfsdklog test sink, +// configures the standard library log package, and creates SDK logger +// contexts. The incoming context is expected to be devoid of logging setup. +// +// The standard library log package handling is important as provider code +// under test may be using that package or another logging library outside of +// terraform-plugin-log. +func InitTestContext(ctx context.Context, t testing.T) context.Context { + helperlogging.SetOutput(t) + + ctx = tfsdklog.RegisterTestSink(ctx, t) + ctx = tfsdklog.NewRootSDKLogger(ctx, tfsdklog.WithLevelFromEnv(EnvTfLogSdk)) + ctx = tfsdklog.NewSubsystem(ctx, SubsystemHelperResource, + // All calls are through the HelperResource* helper functions + tfsdklog.WithAdditionalLocationOffset(1), + tfsdklog.WithLevelFromEnv(EnvTfLogSdkHelperResource), + ) + ctx = TestNameContext(ctx, t.Name()) + + return ctx +} + +// TestNameContext adds the current test name to loggers. +func TestNameContext(ctx context.Context, testName string) context.Context { + ctx = tfsdklog.SubsystemWith(ctx, SubsystemHelperResource, KeyTestName, testName) + + return ctx +} + +// TestStepNumberContext adds the current test step number to loggers. +func TestStepNumberContext(ctx context.Context, stepNumber int) context.Context { + ctx = tfsdklog.SubsystemWith(ctx, SubsystemHelperResource, KeyTestStepNumber, stepNumber) + + return ctx +} + +// TestTerraformPathContext adds the current test Terraform CLI path to loggers. +func TestTerraformPathContext(ctx context.Context, terraformPath string) context.Context { + ctx = tfsdklog.SubsystemWith(ctx, SubsystemHelperResource, KeyTestTerraformPath, terraformPath) + + return ctx +} + +// TestWorkingDirectoryContext adds the current test working directory to loggers. +func TestWorkingDirectoryContext(ctx context.Context, workingDirectory string) context.Context { + ctx = tfsdklog.SubsystemWith(ctx, SubsystemHelperResource, KeyTestWorkingDirectory, workingDirectory) + + return ctx +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/environment_variables.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/environment_variables.go new file mode 100644 index 000000000..db1a27a81 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/environment_variables.go @@ -0,0 +1,24 @@ +package logging + +// Environment variables. +const ( + // EnvTfLogSdk is an environment variable that sets the logging level of + // the root SDK logger, while the provider is under test. In "production" + // usage, this environment variable is handled by terraform-plugin-go. + // + // Terraform CLI's logging must be explicitly turned on before this + // environment varable can be used to reduce the SDK logging levels. It + // cannot be used to show only SDK logging unless all other logging levels + // are turned off. + EnvTfLogSdk = "TF_LOG_SDK" + + // EnvTfLogSdkHelperResource is an environment variable that sets the logging + // level of SDK helper/resource loggers. Infers root SDK logging level, if + // unset. + EnvTfLogSdkHelperResource = "TF_LOG_SDK_HELPER_RESOURCE" + + // EnvTfLogSdkHelperSchema is an environment variable that sets the logging + // level of SDK helper/schema loggers. Infers root SDK logging level, if + // unset. + EnvTfLogSdkHelperSchema = "TF_LOG_SDK_HELPER_SCHEMA" +) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_resource.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_resource.go new file mode 100644 index 000000000..a889601c7 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_resource.go @@ -0,0 +1,32 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tfsdklog" +) + +const ( + // SubsystemHelperResource is the tfsdklog subsystem name for helper/resource. + SubsystemHelperResource = "helper_resource" +) + +// HelperResourceTrace emits a helper/resource subsystem log at TRACE level. +func HelperResourceTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemTrace(ctx, SubsystemHelperResource, msg, additionalFields...) +} + +// HelperResourceDebug emits a helper/resource subsystem log at DEBUG level. +func HelperResourceDebug(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemDebug(ctx, SubsystemHelperResource, msg, additionalFields...) +} + +// HelperResourceWarn emits a helper/resource subsystem log at WARN level. +func HelperResourceWarn(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemWarn(ctx, SubsystemHelperResource, msg, additionalFields...) +} + +// HelperResourceError emits a helper/resource subsystem log at ERROR level. +func HelperResourceError(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemError(ctx, SubsystemHelperResource, msg, additionalFields...) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_schema.go new file mode 100644 index 000000000..b2fe71d15 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/helper_schema.go @@ -0,0 +1,32 @@ +package logging + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tfsdklog" +) + +const ( + // SubsystemHelperSchema is the tfsdklog subsystem name for helper/schema. + SubsystemHelperSchema = "helper_schema" +) + +// HelperSchemaDebug emits a helper/schema subsystem log at DEBUG level. +func HelperSchemaDebug(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemDebug(ctx, SubsystemHelperSchema, msg, additionalFields...) +} + +// HelperSchemaError emits a helper/schema subsystem log at ERROR level. +func HelperSchemaError(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemError(ctx, SubsystemHelperSchema, msg, additionalFields...) +} + +// HelperSchemaTrace emits a helper/schema subsystem log at TRACE level. +func HelperSchemaTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemTrace(ctx, SubsystemHelperSchema, msg, additionalFields...) +} + +// HelperSchemaWarn emits a helper/schema subsystem log at WARN level. +func HelperSchemaWarn(ctx context.Context, msg string, additionalFields ...map[string]interface{}) { + tfsdklog.SubsystemWarn(ctx, SubsystemHelperSchema, msg, additionalFields...) +} diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/keys.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/keys.go new file mode 100644 index 000000000..2ba548f61 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging/keys.go @@ -0,0 +1,45 @@ +package logging + +// Structured logging keys. +// +// Practitioners or tooling reading logs may be depending on these keys, so be +// conscious of that when changing them. +// +// Refer to the terraform-plugin-go logging keys as well, which should be +// equivalent to these when possible. +const ( + // Attribute path representation, which is typically in flatmap form such + // as parent.0.child in this project. + KeyAttributePath = "tf_attribute_path" + + // The type of data source being operated on, such as "archive_file" + KeyDataSourceType = "tf_data_source_type" + + // Underlying Go error string when logging an error. + KeyError = "error" + + // The full address of the provider, such as + // registry.terraform.io/hashicorp/random + KeyProviderAddress = "tf_provider_addr" + + // The type of resource being operated on, such as "random_pet" + KeyResourceType = "tf_resource_type" + + // The name of the test being executed. + KeyTestName = "test_name" + + // The TestStep number of the test being executed. Starts at 1. + KeyTestStepNumber = "test_step_number" + + // The path to the Terraform CLI logging file used for an acceptance test. + // + // This should match where the rest of the acceptance test logs are going + // already, but is provided for troubleshooting in case it does not. + KeyTestTerraformLogPath = "test_terraform_log_path" + + // The path to the Terraform CLI used for an acceptance test. + KeyTestTerraformPath = "test_terraform_path" + + // The working directory of the acceptance test. + KeyTestWorkingDirectory = "test_working_directory" +) diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go index ac66eb71e..e02c1e443 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go @@ -1,34 +1,61 @@ package convert import ( - "fmt" + "context" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging" ) // AppendProtoDiag appends a new diagnostic from a warning string or an error. // This panics if d is not a string or error. -func AppendProtoDiag(diags []*tfprotov5.Diagnostic, d interface{}) []*tfprotov5.Diagnostic { +func AppendProtoDiag(ctx context.Context, diags []*tfprotov5.Diagnostic, d interface{}) []*tfprotov5.Diagnostic { switch d := d.(type) { case cty.PathError: ap := PathToAttributePath(d.Path) - diags = append(diags, &tfprotov5.Diagnostic{ + diagnostic := &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, Summary: d.Error(), Attribute: ap, - }) + } + + if diagnostic.Summary == "" { + logging.HelperSchemaWarn(ctx, "detected empty error string for diagnostic in AppendProtoDiag for cty.PathError type") + diagnostic.Summary = "Empty Error String" + diagnostic.Detail = "This is always a bug in the provider and should be reported to the provider developers." + } + + diags = append(diags, diagnostic) case diag.Diagnostics: diags = append(diags, DiagsToProto(d)...) case error: - diags = append(diags, &tfprotov5.Diagnostic{ + if d == nil { + logging.HelperSchemaDebug(ctx, "skipping diagnostic for nil error in AppendProtoDiag") + return diags + } + + diagnostic := &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityError, Summary: d.Error(), - }) + } + + if diagnostic.Summary == "" { + logging.HelperSchemaWarn(ctx, "detected empty error string for diagnostic in AppendProtoDiag for error type") + diagnostic.Summary = "Error Missing Message" + diagnostic.Detail = "This is always a bug in the provider and should be reported to the provider developers." + } + + diags = append(diags, diagnostic) case string: + if d == "" { + logging.HelperSchemaDebug(ctx, "skipping diagnostic for empty string in AppendProtoDiag") + return diags + } + diags = append(diags, &tfprotov5.Diagnostic{ Severity: tfprotov5.DiagnosticSeverityWarning, Summary: d, @@ -68,19 +95,18 @@ func ProtoToDiags(ds []*tfprotov5.Diagnostic) diag.Diagnostics { func DiagsToProto(diags diag.Diagnostics) []*tfprotov5.Diagnostic { var ds []*tfprotov5.Diagnostic for _, d := range diags { - if err := d.Validate(); err != nil { - panic(fmt.Errorf("Invalid diagnostic: %s. This is always a bug in the provider implementation", err)) - } protoDiag := &tfprotov5.Diagnostic{ + Severity: tfprotov5.DiagnosticSeverityError, Summary: d.Summary, Detail: d.Detail, Attribute: PathToAttributePath(d.AttributePath), } - if d.Severity == diag.Error { - protoDiag.Severity = tfprotov5.DiagnosticSeverityError - } else if d.Severity == diag.Warning { + if d.Severity == diag.Warning { protoDiag.Severity = tfprotov5.DiagnosticSeverityWarning } + if d.Summary == "" { + protoDiag.Summary = "Empty Summary: This is always a bug in the provider and should be reported to the provider developers." + } ds = append(ds, protoDiag) } return ds @@ -92,14 +118,14 @@ func AttributePathToPath(ap *tftypes.AttributePath) cty.Path { if ap == nil { return p } - for _, step := range ap.Steps { - switch step.(type) { + for _, step := range ap.Steps() { + switch step := step.(type) { case tftypes.AttributeName: - p = p.GetAttr(string(step.(tftypes.AttributeName))) + p = p.GetAttr(string(step)) case tftypes.ElementKeyString: - p = p.Index(cty.StringVal(string(step.(tftypes.ElementKeyString)))) + p = p.Index(cty.StringVal(string(step))) case tftypes.ElementKeyInt: - p = p.Index(cty.NumberIntVal(int64(step.(tftypes.ElementKeyInt)))) + p = p.Index(cty.NumberIntVal(int64(step))) } } return p @@ -107,20 +133,23 @@ func AttributePathToPath(ap *tftypes.AttributePath) cty.Path { // PathToAttributePath takes a cty.Path and converts it to a proto-encoded path. func PathToAttributePath(p cty.Path) *tftypes.AttributePath { - ap := &tftypes.AttributePath{} + if p == nil || len(p) < 1 { + return nil + } + ap := tftypes.NewAttributePath() for _, step := range p { switch selector := step.(type) { case cty.GetAttrStep: - ap.Steps = append(ap.Steps, tftypes.AttributeName(selector.Name)) + ap = ap.WithAttributeName(selector.Name) case cty.IndexStep: key := selector.Key switch key.Type() { case cty.String: - ap.Steps = append(ap.Steps, tftypes.ElementKeyString(key.AsString())) + ap = ap.WithElementKeyString(key.AsString()) case cty.Number: v, _ := key.AsBigFloat().Int64() - ap.Steps = append(ap.Steps, tftypes.ElementKeyInt(v)) + ap = ap.WithElementKeyInt(int(v)) default: // We'll bail early if we encounter anything else, and just // return the valid prefix. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go index cdcdcfa12..07d0b8978 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/schema.go @@ -1,15 +1,16 @@ package convert import ( + "context" "fmt" - "log" "reflect" "sort" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes" + "github.com/hashicorp/terraform-plugin-go/tftypes" "github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/configschema" + "github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging" ) func tftypeFromCtyType(in cty.Type) (tftypes.Type, error) { @@ -56,7 +57,7 @@ func tftypeFromCtyType(in cty.Type) (tftypes.Type, error) { return nil, err } return tftypes.Map{ - AttributeType: elemType, + ElementType: elemType, }, nil case in.IsObjectType(): attrTypes := make(map[string]tftypes.Type) @@ -97,7 +98,7 @@ func ctyTypeFromTFType(in tftypes.Type) (cty.Type, error) { } return cty.Set(elemType), nil case in.Is(tftypes.Map{}): - elemType, err := ctyTypeFromTFType(in.(tftypes.Map).AttributeType) + elemType, err := ctyTypeFromTFType(in.(tftypes.Map).ElementType) if err != nil { return cty.Type{}, err } @@ -128,10 +129,10 @@ func ctyTypeFromTFType(in tftypes.Type) (cty.Type, error) { // ConfigSchemaToProto takes a *configschema.Block and converts it to a // tfprotov5.SchemaBlock for a grpc response. -func ConfigSchemaToProto(b *configschema.Block) *tfprotov5.SchemaBlock { +func ConfigSchemaToProto(ctx context.Context, b *configschema.Block) *tfprotov5.SchemaBlock { block := &tfprotov5.SchemaBlock{ Description: b.Description, - DescriptionKind: protoStringKind(b.DescriptionKind), + DescriptionKind: protoStringKind(ctx, b.DescriptionKind), Deprecated: b.Deprecated, } @@ -141,7 +142,7 @@ func ConfigSchemaToProto(b *configschema.Block) *tfprotov5.SchemaBlock { attr := &tfprotov5.SchemaAttribute{ Name: name, Description: a.Description, - DescriptionKind: protoStringKind(a.DescriptionKind), + DescriptionKind: protoStringKind(ctx, a.DescriptionKind), Optional: a.Optional, Computed: a.Computed, Required: a.Required, @@ -160,16 +161,16 @@ func ConfigSchemaToProto(b *configschema.Block) *tfprotov5.SchemaBlock { for _, name := range sortedKeys(b.BlockTypes) { b := b.BlockTypes[name] - block.BlockTypes = append(block.BlockTypes, protoSchemaNestedBlock(name, b)) + block.BlockTypes = append(block.BlockTypes, protoSchemaNestedBlock(ctx, name, b)) } return block } -func protoStringKind(k configschema.StringKind) tfprotov5.StringKind { +func protoStringKind(ctx context.Context, k configschema.StringKind) tfprotov5.StringKind { switch k { default: - log.Printf("[TRACE] unexpected configschema.StringKind: %d", k) + logging.HelperSchemaTrace(ctx, fmt.Sprintf("Unexpected configschema.StringKind: %d", k)) return tfprotov5.StringKindPlain case configschema.StringPlain: return tfprotov5.StringKindPlain @@ -178,7 +179,7 @@ func protoStringKind(k configschema.StringKind) tfprotov5.StringKind { } } -func protoSchemaNestedBlock(name string, b *configschema.NestedBlock) *tfprotov5.SchemaNestedBlock { +func protoSchemaNestedBlock(ctx context.Context, name string, b *configschema.NestedBlock) *tfprotov5.SchemaNestedBlock { var nesting tfprotov5.SchemaNestedBlockNestingMode switch b.Nesting { case configschema.NestingSingle: @@ -196,7 +197,7 @@ func protoSchemaNestedBlock(name string, b *configschema.NestedBlock) *tfprotov5 } return &tfprotov5.SchemaNestedBlock{ TypeName: name, - Block: ConfigSchemaToProto(&b.Block), + Block: ConfigSchemaToProto(ctx, &b.Block), Nesting: nesting, MinItems: int64(b.MinItems), MaxItems: int64(b.MaxItems), @@ -205,20 +206,20 @@ func protoSchemaNestedBlock(name string, b *configschema.NestedBlock) *tfprotov5 // ProtoToConfigSchema takes the GetSchema_Block from a grpc response and converts it // to a terraform *configschema.Block. -func ProtoToConfigSchema(b *tfprotov5.SchemaBlock) *configschema.Block { +func ProtoToConfigSchema(ctx context.Context, b *tfprotov5.SchemaBlock) *configschema.Block { block := &configschema.Block{ Attributes: make(map[string]*configschema.Attribute), BlockTypes: make(map[string]*configschema.NestedBlock), Description: b.Description, - DescriptionKind: schemaStringKind(b.DescriptionKind), + DescriptionKind: schemaStringKind(ctx, b.DescriptionKind), Deprecated: b.Deprecated, } for _, a := range b.Attributes { attr := &configschema.Attribute{ Description: a.Description, - DescriptionKind: schemaStringKind(a.DescriptionKind), + DescriptionKind: schemaStringKind(ctx, a.DescriptionKind), Required: a.Required, Optional: a.Optional, Computed: a.Computed, @@ -236,16 +237,16 @@ func ProtoToConfigSchema(b *tfprotov5.SchemaBlock) *configschema.Block { } for _, b := range b.BlockTypes { - block.BlockTypes[b.TypeName] = schemaNestedBlock(b) + block.BlockTypes[b.TypeName] = schemaNestedBlock(ctx, b) } return block } -func schemaStringKind(k tfprotov5.StringKind) configschema.StringKind { +func schemaStringKind(ctx context.Context, k tfprotov5.StringKind) configschema.StringKind { switch k { default: - log.Printf("[TRACE] unexpected tfprotov5.StringKind: %d", k) + logging.HelperSchemaTrace(ctx, fmt.Sprintf("Unexpected tfprotov5.StringKind: %d", k)) return configschema.StringPlain case tfprotov5.StringKindPlain: return configschema.StringPlain @@ -254,7 +255,7 @@ func schemaStringKind(k tfprotov5.StringKind) configschema.StringKind { } } -func schemaNestedBlock(b *tfprotov5.SchemaNestedBlock) *configschema.NestedBlock { +func schemaNestedBlock(ctx context.Context, b *tfprotov5.SchemaNestedBlock) *configschema.NestedBlock { var nesting configschema.NestingMode switch b.Nesting { case tfprotov5.SchemaNestedBlockNestingModeSingle: @@ -278,7 +279,7 @@ func schemaNestedBlock(b *tfprotov5.SchemaNestedBlock) *configschema.NestedBlock MaxItems: int(b.MaxItems), } - nested := ProtoToConfigSchema(b.Block) + nested := ProtoToConfigSchema(ctx, b.Block) nb.Block = *nested return nb } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go index eb7b3f08e..35f20f7ee 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go @@ -11,7 +11,7 @@ import ( ) // The main version number that is being run at the moment. -var SDKVersion = "2.4.3" +var SDKVersion = "2.10.1" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/debug.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/debug.go index fb4f81400..e1875e134 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/debug.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/debug.go @@ -2,13 +2,7 @@ package plugin import ( "context" - "encoding/json" "errors" - "fmt" - "os" - "os/signal" - "runtime" - "strings" "time" "github.com/hashicorp/go-plugin" @@ -17,10 +11,11 @@ import ( // ReattachConfig holds the information Terraform needs to be able to attach // itself to a provider process, so it can drive the process. type ReattachConfig struct { - Protocol string - Pid int - Test bool - Addr ReattachConfigAddr + Protocol string + ProtocolVersion int + Pid int + Test bool + Addr ReattachConfigAddr } // ReattachConfigAddr is a JSON-encoding friendly version of net.Addr. @@ -36,6 +31,10 @@ func DebugServe(ctx context.Context, opts *ServeOpts) (ReattachConfig, <-chan st reattachCh := make(chan *plugin.ReattachConfig) closeCh := make(chan struct{}) + if opts == nil { + return ReattachConfig{}, closeCh, errors.New("ServeOpts must be passed in with at least GRPCProviderFunc, GRPCProviderV6Func, or ProviderFunc") + } + opts.TestConfig = &plugin.ServeTestConfig{ Context: ctx, ReattachConfigCh: reattachCh, @@ -56,9 +55,10 @@ func DebugServe(ctx context.Context, opts *ServeOpts) (ReattachConfig, <-chan st } return ReattachConfig{ - Protocol: string(config.Protocol), - Pid: config.Pid, - Test: config.Test, + Protocol: string(config.Protocol), + ProtocolVersion: config.ProtocolVersion, + Pid: config.Pid, + Test: config.Test, Addr: ReattachConfigAddr{ Network: config.Addr.Network(), String: config.Addr.String(), @@ -69,48 +69,20 @@ func DebugServe(ctx context.Context, opts *ServeOpts) (ReattachConfig, <-chan st // Debug starts a debug server and controls its lifecycle, printing the // information needed for Terraform to connect to the provider to stdout. // os.Interrupt will be captured and used to stop the server. +// +// Deprecated: Use the Serve function with the ServeOpts Debug field instead. func Debug(ctx context.Context, providerAddr string, opts *ServeOpts) error { - ctx, cancel := context.WithCancel(ctx) - // Ctrl-C will stop the server - sigCh := make(chan os.Signal, 1) - signal.Notify(sigCh, os.Interrupt) - defer func() { - signal.Stop(sigCh) - cancel() - }() - config, closeCh, err := DebugServe(ctx, opts) - if err != nil { - return fmt.Errorf("Error launching debug server: %w", err) - } - go func() { - select { - case <-sigCh: - cancel() - case <-ctx.Done(): - } - }() - reattachBytes, err := json.Marshal(map[string]ReattachConfig{ - providerAddr: config, - }) - if err != nil { - return fmt.Errorf("Error building reattach string: %w", err) + if opts == nil { + return errors.New("ServeOpts must be passed in with at least GRPCProviderFunc, GRPCProviderV6Func, or ProviderFunc") } - reattachStr := string(reattachBytes) - - fmt.Printf("Provider started, to attach Terraform set the TF_REATTACH_PROVIDERS env var:\n\n") - switch runtime.GOOS { - case "windows": - fmt.Printf("\tCommand Prompt:\tset \"TF_REATTACH_PROVIDERS=%s\"\n", reattachStr) - fmt.Printf("\tPowerShell:\t$env:TF_REATTACH_PROVIDERS='%s'\n", strings.ReplaceAll(reattachStr, `'`, `''`)) - case "linux", "darwin": - fmt.Printf("\tTF_REATTACH_PROVIDERS='%s'\n", strings.ReplaceAll(reattachStr, `'`, `'"'"'`)) - default: - fmt.Println(reattachStr) + opts.Debug = true + + if opts.ProviderAddr == "" { + opts.ProviderAddr = providerAddr } - fmt.Println("") - // wait for the server to be done - <-closeCh + Serve(opts) + return nil } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go index baaab2d1d..88975da2c 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go @@ -1,24 +1,33 @@ package plugin import ( + "errors" "log" hclog "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-plugin" - "google.golang.org/grpc" + testing "github.com/mitchellh/go-testing-interface" "github.com/hashicorp/terraform-plugin-go/tfprotov5" - tf5server "github.com/hashicorp/terraform-plugin-go/tfprotov5/server" + "github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server" + "github.com/hashicorp/terraform-plugin-go/tfprotov6" + "github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) const ( // The constants below are the names of the plugins that can be dispensed // from the plugin server. + // + // Deprecated: This is no longer used, but left for backwards compatibility + // since it is exported. It will be removed in the next major version. ProviderPluginName = "provider" ) // Handshake is the HandshakeConfig used to configure clients and servers. +// +// Deprecated: This is no longer used, but left for backwards compatibility +// since it is exported. It will be removed in the next major version. var Handshake = plugin.HandshakeConfig{ // The magic cookie values should NEVER be changed. MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", @@ -27,6 +36,7 @@ var Handshake = plugin.HandshakeConfig{ type ProviderFunc func() *schema.Provider type GRPCProviderFunc func() tfprotov5.ProviderServer +type GRPCProviderV6Func func() tfprotov6.ProviderServer // ServeOpts are the configurations to serve a plugin. type ServeOpts struct { @@ -36,25 +46,49 @@ type ServeOpts struct { // added to the GRPC functions when possible. GRPCProviderFunc GRPCProviderFunc + GRPCProviderV6Func GRPCProviderV6Func + // Logger is the logger that go-plugin will use. Logger hclog.Logger + // Debug starts a debug server and controls its lifecycle, printing the + // information needed for Terraform to connect to the provider to stdout. + // os.Interrupt will be captured and used to stop the server. + // + // This option cannot be combined with TestConfig. + Debug bool + // TestConfig should only be set when the provider is being tested; it // will opt out of go-plugin's lifecycle management and other features, // and will use the supplied configuration options to control the // plugin's lifecycle and communicate connection information. See the // go-plugin GoDoc for more information. + // + // This option cannot be combined with Debug. TestConfig *plugin.ServeTestConfig // Set NoLogOutputOverride to not override the log output with an hclog // adapter. This should only be used when running the plugin in // acceptance tests. NoLogOutputOverride bool + + // UseTFLogSink is the testing.T for a test function that will turn on + // the terraform-plugin-log logging sink. + UseTFLogSink testing.T + + // ProviderAddr is the address of the provider under test, like + // registry.terraform.io/hashicorp/random. + ProviderAddr string } // Serve serves a plugin. This function never returns and should be the final // function called in the main function of the plugin. func Serve(opts *ServeOpts) { + if opts.Debug && opts.TestConfig != nil { + log.Printf("[ERROR] Error starting provider: cannot set both Debug and TestConfig") + return + } + if !opts.NoLogOutputOverride { // In order to allow go-plugin to correctly pass log-levels through to // terraform, we need to use an hclog.Logger with JSON output. We can @@ -70,30 +104,125 @@ func Serve(opts *ServeOpts) { log.SetOutput(logger.StandardWriter(&hclog.StandardLoggerOptions{InferLevels: true})) } - // since the plugins may not yet be aware of the new protocol, we - // automatically wrap the plugins in the grpc shims. - if opts.GRPCProviderFunc == nil && opts.ProviderFunc != nil { + if opts.ProviderAddr == "" { + opts.ProviderAddr = "provider" + } + + var err error + + switch { + case opts.ProviderFunc != nil && opts.GRPCProviderFunc == nil: opts.GRPCProviderFunc = func() tfprotov5.ProviderServer { return schema.NewGRPCProviderServer(opts.ProviderFunc()) } + err = tf5serverServe(opts) + case opts.GRPCProviderFunc != nil: + err = tf5serverServe(opts) + case opts.GRPCProviderV6Func != nil: + err = tf6serverServe(opts) + default: + err = errors.New("no provider server defined in ServeOpts") + } + + if err != nil { + log.Printf("[ERROR] Error starting provider: %s", err) + } +} + +func tf5serverServe(opts *ServeOpts) error { + var tf5serveOpts []tf5server.ServeOpt + + if opts.Debug { + tf5serveOpts = append(tf5serveOpts, tf5server.WithManagedDebug()) + } + + if opts.Logger != nil { + tf5serveOpts = append(tf5serveOpts, tf5server.WithGoPluginLogger(opts.Logger)) + } + + if opts.TestConfig != nil { + // Convert send-only channels to bi-directional channels to appease + // the compiler. WithDebug is errantly defined to require + // bi-directional when send-only is actually needed, which may be + // fixed in the future so the opts.TestConfig channels can be passed + // through directly. + closeCh := make(chan struct{}) + reattachConfigCh := make(chan *plugin.ReattachConfig) + + go func() { + // Always forward close channel receive, since its signaling that + // the channel is closed. + val := <-closeCh + opts.TestConfig.CloseCh <- val + }() + + go func() { + val, ok := <-reattachConfigCh + + if ok { + opts.TestConfig.ReattachConfigCh <- val + } + }() + + tf5serveOpts = append(tf5serveOpts, tf5server.WithDebug( + opts.TestConfig.Context, + reattachConfigCh, + closeCh), + ) + } + + if opts.UseTFLogSink != nil { + tf5serveOpts = append(tf5serveOpts, tf5server.WithLoggingSink(opts.UseTFLogSink)) + } + + return tf5server.Serve(opts.ProviderAddr, opts.GRPCProviderFunc, tf5serveOpts...) +} + +func tf6serverServe(opts *ServeOpts) error { + var tf6serveOpts []tf6server.ServeOpt + + if opts.Debug { + tf6serveOpts = append(tf6serveOpts, tf6server.WithManagedDebug()) + } + + if opts.Logger != nil { + tf6serveOpts = append(tf6serveOpts, tf6server.WithGoPluginLogger(opts.Logger)) + } + + if opts.TestConfig != nil { + // Convert send-only channels to bi-directional channels to appease + // the compiler. WithDebug is errantly defined to require + // bi-directional when send-only is actually needed, which may be + // fixed in the future so the opts.TestConfig channels can be passed + // through directly. + closeCh := make(chan struct{}) + reattachConfigCh := make(chan *plugin.ReattachConfig) + + go func() { + // Always forward close channel receive, since its signaling that + // the channel is closed. + val := <-closeCh + opts.TestConfig.CloseCh <- val + }() + + go func() { + val, ok := <-reattachConfigCh + + if ok { + opts.TestConfig.ReattachConfigCh <- val + } + }() + + tf6serveOpts = append(tf6serveOpts, tf6server.WithDebug( + opts.TestConfig.Context, + reattachConfigCh, + closeCh), + ) + } + + if opts.UseTFLogSink != nil { + tf6serveOpts = append(tf6serveOpts, tf6server.WithLoggingSink(opts.UseTFLogSink)) } - provider := opts.GRPCProviderFunc() - plugin.Serve(&plugin.ServeConfig{ - HandshakeConfig: Handshake, - VersionedPlugins: map[int]plugin.PluginSet{ - 5: { - ProviderPluginName: &tf5server.GRPCProviderPlugin{ - GRPCProvider: func() tfprotov5.ProviderServer { - return provider - }, - }, - }, - }, - GRPCServer: func(opts []grpc.ServerOption) *grpc.Server { - return grpc.NewServer(opts...) - }, - Logger: opts.Logger, - Test: opts.TestConfig, - }) + return tf6server.Serve(opts.ProviderAddr, opts.GRPCProviderV6Func, tf6serveOpts...) } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go index c7d82cf3d..8a2940f31 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/diff.go @@ -20,7 +20,7 @@ import ( type diffChangeType byte const ( - diffInvalid diffChangeType = iota + diffInvalid diffChangeType = iota //nolint:deadcode,varcheck diffNone diffCreate diffUpdate @@ -39,6 +39,10 @@ type InstanceDiff struct { DestroyDeposed bool DestroyTainted bool + RawConfig cty.Value + RawState cty.Value + RawPlan cty.Value + // Meta is a simple K/V map that is stored in a diff and persisted to // plans but otherwise is completely ignored by Terraform core. It is // meant to be used for additional data a resource may want to pass through. diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/resource.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/resource.go index 11b63de8a..703547745 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/resource.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/resource.go @@ -154,13 +154,13 @@ func (c *ResourceConfig) DeepCopy() *ResourceConfig { } // Copy, this will copy all the exported attributes - copy, err := copystructure.Config{Lock: true}.Copy(c) + copiedConfig, err := copystructure.Config{Lock: true}.Copy(c) if err != nil { panic(err) } // Force the type - result := copy.(*ResourceConfig) + result := copiedConfig.(*ResourceConfig) return result } diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go index 87f7610a9..170e20cd0 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state.go @@ -366,11 +366,11 @@ func (s *State) Remove(addr ...string) error { switch v := r.Value.(type) { case *ModuleState: - s.removeModule(path, v) + s.removeModule(v) case *ResourceState: s.removeResource(path, v) case *InstanceState: - s.removeInstance(path, r.Parent.Value.(*ResourceState), v) + s.removeInstance(r.Parent.Value.(*ResourceState), v) default: return fmt.Errorf("unknown type to delete: %T", r.Value) } @@ -384,7 +384,7 @@ func (s *State) Remove(addr ...string) error { return nil } -func (s *State) removeModule(path []string, v *ModuleState) { +func (s *State) removeModule(v *ModuleState) { for i, m := range s.Modules { if m == v { s.Modules, s.Modules[len(s.Modules)-1] = append(s.Modules[:i], s.Modules[i+1:]...), nil @@ -412,7 +412,7 @@ func (s *State) removeResource(path []string, v *ResourceState) { } } -func (s *State) removeInstance(path []string, r *ResourceState, v *InstanceState) { +func (s *State) removeInstance(r *ResourceState, v *InstanceState) { // Go through the resource and find the instance that matches this // (if any) and remove it. @@ -421,20 +421,6 @@ func (s *State) removeInstance(path []string, r *ResourceState, v *InstanceState r.Primary = nil return } - - // Check lists - lists := [][]*InstanceState{r.Deposed} - for _, is := range lists { - for i, instance := range is { - if instance == v { - // Found it, remove it - is, is[len(is)-1] = append(is[:i], is[i+1:]...), nil - - // Done - return - } - } - } } // RootModule returns the ModuleState for the root module @@ -562,12 +548,12 @@ func (s *State) DeepCopy() *State { return nil } - copy, err := copystructure.Config{Lock: true}.Copy(s) + copiedState, err := copystructure.Config{Lock: true}.Copy(s) if err != nil { panic(err) } - return copy.(*State) + return copiedState.(*State) } func (s *State) Init() { @@ -1023,7 +1009,7 @@ func (m *ModuleState) String() string { } if len(rs.Dependencies) > 0 { - buf.WriteString(fmt.Sprintf("\n Dependencies:\n")) + buf.WriteString("\n Dependencies:\n") for _, dep := range rs.Dependencies { buf.WriteString(fmt.Sprintf(" %s\n", dep)) } @@ -1237,11 +1223,7 @@ func (s *ResourceState) Equal(other *ResourceState) bool { } // States must be equal - if !s.Primary.Equal(other.Primary) { - return false - } - - return true + return s.Primary.Equal(other.Primary) } // Taint marks a resource as tainted. @@ -1343,6 +1325,10 @@ type InstanceState struct { ProviderMeta cty.Value + RawConfig cty.Value + RawState cty.Value + RawPlan cty.Value + // Tainted is used to mark a resource for recreation. Tainted bool `json:"tainted"` @@ -1426,12 +1412,12 @@ func (s *InstanceState) Set(from *InstanceState) { } func (s *InstanceState) DeepCopy() *InstanceState { - copy, err := copystructure.Config{Lock: true}.Copy(s) + copiedState, err := copystructure.Config{Lock: true}.Copy(s) if err != nil { panic(err) } - return copy.(*InstanceState) + return copiedState.(*InstanceState) } func (s *InstanceState) Empty() bool { diff --git a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state_filter.go b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state_filter.go index 01d039272..d2229f8ce 100644 --- a/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state_filter.go +++ b/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/terraform/state_filter.go @@ -24,7 +24,15 @@ type stateFilter struct { // parseResourceAddress. func (f *stateFilter) filter(fs ...string) ([]*stateFilterResult, error) { // Parse all the addresses - as := make([]*resourceAddress, len(fs)) + var as []*resourceAddress + + if len(fs) == 0 { + // If we weren't given any filters, then we list all + as = []*resourceAddress{{Index: -1}} + } else { + as = make([]*resourceAddress, len(fs)) + } + for i, v := range fs { a, err := parseResourceAddress(v) if err != nil { @@ -34,11 +42,6 @@ func (f *stateFilter) filter(fs ...string) ([]*stateFilterResult, error) { as[i] = a } - // If we weren't given any filters, then we list all - if len(fs) == 0 { - as = append(as, &resourceAddress{Index: -1}) - } - // Filter each of the address. We keep track of this in a map to // strip duplicates. resultSet := make(map[string]*stateFilterResult) diff --git a/vendor/github.com/hashicorp/terraform-registry-address/.go-version b/vendor/github.com/hashicorp/terraform-registry-address/.go-version new file mode 100644 index 000000000..adc97d8e2 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/.go-version @@ -0,0 +1 @@ +1.18 diff --git a/vendor/github.com/hashicorp/terraform-registry-address/LICENSE b/vendor/github.com/hashicorp/terraform-registry-address/LICENSE new file mode 100644 index 000000000..c33dcc7c9 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/vendor/github.com/hashicorp/terraform-registry-address/README.md b/vendor/github.com/hashicorp/terraform-registry-address/README.md new file mode 100644 index 000000000..091ff7014 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/README.md @@ -0,0 +1,111 @@ +# terraform-registry-address + +This package helps with representation, comparison and parsing of +Terraform Registry addresses, such as +`registry.terraform.io/grafana/grafana` or `hashicorp/aws`. + +The most common source of these addresses outside of Terraform Core +is JSON representation of state, plan, or schemas as obtained +via [`hashicorp/terraform-exec`](https://github.com/hashicorp/terraform-exec). + +## Parsing Provider Addresses + +### Example + +```go +p, err := ParseRawProviderSourceString("hashicorp/aws") +if err != nil { + // deal with error +} + +// p == Provider{ +// Type: "aws", +// Namespace: "hashicorp", +// Hostname: svchost.Hostname("registry.terraform.io"), +// } +``` + +### Legacy address + +A legacy address is by itself (without more context) ambiguous. +For example `aws` may represent either the official `hashicorp/aws` +or just any custom-built provider called `aws`. + +Such ambiguous address can be produced by Terraform `<=0.12`. You can +just use `ImpliedProviderForUnqualifiedType` if you know for sure +the address was produced by an affected version. + +If you do not have that context you should parse the string via +`ParseRawProviderSourceString` and then check `addr.IsLegacy()`. + +#### What to do with a legacy address? + +Ask the Registry API whether and where the provider was moved to + +(`-` represents the legacy, basically unknown namespace) + +```sh +# grafana (redirected to its own namespace) +$ curl -s https://registry.terraform.io/v1/providers/-/grafana/versions | jq '(.id, .moved_to)' +"terraform-providers/grafana" +"grafana/grafana" + +# aws (provider without redirection) +$ curl -s https://registry.terraform.io/v1/providers/-/aws/versions | jq '(.id, .moved_to)' +"hashicorp/aws" +null +``` + +Then: + + - Reparse the _new_ address (`moved_to`) of any _moved_ provider (e.g. `grafana/grafana`) via `ParseRawProviderSourceString` + - Reparse the full address (`id`) of any other provider (e.g. `hashicorp/aws`) + +Depending on context (legacy) `terraform` may need to be parsed separately. +Read more about this provider below. + +If for some reason you cannot ask the Registry API you may also use +`ParseAndInferProviderSourceString` which assumes that any legacy address +(including `terraform`) belongs to the `hashicorp` namespace. + +If you cache results (which you should), ensure you have invalidation +mechanism in place because target (migrated) namespace may change. +Hard-coding migrations anywhere in code is strongly discouraged. + +#### `terraform` provider + +Like any other legacy address `terraform` is also ambiguous. Such address may +(most unlikely) represent a custom-built provider called `terraform`, +or the now archived [`hashicorp/terraform` provider in the registry](https://registry.terraform.io/providers/hashicorp/terraform/latest), +or (most likely) the `terraform` provider built into 0.12+, which is +represented via a dedicated FQN of `terraform.io/builtin/terraform` in 0.13+. + +You may be able to differentiate between these different providers if you +know the version of Terraform. + +Alternatively you may just treat the address as the builtin provider, +i.e. assume all of its logic including schema is contained within +Terraform Core. + +In such case you should just use `NewBuiltInProvider("terraform")`. + +## Parsing Module Addresses + +### Example + +```go +registry, err := ParseRawModuleSourceRegistry("hashicorp/subnets/cidr") +if err != nil { + // deal with error +} + +// registry == ModuleSourceRegistry{ +// PackageAddr: ModuleRegistryPackage{ +// Host: svchost.Hostname("registry.terraform.io"), +// Namespace: "hashicorp", +// Name: "subnets", +// TargetSystem: "cidr", +// }, +// Subdir: "", +// }, +``` diff --git a/vendor/github.com/hashicorp/terraform-registry-address/errors.go b/vendor/github.com/hashicorp/terraform-registry-address/errors.go new file mode 100644 index 000000000..1ca735383 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/errors.go @@ -0,0 +1,14 @@ +package tfaddr + +import ( + "fmt" +) + +type ParserError struct { + Summary string + Detail string +} + +func (pe *ParserError) Error() string { + return fmt.Sprintf("%s: %s", pe.Summary, pe.Detail) +} diff --git a/vendor/github.com/hashicorp/terraform-registry-address/go.mod b/vendor/github.com/hashicorp/terraform-registry-address/go.mod new file mode 100644 index 000000000..44328056f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/go.mod @@ -0,0 +1,9 @@ +module github.com/hashicorp/terraform-registry-address + +go 1.14 + +require ( + github.com/google/go-cmp v0.5.8 + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 + golang.org/x/net v0.0.0-20210119194325-5f4716e94777 +) diff --git a/vendor/github.com/hashicorp/terraform-registry-address/go.sum b/vendor/github.com/hashicorp/terraform-registry-address/go.sum new file mode 100644 index 000000000..83124050c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/go.sum @@ -0,0 +1,37 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/hashicorp/terraform-registry-address/module.go b/vendor/github.com/hashicorp/terraform-registry-address/module.go new file mode 100644 index 000000000..f90279ec2 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/module.go @@ -0,0 +1,241 @@ +package tfaddr + +import ( + "fmt" + "path" + "regexp" + "strings" + + svchost "github.com/hashicorp/terraform-svchost" +) + +// ModuleSourceRegistry is representing a module listed in a Terraform module +// registry. +type ModuleSourceRegistry struct { + // PackageAddr is the registry package that the target module belongs to. + // The module installer must translate this into a ModuleSourceRemote + // using the registry API and then take that underlying address's + // PackageAddr in order to find the actual package location. + PackageAddr ModuleRegistryPackage + + // If Subdir is non-empty then it represents a sub-directory within the + // remote package that the registry address eventually resolves to. + // This will ultimately become the suffix of the Subdir of the + // ModuleSourceRemote that the registry address translates to. + // + // Subdir uses a normalized forward-slash-based path syntax within the + // virtual filesystem represented by the final package. It will never + // include `../` or `./` sequences. + Subdir string +} + +// DefaultModuleRegistryHost is the hostname used for registry-based module +// source addresses that do not have an explicit hostname. +const DefaultModuleRegistryHost = svchost.Hostname("registry.terraform.io") + +var moduleRegistryNamePattern = regexp.MustCompile("^[0-9A-Za-z](?:[0-9A-Za-z-_]{0,62}[0-9A-Za-z])?$") +var moduleRegistryTargetSystemPattern = regexp.MustCompile("^[0-9a-z]{1,64}$") + +// ParseRawModuleSourceRegistry only accepts module registry addresses, and +// will reject any other address type. +func ParseRawModuleSourceRegistry(raw string) (ModuleSourceRegistry, error) { + var err error + + var subDir string + raw, subDir = splitPackageSubdir(raw) + if strings.HasPrefix(subDir, "../") { + return ModuleSourceRegistry{}, fmt.Errorf("subdirectory path %q leads outside of the module package", subDir) + } + + parts := strings.Split(raw, "/") + // A valid registry address has either three or four parts, because the + // leading hostname part is optional. + if len(parts) != 3 && len(parts) != 4 { + return ModuleSourceRegistry{}, fmt.Errorf("a module registry source address must have either three or four slash-separated components") + } + + host := DefaultModuleRegistryHost + if len(parts) == 4 { + host, err = svchost.ForComparison(parts[0]) + if err != nil { + // The svchost library doesn't produce very good error messages to + // return to an end-user, so we'll use some custom ones here. + switch { + case strings.Contains(parts[0], "--"): + // Looks like possibly punycode, which we don't allow here + // to ensure that source addresses are written readably. + return ModuleSourceRegistry{}, fmt.Errorf("invalid module registry hostname %q; internationalized domain names must be given as direct unicode characters, not in punycode", parts[0]) + default: + return ModuleSourceRegistry{}, fmt.Errorf("invalid module registry hostname %q", parts[0]) + } + } + if !strings.Contains(host.String(), ".") { + return ModuleSourceRegistry{}, fmt.Errorf("invalid module registry hostname: must contain at least one dot") + } + // Discard the hostname prefix now that we've processed it + parts = parts[1:] + } + + ret := ModuleSourceRegistry{ + PackageAddr: ModuleRegistryPackage{ + Host: host, + }, + + Subdir: subDir, + } + + if host == svchost.Hostname("github.com") || host == svchost.Hostname("bitbucket.org") { + return ret, fmt.Errorf("can't use %q as a module registry host, because it's reserved for installing directly from version control repositories", host) + } + + if ret.PackageAddr.Namespace, err = parseModuleRegistryName(parts[0]); err != nil { + if strings.Contains(parts[0], ".") { + // Seems like the user omitted one of the latter components in + // an address with an explicit hostname. + return ret, fmt.Errorf("source address must have three more components after the hostname: the namespace, the name, and the target system") + } + return ret, fmt.Errorf("invalid namespace %q: %s", parts[0], err) + } + if ret.PackageAddr.Name, err = parseModuleRegistryName(parts[1]); err != nil { + return ret, fmt.Errorf("invalid module name %q: %s", parts[1], err) + } + if ret.PackageAddr.TargetSystem, err = parseModuleRegistryTargetSystem(parts[2]); err != nil { + if strings.Contains(parts[2], "?") { + // The user was trying to include a query string, probably? + return ret, fmt.Errorf("module registry addresses may not include a query string portion") + } + return ret, fmt.Errorf("invalid target system %q: %s", parts[2], err) + } + + return ret, nil +} + +// parseModuleRegistryName validates and normalizes a string in either the +// "namespace" or "name" position of a module registry source address. +func parseModuleRegistryName(given string) (string, error) { + // Similar to the names in provider source addresses, we defined these + // to be compatible with what filesystems and typical remote systems + // like GitHub allow in names. Unfortunately we didn't end up defining + // these exactly equivalently: provider names can only use dashes as + // punctuation, whereas module names can use underscores. So here we're + // using some regular expressions from the original module source + // implementation, rather than using the IDNA rules as we do in + // ParseProviderPart. + + if !moduleRegistryNamePattern.MatchString(given) { + return "", fmt.Errorf("must be between one and 64 characters, including ASCII letters, digits, dashes, and underscores, where dashes and underscores may not be the prefix or suffix") + } + + // We also skip normalizing the name to lowercase, because we historically + // didn't do that and so existing module registries might be doing + // case-sensitive matching. + return given, nil +} + +// parseModuleRegistryTargetSystem validates and normalizes a string in the +// "target system" position of a module registry source address. This is +// what we historically called "provider" but never actually enforced as +// being a provider address, and now _cannot_ be a provider address because +// provider addresses have three slash-separated components of their own. +func parseModuleRegistryTargetSystem(given string) (string, error) { + // Similar to the names in provider source addresses, we defined these + // to be compatible with what filesystems and typical remote systems + // like GitHub allow in names. Unfortunately we didn't end up defining + // these exactly equivalently: provider names can't use dashes or + // underscores. So here we're using some regular expressions from the + // original module source implementation, rather than using the IDNA rules + // as we do in ParseProviderPart. + + if !moduleRegistryTargetSystemPattern.MatchString(given) { + return "", fmt.Errorf("must be between one and 64 ASCII letters or digits") + } + + // We also skip normalizing the name to lowercase, because we historically + // didn't do that and so existing module registries might be doing + // case-sensitive matching. + return given, nil +} + +// String returns a full representation of the address, including any +// additional components that are typically implied by omission in +// user-written addresses. +// +// We typically use this longer representation in error message, in case +// the inclusion of normally-omitted components is helpful in debugging +// unexpected behavior. +func (s ModuleSourceRegistry) String() string { + if s.Subdir != "" { + return s.PackageAddr.String() + "//" + s.Subdir + } + return s.PackageAddr.String() +} + +// ForDisplay is similar to String but instead returns a representation of +// the idiomatic way to write the address in configuration, omitting +// components that are commonly just implied in addresses written by +// users. +// +// We typically use this shorter representation in informational messages, +// such as the note that we're about to start downloading a package. +func (s ModuleSourceRegistry) ForDisplay() string { + if s.Subdir != "" { + return s.PackageAddr.ForDisplay() + "//" + s.Subdir + } + return s.PackageAddr.ForDisplay() +} + +// splitPackageSubdir detects whether the given address string has a +// subdirectory portion, and if so returns a non-empty subDir string +// along with the trimmed package address. +// +// If the given string doesn't have a subdirectory portion then it'll +// just be returned verbatim in packageAddr, with an empty subDir value. +func splitPackageSubdir(given string) (packageAddr, subDir string) { + packageAddr, subDir = sourceDirSubdir(given) + if subDir != "" { + subDir = path.Clean(subDir) + } + return packageAddr, subDir +} + +// sourceDirSubdir takes a source URL and returns a tuple of the URL without +// the subdir and the subdir. +// +// ex: +// dom.com/path/?q=p => dom.com/path/?q=p, "" +// proto://dom.com/path//*?q=p => proto://dom.com/path?q=p, "*" +// proto://dom.com/path//path2?q=p => proto://dom.com/path?q=p, "path2" +func sourceDirSubdir(src string) (string, string) { + // URL might contains another url in query parameters + stop := len(src) + if idx := strings.Index(src, "?"); idx > -1 { + stop = idx + } + + // Calculate an offset to avoid accidentally marking the scheme + // as the dir. + var offset int + if idx := strings.Index(src[:stop], "://"); idx > -1 { + offset = idx + 3 + } + + // First see if we even have an explicit subdir + idx := strings.Index(src[offset:stop], "//") + if idx == -1 { + return src, "" + } + + idx += offset + subdir := src[idx+2:] + src = src[:idx] + + // Next, check if we have query parameters and push them onto the + // URL. + if idx = strings.Index(subdir, "?"); idx > -1 { + query := subdir[idx:] + subdir = subdir[:idx] + src += query + } + + return src, subdir +} diff --git a/vendor/github.com/hashicorp/terraform-registry-address/module_package.go b/vendor/github.com/hashicorp/terraform-registry-address/module_package.go new file mode 100644 index 000000000..cba03a7fd --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/module_package.go @@ -0,0 +1,87 @@ +package tfaddr + +import ( + "strings" + + svchost "github.com/hashicorp/terraform-svchost" +) + +// A ModulePackage represents a physical location where Terraform can retrieve +// a module package, which is an archive, repository, or other similar +// container which delivers the source code for one or more Terraform modules. +// +// A ModulePackage is a string in go-getter's address syntax. By convention, +// we use ModulePackage-typed values only for the result of successfully +// running the go-getter "detectors", which produces an address string which +// includes an explicit installation method prefix along with an address +// string in the format expected by that installation method. +// +// Note that although the "detector" phase of go-getter does do some simple +// normalization in certain cases, it isn't generally possible to compare +// two ModulePackage values to decide if they refer to the same package. Two +// equal ModulePackage values represent the same package, but there might be +// other non-equal ModulePackage values that also refer to that package, and +// there is no reliable way to determine that. +// +// Don't convert a user-provided string directly to ModulePackage. Instead, +// use ParseModuleSource with a remote module address and then access the +// ModulePackage value from the result, making sure to also handle the +// selected subdirectory if any. You should convert directly to ModulePackage +// only for a string that is hard-coded into the program (e.g. in a unit test) +// where you've ensured that it's already in the expected syntax. +type ModulePackage string + +func (p ModulePackage) String() string { + return string(p) +} + +// A ModuleRegistryPackage is an extra indirection over a ModulePackage where +// we use a module registry to translate a more symbolic address (and +// associated version constraint given out of band) into a physical source +// location. +// +// ModuleRegistryPackage is distinct from ModulePackage because they have +// disjoint use-cases: registry package addresses are only used to query a +// registry in order to find a real module package address. These being +// distinct is intended to help future maintainers more easily follow the +// series of steps in the module installer, with the help of the type checker. +type ModuleRegistryPackage struct { + Host svchost.Hostname + Namespace string + Name string + TargetSystem string +} + +func (s ModuleRegistryPackage) String() string { + // Note: we're using the "display" form of the hostname here because + // for our service hostnames "for display" means something different: + // it means to render non-ASCII characters directly as Unicode + // characters, rather than using the "punycode" representation we + // use for internal processing, and so the "display" representation + // is actually what users would write in their configurations. + return s.Host.ForDisplay() + "/" + s.ForRegistryProtocol() +} + +func (s ModuleRegistryPackage) ForDisplay() string { + if s.Host == DefaultModuleRegistryHost { + return s.ForRegistryProtocol() + } + return s.Host.ForDisplay() + "/" + s.ForRegistryProtocol() +} + +// ForRegistryProtocol returns a string representation of just the namespace, +// name, and target system portions of the address, always omitting the +// registry hostname and the subdirectory portion, if any. +// +// This is primarily intended for generating addresses to send to the +// registry in question via the registry protocol, since the protocol +// skips sending the registry its own hostname as part of identifiers. +func (s ModuleRegistryPackage) ForRegistryProtocol() string { + var buf strings.Builder + buf.WriteString(s.Namespace) + buf.WriteByte('/') + buf.WriteString(s.Name) + buf.WriteByte('/') + buf.WriteString(s.TargetSystem) + return buf.String() +} diff --git a/vendor/github.com/hashicorp/terraform-registry-address/provider.go b/vendor/github.com/hashicorp/terraform-registry-address/provider.go new file mode 100644 index 000000000..4dd0a5b78 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-registry-address/provider.go @@ -0,0 +1,482 @@ +package tfaddr + +import ( + "fmt" + "strings" + + svchost "github.com/hashicorp/terraform-svchost" + "golang.org/x/net/idna" +) + +// Provider encapsulates a single provider type. In the future this will be +// extended to include additional fields including Namespace and SourceHost +type Provider struct { + Type string + Namespace string + Hostname svchost.Hostname +} + +// DefaultRegistryHost is the hostname used for provider addresses that do +// not have an explicit hostname. +const DefaultRegistryHost = svchost.Hostname("registry.terraform.io") + +// BuiltInProviderHost is the pseudo-hostname used for the "built-in" provider +// namespace. Built-in provider addresses must also have their namespace set +// to BuiltInProviderNamespace in order to be considered as built-in. +const BuiltInProviderHost = svchost.Hostname("terraform.io") + +// BuiltInProviderNamespace is the provider namespace used for "built-in" +// providers. Built-in provider addresses must also have their hostname +// set to BuiltInProviderHost in order to be considered as built-in. +// +// The this namespace is literally named "builtin", in the hope that users +// who see FQNs containing this will be able to infer the way in which they are +// special, even if they haven't encountered the concept formally yet. +const BuiltInProviderNamespace = "builtin" + +// LegacyProviderNamespace is the special string used in the Namespace field +// of type Provider to mark a legacy provider address. This special namespace +// value would normally be invalid, and can be used only when the hostname is +// DefaultRegistryHost because that host owns the mapping from legacy name to +// FQN. +const LegacyProviderNamespace = "-" + +// String returns an FQN string, indended for use in machine-readable output. +func (pt Provider) String() string { + if pt.IsZero() { + panic("called String on zero-value addrs.Provider") + } + return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type +} + +// ForDisplay returns a user-friendly FQN string, simplified for readability. If +// the provider is using the default hostname, the hostname is omitted. +func (pt Provider) ForDisplay() string { + if pt.IsZero() { + panic("called ForDisplay on zero-value addrs.Provider") + } + + if pt.Hostname == DefaultRegistryHost { + return pt.Namespace + "/" + pt.Type + } + return pt.Hostname.ForDisplay() + "/" + pt.Namespace + "/" + pt.Type +} + +// NewProvider constructs a provider address from its parts, and normalizes +// the namespace and type parts to lowercase using unicode case folding rules +// so that resulting addrs.Provider values can be compared using standard +// Go equality rules (==). +// +// The hostname is given as a svchost.Hostname, which is required by the +// contract of that type to have already been normalized for equality testing. +// +// This function will panic if the given namespace or type name are not valid. +// When accepting namespace or type values from outside the program, use +// ParseProviderPart first to check that the given value is valid. +func NewProvider(hostname svchost.Hostname, namespace, typeName string) Provider { + if namespace == LegacyProviderNamespace { + // Legacy provider addresses must always be created via + // NewLegacyProvider so that we can use static analysis to find + // codepaths still working with those. + panic("attempt to create legacy provider address using NewProvider; use NewLegacyProvider instead") + } + + return Provider{ + Type: MustParseProviderPart(typeName), + Namespace: MustParseProviderPart(namespace), + Hostname: hostname, + } +} + +// ImpliedProviderForUnqualifiedType represents the rules for inferring what +// provider FQN a user intended when only a naked type name is available. +// +// For all except the type name "terraform" this returns a so-called "default" +// provider, which is under the registry.terraform.io/hashicorp/ namespace. +// +// As a special case, the string "terraform" maps to +// "terraform.io/builtin/terraform" because that is the more likely user +// intent than the now-unmaintained "registry.terraform.io/hashicorp/terraform" +// which remains only for compatibility with older Terraform versions. +func ImpliedProviderForUnqualifiedType(typeName string) Provider { + switch typeName { + case "terraform": + // Note for future maintainers: any additional strings we add here + // as implied to be builtin must never also be use as provider names + // in the registry.terraform.io/hashicorp/... namespace, because + // otherwise older versions of Terraform could implicitly select + // the registry name instead of the internal one. + return NewBuiltInProvider(typeName) + default: + return NewDefaultProvider(typeName) + } +} + +// NewDefaultProvider returns the default address of a HashiCorp-maintained, +// Registry-hosted provider. +func NewDefaultProvider(name string) Provider { + return Provider{ + Type: MustParseProviderPart(name), + Namespace: "hashicorp", + Hostname: DefaultRegistryHost, + } +} + +// NewBuiltInProvider returns the address of a "built-in" provider. See +// the docs for Provider.IsBuiltIn for more information. +func NewBuiltInProvider(name string) Provider { + return Provider{ + Type: MustParseProviderPart(name), + Namespace: BuiltInProviderNamespace, + Hostname: BuiltInProviderHost, + } +} + +// NewLegacyProvider returns a mock address for a provider. +// This will be removed when ProviderType is fully integrated. +func NewLegacyProvider(name string) Provider { + return Provider{ + // We intentionally don't normalize and validate the legacy names, + // because existing code expects legacy provider names to pass through + // verbatim, even if not compliant with our new naming rules. + Type: name, + Namespace: LegacyProviderNamespace, + Hostname: DefaultRegistryHost, + } +} + +// LegacyString returns the provider type, which is frequently used +// interchangeably with provider name. This function can and should be removed +// when provider type is fully integrated. As a safeguard for future +// refactoring, this function panics if the Provider is not a legacy provider. +func (pt Provider) LegacyString() string { + if pt.IsZero() { + panic("called LegacyString on zero-value addrs.Provider") + } + if pt.Namespace != LegacyProviderNamespace && pt.Namespace != BuiltInProviderNamespace { + panic(pt.String() + " cannot be represented as a legacy string") + } + return pt.Type +} + +// IsZero returns true if the receiver is the zero value of addrs.Provider. +// +// The zero value is not a valid addrs.Provider and calling other methods on +// such a value is likely to either panic or otherwise misbehave. +func (pt Provider) IsZero() bool { + return pt == Provider{} +} + +// IsBuiltIn returns true if the receiver is the address of a "built-in" +// provider. That is, a provider under terraform.io/builtin/ which is +// included as part of the Terraform binary itself rather than one to be +// installed from elsewhere. +// +// These are ignored by the provider installer because they are assumed to +// already be available without any further installation. +func (pt Provider) IsBuiltIn() bool { + return pt.Hostname == BuiltInProviderHost && pt.Namespace == BuiltInProviderNamespace +} + +// LessThan returns true if the receiver should sort before the other given +// address in an ordered list of provider addresses. +// +// This ordering is an arbitrary one just to allow deterministic results from +// functions that would otherwise have no natural ordering. It's subject +// to change in future. +func (pt Provider) LessThan(other Provider) bool { + switch { + case pt.Hostname != other.Hostname: + return pt.Hostname < other.Hostname + case pt.Namespace != other.Namespace: + return pt.Namespace < other.Namespace + default: + return pt.Type < other.Type + } +} + +// IsLegacy returns true if the provider is a legacy-style provider +func (pt Provider) IsLegacy() bool { + if pt.IsZero() { + panic("called IsLegacy() on zero-value addrs.Provider") + } + + return pt.Hostname == DefaultRegistryHost && pt.Namespace == LegacyProviderNamespace + +} + +// IsDefault returns true if the provider is a default hashicorp provider +func (pt Provider) IsDefault() bool { + if pt.IsZero() { + panic("called IsDefault() on zero-value addrs.Provider") + } + + return pt.Hostname == DefaultRegistryHost && pt.Namespace == "hashicorp" +} + +// Equals returns true if the receiver and other provider have the same attributes. +func (pt Provider) Equals(other Provider) bool { + return pt == other +} + +// ParseRawProviderSourceString parses the source attribute and returns a provider. +// This is intended primarily to parse the FQN-like strings returned by +// terraform-config-inspect. +// +// The following are valid source string formats: +// name +// namespace/name +// hostname/namespace/name +// +// "name"-only format is parsed as -/name (i.e. legacy namespace) +// requiring further identification of the namespace via Registry API +func ParseRawProviderSourceString(str string) (Provider, error) { + var ret Provider + parts, err := parseSourceStringParts(str) + if err != nil { + return ret, err + } + + name := parts[len(parts)-1] + ret.Type = name + ret.Hostname = DefaultRegistryHost + + if len(parts) == 1 { + return NewLegacyProvider(name), nil + } + + if len(parts) >= 2 { + // the namespace is always the second-to-last part + givenNamespace := parts[len(parts)-2] + if givenNamespace == LegacyProviderNamespace { + // For now we're tolerating legacy provider addresses until we've + // finished updating the rest of the codebase to no longer use them, + // or else we'd get errors round-tripping through legacy subsystems. + ret.Namespace = LegacyProviderNamespace + } else { + namespace, err := ParseProviderPart(givenNamespace) + if err != nil { + return Provider{}, &ParserError{ + Summary: "Invalid provider namespace", + Detail: fmt.Sprintf(`Invalid provider namespace %q in source %q: %s"`, namespace, str, err), + } + } + ret.Namespace = namespace + } + } + + // Final Case: 3 parts + if len(parts) == 3 { + // the namespace is always the first part in a three-part source string + hn, err := svchost.ForComparison(parts[0]) + if err != nil { + return Provider{}, &ParserError{ + Summary: "Invalid provider source hostname", + Detail: fmt.Sprintf(`Invalid provider source hostname namespace %q in source %q: %s"`, hn, str, err), + } + } + ret.Hostname = hn + } + + if ret.Namespace == LegacyProviderNamespace && ret.Hostname != DefaultRegistryHost { + // Legacy provider addresses must always be on the default registry + // host, because the default registry host decides what actual FQN + // each one maps to. + return Provider{}, &ParserError{ + Summary: "Invalid provider namespace", + Detail: "The legacy provider namespace \"-\" can be used only with hostname " + DefaultRegistryHost.ForDisplay() + ".", + } + } + + // Due to how plugin executables are named and provider git repositories + // are conventionally named, it's a reasonable and + // apparently-somewhat-common user error to incorrectly use the + // "terraform-provider-" prefix in a provider source address. There is + // no good reason for a provider to have the prefix "terraform-" anyway, + // so we've made that invalid from the start both so we can give feedback + // to provider developers about the terraform- prefix being redundant + // and give specialized feedback to folks who incorrectly use the full + // terraform-provider- prefix to help them self-correct. + const redundantPrefix = "terraform-" + const userErrorPrefix = "terraform-provider-" + if strings.HasPrefix(ret.Type, redundantPrefix) { + if strings.HasPrefix(ret.Type, userErrorPrefix) { + // Likely user error. We only return this specialized error if + // whatever is after the prefix would otherwise be a + // syntactically-valid provider type, so we don't end up advising + // the user to try something that would be invalid for another + // reason anyway. + // (This is mainly just for robustness, because the validation + // we already did above should've rejected most/all ways for + // the suggestedType to end up invalid here.) + suggestedType := ret.Type[len(userErrorPrefix):] + if _, err := ParseProviderPart(suggestedType); err == nil { + suggestedAddr := ret + suggestedAddr.Type = suggestedType + return Provider{}, &ParserError{ + Summary: "Invalid provider type", + Detail: fmt.Sprintf("Provider source %q has a type with the prefix %q, which isn't valid. Although that prefix is often used in the names of version control repositories for Terraform providers, provider source strings should not include it.\n\nDid you mean %q?", ret.ForDisplay(), userErrorPrefix, suggestedAddr.ForDisplay()), + } + } + } + // Otherwise, probably instead an incorrectly-named provider, perhaps + // arising from a similar instinct to what causes there to be + // thousands of Python packages on PyPI with "python-"-prefixed + // names. + return Provider{}, &ParserError{ + Summary: "Invalid provider type", + Detail: fmt.Sprintf("Provider source %q has a type with the prefix %q, which isn't allowed because it would be redundant to name a Terraform provider with that prefix. If you are the author of this provider, rename it to not include the prefix.", ret, redundantPrefix), + } + } + + return ret, nil +} + +// ParseAndInferProviderSourceString parses the source attribute and returns a provider. +// This is intended primarily to parse the FQN-like strings returned by +// terraform-config-inspect. +// +// The following are valid source string formats: +// name +// namespace/name +// hostname/namespace/name +// +// "name" format is assumed to be hashicorp/name +func ParseAndInferProviderSourceString(str string) (Provider, error) { + var ret Provider + parts, err := parseSourceStringParts(str) + if err != nil { + return ret, err + } + + if len(parts) == 1 { + return NewDefaultProvider(parts[0]), nil + } + + return ParseRawProviderSourceString(str) +} + +func parseSourceStringParts(str string) ([]string, error) { + // split the source string into individual components + parts := strings.Split(str, "/") + if len(parts) == 0 || len(parts) > 3 { + return nil, &ParserError{ + Summary: "Invalid provider source string", + Detail: `The "source" attribute must be in the format "[hostname/][namespace/]name"`, + } + } + + // check for an invalid empty string in any part + for i := range parts { + if parts[i] == "" { + return nil, &ParserError{ + Summary: "Invalid provider source string", + Detail: `The "source" attribute must be in the format "[hostname/][namespace/]name"`, + } + } + } + + // check the 'name' portion, which is always the last part + givenName := parts[len(parts)-1] + name, err := ParseProviderPart(givenName) + if err != nil { + return nil, &ParserError{ + Summary: "Invalid provider type", + Detail: fmt.Sprintf(`Invalid provider type %q in source %q: %s"`, givenName, str, err), + } + } + parts[len(parts)-1] = name + + return parts, nil +} + +// MustParseRawProviderSourceString is a wrapper around ParseRawProviderSourceString that panics if +// it returns an error. +func MustParseRawProviderSourceString(str string) Provider { + result, err := ParseRawProviderSourceString(str) + if err != nil { + panic(err) + } + return result +} + +// ParseProviderPart processes an addrs.Provider namespace or type string +// provided by an end-user, producing a normalized version if possible or +// an error if the string contains invalid characters. +// +// A provider part is processed in the same way as an individual label in a DNS +// domain name: it is transformed to lowercase per the usual DNS case mapping +// and normalization rules and may contain only letters, digits, and dashes. +// Additionally, dashes may not appear at the start or end of the string. +// +// These restrictions are intended to allow these names to appear in fussy +// contexts such as directory/file names on case-insensitive filesystems, +// repository names on GitHub, etc. We're using the DNS rules in particular, +// rather than some similar rules defined locally, because the hostname part +// of an addrs.Provider is already a hostname and it's ideal to use exactly +// the same case folding and normalization rules for all of the parts. +// +// In practice a provider type string conventionally does not contain dashes +// either. Such names are permitted, but providers with such type names will be +// hard to use because their resource type names will not be able to contain +// the provider type name and thus each resource will need an explicit provider +// address specified. (A real-world example of such a provider is the +// "google-beta" variant of the GCP provider, which has resource types that +// start with the "google_" prefix instead.) +// +// It's valid to pass the result of this function as the argument to a +// subsequent call, in which case the result will be identical. +func ParseProviderPart(given string) (string, error) { + if len(given) == 0 { + return "", fmt.Errorf("must have at least one character") + } + + // We're going to process the given name using the same "IDNA" library we + // use for the hostname portion, since it already implements the case + // folding rules we want. + // + // The idna library doesn't expose individual label parsing directly, but + // once we've verified it doesn't contain any dots we can just treat it + // like a top-level domain for this library's purposes. + if strings.ContainsRune(given, '.') { + return "", fmt.Errorf("dots are not allowed") + } + + // We don't allow names containing multiple consecutive dashes, just as + // a matter of preference: they look weird, confusing, or incorrect. + // This also, as a side-effect, prevents the use of the "punycode" + // indicator prefix "xn--" that would cause the IDNA library to interpret + // the given name as punycode, because that would be weird and unexpected. + if strings.Contains(given, "--") { + return "", fmt.Errorf("cannot use multiple consecutive dashes") + } + + result, err := idna.Lookup.ToUnicode(given) + if err != nil { + return "", fmt.Errorf("must contain only letters, digits, and dashes, and may not use leading or trailing dashes") + } + + return result, nil +} + +// MustParseProviderPart is a wrapper around ParseProviderPart that panics if +// it returns an error. +func MustParseProviderPart(given string) string { + result, err := ParseProviderPart(given) + if err != nil { + panic(err.Error()) + } + return result +} + +// IsProviderPartNormalized compares a given string to the result of ParseProviderPart(string) +func IsProviderPartNormalized(str string) (bool, error) { + normalized, err := ParseProviderPart(str) + if err != nil { + return false, err + } + if str == normalized { + return true, nil + } + return false, nil +} diff --git a/vendor/github.com/hashicorp/terraform-svchost/LICENSE b/vendor/github.com/hashicorp/terraform-svchost/LICENSE new file mode 100644 index 000000000..82b4de97c --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/LICENSE @@ -0,0 +1,353 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. diff --git a/vendor/github.com/hashicorp/terraform-svchost/go.mod b/vendor/github.com/hashicorp/terraform-svchost/go.mod new file mode 100644 index 000000000..8f29e4ac5 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/go.mod @@ -0,0 +1,12 @@ +module github.com/hashicorp/terraform-svchost + +go 1.12 + +require ( + github.com/google/go-cmp v0.3.1 + github.com/hashicorp/go-cleanhttp v0.5.1 + github.com/hashicorp/go-version v1.2.0 + github.com/zclconf/go-cty v1.1.0 + golang.org/x/net v0.0.0-20191009170851-d66e71096ffb + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 +) diff --git a/vendor/github.com/hashicorp/terraform-svchost/go.sum b/vendor/github.com/hashicorp/terraform-svchost/go.sum new file mode 100644 index 000000000..9ad1712f8 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/go.sum @@ -0,0 +1,36 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb h1:TR699M2v0qoKTOHxeLgp6zPqaQNs74f01a/ob9W0qko= +golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/hashicorp/terraform-svchost/label_iter.go b/vendor/github.com/hashicorp/terraform-svchost/label_iter.go new file mode 100644 index 000000000..af8ccbab2 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/label_iter.go @@ -0,0 +1,69 @@ +package svchost + +import ( + "strings" +) + +// A labelIter allows iterating over domain name labels. +// +// This type is copied from golang.org/x/net/idna, where it is used +// to segment hostnames into their separate labels for analysis. We use +// it for the same purpose here, in ForComparison. +type labelIter struct { + orig string + slice []string + curStart int + curEnd int + i int +} + +func (l *labelIter) reset() { + l.curStart = 0 + l.curEnd = 0 + l.i = 0 +} + +func (l *labelIter) done() bool { + return l.curStart >= len(l.orig) +} + +func (l *labelIter) result() string { + if l.slice != nil { + return strings.Join(l.slice, ".") + } + return l.orig +} + +func (l *labelIter) label() string { + if l.slice != nil { + return l.slice[l.i] + } + p := strings.IndexByte(l.orig[l.curStart:], '.') + l.curEnd = l.curStart + p + if p == -1 { + l.curEnd = len(l.orig) + } + return l.orig[l.curStart:l.curEnd] +} + +// next sets the value to the next label. It skips the last label if it is empty. +func (l *labelIter) next() { + l.i++ + if l.slice != nil { + if l.i >= len(l.slice) || l.i == len(l.slice)-1 && l.slice[l.i] == "" { + l.curStart = len(l.orig) + } + } else { + l.curStart = l.curEnd + 1 + if l.curStart == len(l.orig)-1 && l.orig[l.curStart] == '.' { + l.curStart = len(l.orig) + } + } +} + +func (l *labelIter) set(s string) { + if l.slice == nil { + l.slice = strings.Split(l.orig, ".") + } + l.slice[l.i] = s +} diff --git a/vendor/github.com/hashicorp/terraform-svchost/svchost.go b/vendor/github.com/hashicorp/terraform-svchost/svchost.go new file mode 100644 index 000000000..4060b767e --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-svchost/svchost.go @@ -0,0 +1,207 @@ +// Package svchost deals with the representations of the so-called "friendly +// hostnames" that we use to represent systems that provide Terraform-native +// remote services, such as module registry, remote operations, etc. +// +// Friendly hostnames are specified such that, as much as possible, they +// are consistent with how web browsers think of hostnames, so that users +// can bring their intuitions about how hostnames behave when they access +// a Terraform Enterprise instance's web UI (or indeed any other website) +// and have this behave in a similar way. +package svchost + +import ( + "errors" + "fmt" + "strconv" + "strings" + + "golang.org/x/net/idna" +) + +// Hostname is specialized name for string that indicates that the string +// has been converted to (or was already in) the storage and comparison form. +// +// Hostname values are not suitable for display in the user-interface. Use +// the ForDisplay method to obtain a form suitable for display in the UI. +// +// Unlike user-supplied hostnames, strings of type Hostname (assuming they +// were constructed by a function within this package) can be compared for +// equality using the standard Go == operator. +type Hostname string + +// acePrefix is the ASCII Compatible Encoding prefix, used to indicate that +// a domain name label is in "punycode" form. +const acePrefix = "xn--" + +// displayProfile is a very liberal idna profile that we use to do +// normalization for display without imposing validation rules. +var displayProfile = idna.New( + idna.MapForLookup(), + idna.Transitional(true), +) + +// ForDisplay takes a user-specified hostname and returns a normalized form of +// it suitable for display in the UI. +// +// If the input is so invalid that no normalization can be performed then +// this will return the input, assuming that the caller still wants to +// display _something_. This function is, however, more tolerant than the +// other functions in this package and will make a best effort to prepare +// _any_ given hostname for display. +// +// For validation, use either IsValid (for explicit validation) or +// ForComparison (which implicitly validates, returning an error if invalid). +func ForDisplay(given string) string { + var portPortion string + if colonPos := strings.Index(given, ":"); colonPos != -1 { + given, portPortion = given[:colonPos], given[colonPos:] + } + portPortion, _ = normalizePortPortion(portPortion) + + ascii, err := displayProfile.ToASCII(given) + if err != nil { + return given + portPortion + } + display, err := displayProfile.ToUnicode(ascii) + if err != nil { + return given + portPortion + } + return display + portPortion +} + +// IsValid returns true if the given user-specified hostname is a valid +// service hostname. +// +// Validity is determined by complying with the RFC 5891 requirements for +// names that are valid for domain lookup (section 5), with the additional +// requirement that user-supplied forms must not _already_ contain +// Punycode segments. +func IsValid(given string) bool { + _, err := ForComparison(given) + return err == nil +} + +// ForComparison takes a user-specified hostname and returns a normalized +// form of it suitable for storage and comparison. The result is not suitable +// for display to end-users because it uses Punycode to represent non-ASCII +// characters, and this form is unreadable for non-ASCII-speaking humans. +// +// The result is typed as Hostname -- a specialized name for string -- so that +// other APIs can make it clear within the type system whether they expect a +// user-specified or display-form hostname or a value already normalized for +// comparison. +// +// The returned Hostname is not valid if the returned error is non-nil. +func ForComparison(given string) (Hostname, error) { + var portPortion string + if colonPos := strings.Index(given, ":"); colonPos != -1 { + given, portPortion = given[:colonPos], given[colonPos:] + } + + var err error + portPortion, err = normalizePortPortion(portPortion) + if err != nil { + return Hostname(""), err + } + + if given == "" { + return Hostname(""), fmt.Errorf("empty string is not a valid hostname") + } + + // First we'll apply our additional constraint that Punycode must not + // be given directly by the user. This is not an IDN specification + // requirement, but we prohibit it to force users to use human-readable + // hostname forms within Terraform configuration. + labels := labelIter{orig: given} + for ; !labels.done(); labels.next() { + label := labels.label() + if label == "" { + return Hostname(""), fmt.Errorf( + "hostname contains empty label (two consecutive periods)", + ) + } + if strings.HasPrefix(label, acePrefix) { + return Hostname(""), fmt.Errorf( + "hostname label %q specified in punycode format; service hostnames must be given in unicode", + label, + ) + } + } + + result, err := idna.Lookup.ToASCII(given) + if err != nil { + return Hostname(""), err + } + return Hostname(result + portPortion), nil +} + +// ForDisplay returns a version of the receiver that is appropriate for display +// in the UI. This includes converting any punycode labels to their +// corresponding Unicode characters. +// +// A round-trip through ForComparison and this ForDisplay method does not +// guarantee the same result as calling this package's top-level ForDisplay +// function, since a round-trip through the Hostname type implies stricter +// handling than we do when doing basic display-only processing. +func (h Hostname) ForDisplay() string { + given := string(h) + var portPortion string + if colonPos := strings.Index(given, ":"); colonPos != -1 { + given, portPortion = given[:colonPos], given[colonPos:] + } + // We don't normalize the port portion here because we assume it's + // already been normalized on the way in. + + result, err := idna.Lookup.ToUnicode(given) + if err != nil { + // Should never happen, since type Hostname indicates that a string + // passed through our validation rules. + panic(fmt.Errorf("ForDisplay called on invalid Hostname: %s", err)) + } + return result + portPortion +} + +func (h Hostname) String() string { + return string(h) +} + +func (h Hostname) GoString() string { + return fmt.Sprintf("svchost.Hostname(%q)", string(h)) +} + +// normalizePortPortion attempts to normalize the "port portion" of a hostname, +// which begins with the first colon in the hostname and should be followed +// by a string of decimal digits. +// +// If the port portion is valid, a normalized version of it is returned along +// with a nil error. +// +// If the port portion is invalid, the input string is returned verbatim along +// with a non-nil error. +// +// An empty string is a valid port portion representing the absence of a port. +// If non-empty, the first character must be a colon. +func normalizePortPortion(s string) (string, error) { + if s == "" { + return s, nil + } + + if s[0] != ':' { + // should never happen, since caller tends to guarantee the presence + // of a colon due to how it's extracted from the string. + return s, errors.New("port portion is missing its initial colon") + } + + numStr := s[1:] + num, err := strconv.Atoi(numStr) + if err != nil { + return s, errors.New("port portion contains non-digit characters") + } + if num == 443 { + return "", nil // ":443" is the default + } + if num > 65535 { + return s, errors.New("port number is greater than 65535") + } + return fmt.Sprintf(":%d", num), nil +} diff --git a/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md b/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md index 38a099162..c75823490 100644 --- a/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md +++ b/vendor/github.com/mitchellh/mapstructure/CHANGELOG.md @@ -1,3 +1,16 @@ +## 1.5.0 + +* New option `IgnoreUntaggedFields` to ignore decoding to any fields + without `mapstructure` (or the configured tag name) set [GH-277] +* New option `ErrorUnset` which makes it an error if any fields + in a target struct are not set by the decoding process. [GH-225] +* New function `OrComposeDecodeHookFunc` to help compose decode hooks. [GH-240] +* Decoding to slice from array no longer crashes [GH-265] +* Decode nested struct pointers to map [GH-271] +* Fix issue where `,squash` was ignored if `Squash` option was set. [GH-280] +* Fix issue where fields with `,omitempty` would sometimes decode + into a map with an empty string key [GH-281] + ## 1.4.3 * Fix cases where `json.Number` didn't decode properly [GH-261] diff --git a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go index 4d4bbc733..3a754ca72 100644 --- a/vendor/github.com/mitchellh/mapstructure/decode_hooks.go +++ b/vendor/github.com/mitchellh/mapstructure/decode_hooks.go @@ -77,6 +77,28 @@ func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc { } } +// OrComposeDecodeHookFunc executes all input hook functions until one of them returns no error. In that case its value is returned. +// If all hooks return an error, OrComposeDecodeHookFunc returns an error concatenating all error messages. +func OrComposeDecodeHookFunc(ff ...DecodeHookFunc) DecodeHookFunc { + return func(a, b reflect.Value) (interface{}, error) { + var allErrs string + var out interface{} + var err error + + for _, f := range ff { + out, err = DecodeHookExec(f, a, b) + if err != nil { + allErrs += err.Error() + "\n" + continue + } + + return out, nil + } + + return nil, errors.New(allErrs) + } +} + // StringToSliceHookFunc returns a DecodeHookFunc that converts // string to []string by splitting on the given sep. func StringToSliceHookFunc(sep string) DecodeHookFunc { diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go index 6b81b0067..1efb22ac3 100644 --- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go +++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go @@ -122,7 +122,7 @@ // field value is zero and a numeric type, the field is empty, and it won't // be encoded into the destination type. // -// type Source { +// type Source struct { // Age int `mapstructure:",omitempty"` // } // @@ -215,6 +215,12 @@ type DecoderConfig struct { // (extra keys). ErrorUnused bool + // If ErrorUnset is true, then it is an error for there to exist + // fields in the result that were not set in the decoding process + // (extra fields). This only applies to decoding to a struct. This + // will affect all nested structs as well. + ErrorUnset bool + // ZeroFields, if set to true, will zero fields before writing them. // For example, a map will be emptied before decoded values are put in // it. If this is false, a map will be merged. @@ -259,6 +265,10 @@ type DecoderConfig struct { // defaults to "mapstructure" TagName string + // IgnoreUntaggedFields ignores all struct fields without explicit + // TagName, comparable to `mapstructure:"-"` as default behaviour. + IgnoreUntaggedFields bool + // MatchName is the function used to match the map key to the struct // field name or tag. Defaults to `strings.EqualFold`. This can be used // to implement case-sensitive tag values, support snake casing, etc. @@ -284,6 +294,11 @@ type Metadata struct { // Unused is a slice of keys that were found in the raw value but // weren't decoded since there was no matching field in the result interface Unused []string + + // Unset is a slice of field names that were found in the result interface + // but weren't set in the decoding process since there was no matching value + // in the input + Unset []string } // Decode takes an input structure and uses reflection to translate it to @@ -375,6 +390,10 @@ func NewDecoder(config *DecoderConfig) (*Decoder, error) { if config.Metadata.Unused == nil { config.Metadata.Unused = make([]string, 0) } + + if config.Metadata.Unset == nil { + config.Metadata.Unset = make([]string, 0) + } } if config.TagName == "" { @@ -906,9 +925,15 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re tagValue := f.Tag.Get(d.config.TagName) keyName := f.Name + if tagValue == "" && d.config.IgnoreUntaggedFields { + continue + } + // If Squash is set in the config, we squash the field down. squash := d.config.Squash && v.Kind() == reflect.Struct && f.Anonymous + v = dereferencePtrToStructIfNeeded(v, d.config.TagName) + // Determine the name of the key in the map if index := strings.Index(tagValue, ","); index != -1 { if tagValue[:index] == "-" { @@ -920,7 +945,7 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re } // If "squash" is specified in the tag, we squash the field down. - squash = !squash && strings.Index(tagValue[index+1:], "squash") != -1 + squash = squash || strings.Index(tagValue[index+1:], "squash") != -1 if squash { // When squashing, the embedded type can be a pointer to a struct. if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct { @@ -932,7 +957,9 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re return fmt.Errorf("cannot squash non-struct type '%s'", v.Type()) } } - keyName = tagValue[:index] + if keyNameTagValue := tagValue[:index]; keyNameTagValue != "" { + keyName = keyNameTagValue + } } else if len(tagValue) > 0 { if tagValue == "-" { continue @@ -1088,7 +1115,7 @@ func (d *Decoder) decodeSlice(name string, data interface{}, val reflect.Value) } // If the input value is nil, then don't allocate since empty != nil - if dataVal.IsNil() { + if dataValKind != reflect.Array && dataVal.IsNil() { return nil } @@ -1250,6 +1277,7 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e dataValKeysUnused[dataValKey.Interface()] = struct{}{} } + targetValKeysUnused := make(map[interface{}]struct{}) errors := make([]string, 0) // This slice will keep track of all the structs we'll be decoding. @@ -1354,7 +1382,8 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e if !rawMapVal.IsValid() { // There was no matching key in the map for the value in - // the struct. Just ignore. + // the struct. Remember it for potential errors and metadata. + targetValKeysUnused[fieldName] = struct{}{} continue } } @@ -1414,6 +1443,17 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e errors = appendErrors(errors, err) } + if d.config.ErrorUnset && len(targetValKeysUnused) > 0 { + keys := make([]string, 0, len(targetValKeysUnused)) + for rawKey := range targetValKeysUnused { + keys = append(keys, rawKey.(string)) + } + sort.Strings(keys) + + err := fmt.Errorf("'%s' has unset fields: %s", name, strings.Join(keys, ", ")) + errors = appendErrors(errors, err) + } + if len(errors) > 0 { return &Error{errors} } @@ -1428,6 +1468,14 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e d.config.Metadata.Unused = append(d.config.Metadata.Unused, key) } + for rawKey := range targetValKeysUnused { + key := rawKey.(string) + if name != "" { + key = name + "." + key + } + + d.config.Metadata.Unset = append(d.config.Metadata.Unset, key) + } } return nil @@ -1465,3 +1513,28 @@ func getKind(val reflect.Value) reflect.Kind { return kind } } + +func isStructTypeConvertibleToMap(typ reflect.Type, checkMapstructureTags bool, tagName string) bool { + for i := 0; i < typ.NumField(); i++ { + f := typ.Field(i) + if f.PkgPath == "" && !checkMapstructureTags { // check for unexported fields + return true + } + if checkMapstructureTags && f.Tag.Get(tagName) != "" { // check for mapstructure tags inside + return true + } + } + return false +} + +func dereferencePtrToStructIfNeeded(v reflect.Value, tagName string) reflect.Value { + if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Struct { + return v + } + deref := v.Elem() + derefT := deref.Type() + if isStructTypeConvertibleToMap(derefT, true, tagName) { + return deref + } + return v +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go index 2186514c0..34ac9148f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go @@ -93,6 +93,39 @@ type CircuitsCircuitTerminationsListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -347,6 +380,127 @@ func (o *CircuitsCircuitTerminationsListParams) SetCreatedLte(createdLte *string o.CreatedLte = createdLte } +// WithDescription adds the description to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescription(description *string) *CircuitsCircuitTerminationsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionEmpty(descriptionEmpty *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionIc(descriptionIc *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionIe(descriptionIe *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionIew(descriptionIew *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionIsw(descriptionIsw *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionn(descriptionn *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionNic(descriptionNic *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionNie(descriptionNie *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionNiew(descriptionNiew *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithDescriptionNisw(descriptionNisw *string) *CircuitsCircuitTerminationsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the circuits circuit terminations list params func (o *CircuitsCircuitTerminationsListParams) WithID(id *string) *CircuitsCircuitTerminationsListParams { o.SetID(id) @@ -930,6 +1084,193 @@ func (o *CircuitsCircuitTerminationsListParams) WriteToRequest(r runtime.ClientR } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go index b845f2568..00a3bd8d9 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuit_types_list_parameters.go @@ -84,6 +84,39 @@ type CircuitsCircuitTypesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -192,6 +225,12 @@ type CircuitsCircuitTypesListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -278,6 +317,127 @@ func (o *CircuitsCircuitTypesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescription(description *string) *CircuitsCircuitTypesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionEmpty(descriptionEmpty *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionIc(descriptionIc *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionIe(descriptionIe *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionIew(descriptionIew *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionIsw(descriptionIsw *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionn(descriptionn *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionNic(descriptionNic *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionNie(descriptionNie *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionNiew(descriptionNiew *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithDescriptionNisw(descriptionNisw *string) *CircuitsCircuitTypesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the circuits circuit types list params func (o *CircuitsCircuitTypesListParams) WithID(id *string) *CircuitsCircuitTypesListParams { o.SetID(id) @@ -652,6 +812,28 @@ func (o *CircuitsCircuitTypesListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithTag(tag *string) *CircuitsCircuitTypesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithTagn(tagn *string) *CircuitsCircuitTypesListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *CircuitsCircuitTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -711,6 +893,193 @@ func (o *CircuitsCircuitTypesListParams) WriteToRequest(r runtime.ClientRequest, } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id @@ -1289,6 +1658,40 @@ func (o *CircuitsCircuitTypesListParams) WriteToRequest(r runtime.ClientRequest, } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go index 427c4a24b..5dc843408 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_circuits_list_parameters.go @@ -126,6 +126,18 @@ type CircuitsCircuitsListParams struct { // CommitRaten. CommitRaten *string + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -135,6 +147,39 @@ type CircuitsCircuitsListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -537,6 +582,50 @@ func (o *CircuitsCircuitsListParams) SetCommitRaten(commitRaten *string) { o.CommitRaten = commitRaten } +// WithContact adds the contact to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithContact(contact *string) *CircuitsCircuitsListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithContactn(contactn *string) *CircuitsCircuitsListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithContactRole(contactRole *string) *CircuitsCircuitsListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithContactRolen(contactRolen *string) *CircuitsCircuitsListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the circuits circuits list params func (o *CircuitsCircuitsListParams) WithCreated(created *string) *CircuitsCircuitsListParams { o.SetCreated(created) @@ -570,6 +659,127 @@ func (o *CircuitsCircuitsListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescription(description *string) *CircuitsCircuitsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionEmpty(descriptionEmpty *string) *CircuitsCircuitsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionIc(descriptionIc *string) *CircuitsCircuitsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionIe(descriptionIe *string) *CircuitsCircuitsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionIew(descriptionIew *string) *CircuitsCircuitsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionIsw(descriptionIsw *string) *CircuitsCircuitsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionn(descriptionn *string) *CircuitsCircuitsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionNic(descriptionNic *string) *CircuitsCircuitsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionNie(descriptionNie *string) *CircuitsCircuitsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionNiew(descriptionNiew *string) *CircuitsCircuitsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithDescriptionNisw(descriptionNisw *string) *CircuitsCircuitsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the circuits circuits list params func (o *CircuitsCircuitsListParams) WithID(id *string) *CircuitsCircuitsListParams { o.SetID(id) @@ -1439,6 +1649,74 @@ func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg } } + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -1490,6 +1768,193 @@ func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_provider_networks_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_provider_networks_list_parameters.go index 520f2b2c3..3fc16ea89 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_provider_networks_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_provider_networks_list_parameters.go @@ -84,6 +84,39 @@ type CircuitsProviderNetworksListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -263,6 +296,127 @@ func (o *CircuitsProviderNetworksListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescription(description *string) *CircuitsProviderNetworksListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionEmpty(descriptionEmpty *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionIc(descriptionIc *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionIe(descriptionIe *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionIew(descriptionIew *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionIsw(descriptionIsw *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionn(descriptionn *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionNic(descriptionNic *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionNie(descriptionNie *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionNiew(descriptionNiew *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) WithDescriptionNisw(descriptionNisw *string) *CircuitsProviderNetworksListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the circuits provider networks list params +func (o *CircuitsProviderNetworksListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the circuits provider networks list params func (o *CircuitsProviderNetworksListParams) WithID(id *string) *CircuitsProviderNetworksListParams { o.SetID(id) @@ -641,6 +795,193 @@ func (o *CircuitsProviderNetworksListParams) WriteToRequest(r runtime.ClientRequ } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go index bc40499f1..ee9f7c71d 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/circuits/circuits_providers_list_parameters.go @@ -126,6 +126,18 @@ type CircuitsProvidersListParams struct { // Asnn. Asnn *string + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -525,6 +537,50 @@ func (o *CircuitsProvidersListParams) SetAsnn(asnn *string) { o.Asnn = asnn } +// WithContact adds the contact to the circuits providers list params +func (o *CircuitsProvidersListParams) WithContact(contact *string) *CircuitsProvidersListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the circuits providers list params +func (o *CircuitsProvidersListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the circuits providers list params +func (o *CircuitsProvidersListParams) WithContactn(contactn *string) *CircuitsProvidersListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the circuits providers list params +func (o *CircuitsProvidersListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the circuits providers list params +func (o *CircuitsProvidersListParams) WithContactRole(contactRole *string) *CircuitsProvidersListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the circuits providers list params +func (o *CircuitsProvidersListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the circuits providers list params +func (o *CircuitsProvidersListParams) WithContactRolen(contactRolen *string) *CircuitsProvidersListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the circuits providers list params +func (o *CircuitsProvidersListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the circuits providers list params func (o *CircuitsProvidersListParams) WithCreated(created *string) *CircuitsProvidersListParams { o.SetCreated(created) @@ -1383,6 +1439,74 @@ func (o *CircuitsProvidersListParams) WriteToRequest(r runtime.ClientRequest, re } } + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_cables_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_cables_list_parameters.go index 7df677f42..dec086578 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_cables_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_cables_list_parameters.go @@ -222,9 +222,27 @@ type DcimCablesListParams struct { // Tenant. Tenant *string + // Tenantn. + Tenantn *string + + // TenantGroup. + TenantGroup *string + + // TenantGroupn. + TenantGroupn *string + + // TenantGroupID. + TenantGroupID *string + + // TenantGroupIDn. + TenantGroupIDn *string + // TenantID. TenantID *string + // TenantIDn. + TenantIDn *string + // TerminationaID. TerminationaID *string @@ -849,6 +867,61 @@ func (o *DcimCablesListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantn adds the tenantn to the dcim cables list params +func (o *DcimCablesListParams) WithTenantn(tenantn *string) *DcimCablesListParams { + o.SetTenantn(tenantn) + return o +} + +// SetTenantn adds the tenantN to the dcim cables list params +func (o *DcimCablesListParams) SetTenantn(tenantn *string) { + o.Tenantn = tenantn +} + +// WithTenantGroup adds the tenantGroup to the dcim cables list params +func (o *DcimCablesListParams) WithTenantGroup(tenantGroup *string) *DcimCablesListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the dcim cables list params +func (o *DcimCablesListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupn adds the tenantGroupn to the dcim cables list params +func (o *DcimCablesListParams) WithTenantGroupn(tenantGroupn *string) *DcimCablesListParams { + o.SetTenantGroupn(tenantGroupn) + return o +} + +// SetTenantGroupn adds the tenantGroupN to the dcim cables list params +func (o *DcimCablesListParams) SetTenantGroupn(tenantGroupn *string) { + o.TenantGroupn = tenantGroupn +} + +// WithTenantGroupID adds the tenantGroupID to the dcim cables list params +func (o *DcimCablesListParams) WithTenantGroupID(tenantGroupID *string) *DcimCablesListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the dcim cables list params +func (o *DcimCablesListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + +// WithTenantGroupIDn adds the tenantGroupIDn to the dcim cables list params +func (o *DcimCablesListParams) WithTenantGroupIDn(tenantGroupIDn *string) *DcimCablesListParams { + o.SetTenantGroupIDn(tenantGroupIDn) + return o +} + +// SetTenantGroupIDn adds the tenantGroupIdN to the dcim cables list params +func (o *DcimCablesListParams) SetTenantGroupIDn(tenantGroupIDn *string) { + o.TenantGroupIDn = tenantGroupIDn +} + // WithTenantID adds the tenantID to the dcim cables list params func (o *DcimCablesListParams) WithTenantID(tenantID *string) *DcimCablesListParams { o.SetTenantID(tenantID) @@ -860,6 +933,17 @@ func (o *DcimCablesListParams) SetTenantID(tenantID *string) { o.TenantID = tenantID } +// WithTenantIDn adds the tenantIDn to the dcim cables list params +func (o *DcimCablesListParams) WithTenantIDn(tenantIDn *string) *DcimCablesListParams { + o.SetTenantIDn(tenantIDn) + return o +} + +// SetTenantIDn adds the tenantIdN to the dcim cables list params +func (o *DcimCablesListParams) SetTenantIDn(tenantIDn *string) { + o.TenantIDn = tenantIDn +} + // WithTerminationaID adds the terminationaID to the dcim cables list params func (o *DcimCablesListParams) WithTerminationaID(terminationaID *string) *DcimCablesListParams { o.SetTerminationaID(terminationaID) @@ -1865,6 +1949,91 @@ func (o *DcimCablesListParams) WriteToRequest(r runtime.ClientRequest, reg strfm } } + if o.Tenantn != nil { + + // query param tenant__n + var qrTenantn string + + if o.Tenantn != nil { + qrTenantn = *o.Tenantn + } + qTenantn := qrTenantn + if qTenantn != "" { + + if err := r.SetQueryParam("tenant__n", qTenantn); err != nil { + return err + } + } + } + + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + } + + if o.TenantGroupn != nil { + + // query param tenant_group__n + var qrTenantGroupn string + + if o.TenantGroupn != nil { + qrTenantGroupn = *o.TenantGroupn + } + qTenantGroupn := qrTenantGroupn + if qTenantGroupn != "" { + + if err := r.SetQueryParam("tenant_group__n", qTenantGroupn); err != nil { + return err + } + } + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + } + + if o.TenantGroupIDn != nil { + + // query param tenant_group_id__n + var qrTenantGroupIDn string + + if o.TenantGroupIDn != nil { + qrTenantGroupIDn = *o.TenantGroupIDn + } + qTenantGroupIDn := qrTenantGroupIDn + if qTenantGroupIDn != "" { + + if err := r.SetQueryParam("tenant_group_id__n", qTenantGroupIDn); err != nil { + return err + } + } + } + if o.TenantID != nil { // query param tenant_id @@ -1882,6 +2051,23 @@ func (o *DcimCablesListParams) WriteToRequest(r runtime.ClientRequest, reg strfm } } + if o.TenantIDn != nil { + + // query param tenant_id__n + var qrTenantIDn string + + if o.TenantIDn != nil { + qrTenantIDn = *o.TenantIDn + } + qTenantIDn := qrTenantIDn + if qTenantIDn != "" { + + if err := r.SetQueryParam("tenant_id__n", qTenantIDn); err != nil { + return err + } + } + } + if o.TerminationaID != nil { // query param termination_a_id diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go index c63708c06..b41627142 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_roles_list_parameters.go @@ -117,6 +117,39 @@ type DcimDeviceRolesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -225,6 +258,12 @@ type DcimDeviceRolesListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + // VMRole. VMRole *string @@ -435,6 +474,127 @@ func (o *DcimDeviceRolesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescription(description *string) *DcimDeviceRolesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionEmpty(descriptionEmpty *string) *DcimDeviceRolesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionIc(descriptionIc *string) *DcimDeviceRolesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionIe(descriptionIe *string) *DcimDeviceRolesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionIew(descriptionIew *string) *DcimDeviceRolesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionIsw(descriptionIsw *string) *DcimDeviceRolesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionn(descriptionn *string) *DcimDeviceRolesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionNic(descriptionNic *string) *DcimDeviceRolesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionNie(descriptionNie *string) *DcimDeviceRolesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionNiew(descriptionNiew *string) *DcimDeviceRolesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithDescriptionNisw(descriptionNisw *string) *DcimDeviceRolesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the dcim device roles list params func (o *DcimDeviceRolesListParams) WithID(id *string) *DcimDeviceRolesListParams { o.SetID(id) @@ -809,6 +969,28 @@ func (o *DcimDeviceRolesListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithTag(tag *string) *DcimDeviceRolesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithTagn(tagn *string) *DcimDeviceRolesListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WithVMRole adds the vMRole to the dcim device roles list params func (o *DcimDeviceRolesListParams) WithVMRole(vMRole *string) *DcimDeviceRolesListParams { o.SetVMRole(vMRole) @@ -1066,6 +1248,193 @@ func (o *DcimDeviceRolesListParams) WriteToRequest(r runtime.ClientRequest, reg } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id @@ -1644,6 +2013,40 @@ func (o *DcimDeviceRolesListParams) WriteToRequest(r runtime.ClientRequest, reg } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if o.VMRole != nil { // query param vm_role diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go index b261929f8..70f044f14 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_device_types_list_parameters.go @@ -75,6 +75,12 @@ func NewDcimDeviceTypesListParamsWithHTTPClient(client *http.Client) *DcimDevice */ type DcimDeviceTypesListParams struct { + // Airflow. + Airflow *string + + // Airflown. + Airflown *string + // ConsolePorts. ConsolePorts *string @@ -344,6 +350,28 @@ func (o *DcimDeviceTypesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAirflow adds the airflow to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithAirflow(airflow *string) *DcimDeviceTypesListParams { + o.SetAirflow(airflow) + return o +} + +// SetAirflow adds the airflow to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetAirflow(airflow *string) { + o.Airflow = airflow +} + +// WithAirflown adds the airflown to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithAirflown(airflown *string) *DcimDeviceTypesListParams { + o.SetAirflown(airflown) + return o +} + +// SetAirflown adds the airflowN to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetAirflown(airflown *string) { + o.Airflown = airflown +} + // WithConsolePorts adds the consolePorts to the dcim device types list params func (o *DcimDeviceTypesListParams) WithConsolePorts(consolePorts *string) *DcimDeviceTypesListParams { o.SetConsolePorts(consolePorts) @@ -1122,6 +1150,40 @@ func (o *DcimDeviceTypesListParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + if o.Airflow != nil { + + // query param airflow + var qrAirflow string + + if o.Airflow != nil { + qrAirflow = *o.Airflow + } + qAirflow := qrAirflow + if qAirflow != "" { + + if err := r.SetQueryParam("airflow", qAirflow); err != nil { + return err + } + } + } + + if o.Airflown != nil { + + // query param airflow__n + var qrAirflown string + + if o.Airflown != nil { + qrAirflown = *o.Airflown + } + qAirflown := qrAirflown + if qAirflown != "" { + + if err := r.SetQueryParam("airflow__n", qAirflown); err != nil { + return err + } + } + } + if o.ConsolePorts != nil { // query param console_ports diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go index ec9f651f6..b81ce4d96 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_devices_list_parameters.go @@ -75,6 +75,12 @@ func NewDcimDevicesListParamsWithHTTPClient(client *http.Client) *DcimDevicesLis */ type DcimDevicesListParams struct { + // Airflow. + Airflow *string + + // Airflown. + Airflown *string + // AssetTag. AssetTag *string @@ -120,6 +126,18 @@ type DcimDevicesListParams struct { // ConsoleServerPorts. ConsoleServerPorts *string + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -282,6 +300,12 @@ type DcimDevicesListParams struct { */ Offset *int64 + // ParentDeviceID. + ParentDeviceID *string + + // ParentDeviceIDn. + ParentDeviceIDn *string + // PassThroughPorts. PassThroughPorts *string @@ -515,6 +539,28 @@ func (o *DcimDevicesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAirflow adds the airflow to the dcim devices list params +func (o *DcimDevicesListParams) WithAirflow(airflow *string) *DcimDevicesListParams { + o.SetAirflow(airflow) + return o +} + +// SetAirflow adds the airflow to the dcim devices list params +func (o *DcimDevicesListParams) SetAirflow(airflow *string) { + o.Airflow = airflow +} + +// WithAirflown adds the airflown to the dcim devices list params +func (o *DcimDevicesListParams) WithAirflown(airflown *string) *DcimDevicesListParams { + o.SetAirflown(airflown) + return o +} + +// SetAirflown adds the airflowN to the dcim devices list params +func (o *DcimDevicesListParams) SetAirflown(airflown *string) { + o.Airflown = airflown +} + // WithAssetTag adds the assetTag to the dcim devices list params func (o *DcimDevicesListParams) WithAssetTag(assetTag *string) *DcimDevicesListParams { o.SetAssetTag(assetTag) @@ -680,6 +726,50 @@ func (o *DcimDevicesListParams) SetConsoleServerPorts(consoleServerPorts *string o.ConsoleServerPorts = consoleServerPorts } +// WithContact adds the contact to the dcim devices list params +func (o *DcimDevicesListParams) WithContact(contact *string) *DcimDevicesListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim devices list params +func (o *DcimDevicesListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim devices list params +func (o *DcimDevicesListParams) WithContactn(contactn *string) *DcimDevicesListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim devices list params +func (o *DcimDevicesListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the dcim devices list params +func (o *DcimDevicesListParams) WithContactRole(contactRole *string) *DcimDevicesListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim devices list params +func (o *DcimDevicesListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim devices list params +func (o *DcimDevicesListParams) WithContactRolen(contactRolen *string) *DcimDevicesListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim devices list params +func (o *DcimDevicesListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim devices list params func (o *DcimDevicesListParams) WithCreated(created *string) *DcimDevicesListParams { o.SetCreated(created) @@ -1252,6 +1342,28 @@ func (o *DcimDevicesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithParentDeviceID adds the parentDeviceID to the dcim devices list params +func (o *DcimDevicesListParams) WithParentDeviceID(parentDeviceID *string) *DcimDevicesListParams { + o.SetParentDeviceID(parentDeviceID) + return o +} + +// SetParentDeviceID adds the parentDeviceId to the dcim devices list params +func (o *DcimDevicesListParams) SetParentDeviceID(parentDeviceID *string) { + o.ParentDeviceID = parentDeviceID +} + +// WithParentDeviceIDn adds the parentDeviceIDn to the dcim devices list params +func (o *DcimDevicesListParams) WithParentDeviceIDn(parentDeviceIDn *string) *DcimDevicesListParams { + o.SetParentDeviceIDn(parentDeviceIDn) + return o +} + +// SetParentDeviceIDn adds the parentDeviceIdN to the dcim devices list params +func (o *DcimDevicesListParams) SetParentDeviceIDn(parentDeviceIDn *string) { + o.ParentDeviceIDn = parentDeviceIDn +} + // WithPassThroughPorts adds the passThroughPorts to the dcim devices list params func (o *DcimDevicesListParams) WithPassThroughPorts(passThroughPorts *string) *DcimDevicesListParams { o.SetPassThroughPorts(passThroughPorts) @@ -1920,6 +2032,40 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error + if o.Airflow != nil { + + // query param airflow + var qrAirflow string + + if o.Airflow != nil { + qrAirflow = *o.Airflow + } + qAirflow := qrAirflow + if qAirflow != "" { + + if err := r.SetQueryParam("airflow", qAirflow); err != nil { + return err + } + } + } + + if o.Airflown != nil { + + // query param airflow__n + var qrAirflown string + + if o.Airflown != nil { + qrAirflown = *o.Airflown + } + qAirflown := qrAirflown + if qAirflown != "" { + + if err := r.SetQueryParam("airflow__n", qAirflown); err != nil { + return err + } + } + } + if o.AssetTag != nil { // query param asset_tag @@ -2175,6 +2321,74 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } } + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -3059,6 +3273,40 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } } + if o.ParentDeviceID != nil { + + // query param parent_device_id + var qrParentDeviceID string + + if o.ParentDeviceID != nil { + qrParentDeviceID = *o.ParentDeviceID + } + qParentDeviceID := qrParentDeviceID + if qParentDeviceID != "" { + + if err := r.SetQueryParam("parent_device_id", qParentDeviceID); err != nil { + return err + } + } + } + + if o.ParentDeviceIDn != nil { + + // query param parent_device_id__n + var qrParentDeviceIDn string + + if o.ParentDeviceIDn != nil { + qrParentDeviceIDn = *o.ParentDeviceIDn + } + qParentDeviceIDn := qrParentDeviceIDn + if qParentDeviceIDn != "" { + + if err := r.SetQueryParam("parent_device_id__n", qParentDeviceIDn); err != nil { + return err + } + } + } + if o.PassThroughPorts != nil { // query param pass_through_ports diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go index ca1a4d88d..32f26788b 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_interfaces_list_parameters.go @@ -75,6 +75,12 @@ func NewDcimInterfacesListParamsWithHTTPClient(client *http.Client) *DcimInterfa */ type DcimInterfacesListParams struct { + // BridgeID. + BridgeID *string + + // BridgeIDn. + BridgeIDn *string + // Cabled. Cabled *string @@ -336,6 +342,54 @@ type DcimInterfacesListParams struct { // RegionIDn. RegionIDn *string + // RfChannel. + RfChannel *string + + // RfChanneln. + RfChanneln *string + + // RfChannelFrequency. + RfChannelFrequency *string + + // RfChannelFrequencyGt. + RfChannelFrequencyGt *string + + // RfChannelFrequencyGte. + RfChannelFrequencyGte *string + + // RfChannelFrequencyLt. + RfChannelFrequencyLt *string + + // RfChannelFrequencyLte. + RfChannelFrequencyLte *string + + // RfChannelFrequencyn. + RfChannelFrequencyn *string + + // RfChannelWidth. + RfChannelWidth *string + + // RfChannelWidthGt. + RfChannelWidthGt *string + + // RfChannelWidthGte. + RfChannelWidthGte *string + + // RfChannelWidthLt. + RfChannelWidthLt *string + + // RfChannelWidthLte. + RfChannelWidthLte *string + + // RfChannelWidthn. + RfChannelWidthn *string + + // RfRole. + RfRole *string + + // RfRolen. + RfRolen *string + // Site. Site *string @@ -366,6 +420,24 @@ type DcimInterfacesListParams struct { // Tagn. Tagn *string + // TxPower. + TxPower *string + + // TxPowerGt. + TxPowerGt *string + + // TxPowerGte. + TxPowerGte *string + + // TxPowerLt. + TxPowerLt *string + + // TxPowerLte. + TxPowerLte *string + + // TxPowern. + TxPowern *string + // Type. Type *string @@ -390,6 +462,36 @@ type DcimInterfacesListParams struct { // VlanID. VlanID *string + // Wwn. + Wwn *string + + // WwnIc. + WwnIc *string + + // WwnIe. + WwnIe *string + + // WwnIew. + WwnIew *string + + // WwnIsw. + WwnIsw *string + + // Wwnn. + Wwnn *string + + // WwnNic. + WwnNic *string + + // WwnNie. + WwnNie *string + + // WwnNiew. + WwnNiew *string + + // WwnNisw. + WwnNisw *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -443,6 +545,28 @@ func (o *DcimInterfacesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithBridgeID adds the bridgeID to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithBridgeID(bridgeID *string) *DcimInterfacesListParams { + o.SetBridgeID(bridgeID) + return o +} + +// SetBridgeID adds the bridgeId to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetBridgeID(bridgeID *string) { + o.BridgeID = bridgeID +} + +// WithBridgeIDn adds the bridgeIDn to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithBridgeIDn(bridgeIDn *string) *DcimInterfacesListParams { + o.SetBridgeIDn(bridgeIDn) + return o +} + +// SetBridgeIDn adds the bridgeIdN to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetBridgeIDn(bridgeIDn *string) { + o.BridgeIDn = bridgeIDn +} + // WithCabled adds the cabled to the dcim interfaces list params func (o *DcimInterfacesListParams) WithCabled(cabled *string) *DcimInterfacesListParams { o.SetCabled(cabled) @@ -1378,6 +1502,182 @@ func (o *DcimInterfacesListParams) SetRegionIDn(regionIDn *string) { o.RegionIDn = regionIDn } +// WithRfChannel adds the rfChannel to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannel(rfChannel *string) *DcimInterfacesListParams { + o.SetRfChannel(rfChannel) + return o +} + +// SetRfChannel adds the rfChannel to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannel(rfChannel *string) { + o.RfChannel = rfChannel +} + +// WithRfChanneln adds the rfChanneln to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChanneln(rfChanneln *string) *DcimInterfacesListParams { + o.SetRfChanneln(rfChanneln) + return o +} + +// SetRfChanneln adds the rfChannelN to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChanneln(rfChanneln *string) { + o.RfChanneln = rfChanneln +} + +// WithRfChannelFrequency adds the rfChannelFrequency to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelFrequency(rfChannelFrequency *string) *DcimInterfacesListParams { + o.SetRfChannelFrequency(rfChannelFrequency) + return o +} + +// SetRfChannelFrequency adds the rfChannelFrequency to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelFrequency(rfChannelFrequency *string) { + o.RfChannelFrequency = rfChannelFrequency +} + +// WithRfChannelFrequencyGt adds the rfChannelFrequencyGt to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelFrequencyGt(rfChannelFrequencyGt *string) *DcimInterfacesListParams { + o.SetRfChannelFrequencyGt(rfChannelFrequencyGt) + return o +} + +// SetRfChannelFrequencyGt adds the rfChannelFrequencyGt to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelFrequencyGt(rfChannelFrequencyGt *string) { + o.RfChannelFrequencyGt = rfChannelFrequencyGt +} + +// WithRfChannelFrequencyGte adds the rfChannelFrequencyGte to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelFrequencyGte(rfChannelFrequencyGte *string) *DcimInterfacesListParams { + o.SetRfChannelFrequencyGte(rfChannelFrequencyGte) + return o +} + +// SetRfChannelFrequencyGte adds the rfChannelFrequencyGte to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelFrequencyGte(rfChannelFrequencyGte *string) { + o.RfChannelFrequencyGte = rfChannelFrequencyGte +} + +// WithRfChannelFrequencyLt adds the rfChannelFrequencyLt to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelFrequencyLt(rfChannelFrequencyLt *string) *DcimInterfacesListParams { + o.SetRfChannelFrequencyLt(rfChannelFrequencyLt) + return o +} + +// SetRfChannelFrequencyLt adds the rfChannelFrequencyLt to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelFrequencyLt(rfChannelFrequencyLt *string) { + o.RfChannelFrequencyLt = rfChannelFrequencyLt +} + +// WithRfChannelFrequencyLte adds the rfChannelFrequencyLte to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelFrequencyLte(rfChannelFrequencyLte *string) *DcimInterfacesListParams { + o.SetRfChannelFrequencyLte(rfChannelFrequencyLte) + return o +} + +// SetRfChannelFrequencyLte adds the rfChannelFrequencyLte to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelFrequencyLte(rfChannelFrequencyLte *string) { + o.RfChannelFrequencyLte = rfChannelFrequencyLte +} + +// WithRfChannelFrequencyn adds the rfChannelFrequencyn to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelFrequencyn(rfChannelFrequencyn *string) *DcimInterfacesListParams { + o.SetRfChannelFrequencyn(rfChannelFrequencyn) + return o +} + +// SetRfChannelFrequencyn adds the rfChannelFrequencyN to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelFrequencyn(rfChannelFrequencyn *string) { + o.RfChannelFrequencyn = rfChannelFrequencyn +} + +// WithRfChannelWidth adds the rfChannelWidth to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelWidth(rfChannelWidth *string) *DcimInterfacesListParams { + o.SetRfChannelWidth(rfChannelWidth) + return o +} + +// SetRfChannelWidth adds the rfChannelWidth to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelWidth(rfChannelWidth *string) { + o.RfChannelWidth = rfChannelWidth +} + +// WithRfChannelWidthGt adds the rfChannelWidthGt to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelWidthGt(rfChannelWidthGt *string) *DcimInterfacesListParams { + o.SetRfChannelWidthGt(rfChannelWidthGt) + return o +} + +// SetRfChannelWidthGt adds the rfChannelWidthGt to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelWidthGt(rfChannelWidthGt *string) { + o.RfChannelWidthGt = rfChannelWidthGt +} + +// WithRfChannelWidthGte adds the rfChannelWidthGte to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelWidthGte(rfChannelWidthGte *string) *DcimInterfacesListParams { + o.SetRfChannelWidthGte(rfChannelWidthGte) + return o +} + +// SetRfChannelWidthGte adds the rfChannelWidthGte to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelWidthGte(rfChannelWidthGte *string) { + o.RfChannelWidthGte = rfChannelWidthGte +} + +// WithRfChannelWidthLt adds the rfChannelWidthLt to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelWidthLt(rfChannelWidthLt *string) *DcimInterfacesListParams { + o.SetRfChannelWidthLt(rfChannelWidthLt) + return o +} + +// SetRfChannelWidthLt adds the rfChannelWidthLt to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelWidthLt(rfChannelWidthLt *string) { + o.RfChannelWidthLt = rfChannelWidthLt +} + +// WithRfChannelWidthLte adds the rfChannelWidthLte to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelWidthLte(rfChannelWidthLte *string) *DcimInterfacesListParams { + o.SetRfChannelWidthLte(rfChannelWidthLte) + return o +} + +// SetRfChannelWidthLte adds the rfChannelWidthLte to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelWidthLte(rfChannelWidthLte *string) { + o.RfChannelWidthLte = rfChannelWidthLte +} + +// WithRfChannelWidthn adds the rfChannelWidthn to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfChannelWidthn(rfChannelWidthn *string) *DcimInterfacesListParams { + o.SetRfChannelWidthn(rfChannelWidthn) + return o +} + +// SetRfChannelWidthn adds the rfChannelWidthN to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfChannelWidthn(rfChannelWidthn *string) { + o.RfChannelWidthn = rfChannelWidthn +} + +// WithRfRole adds the rfRole to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfRole(rfRole *string) *DcimInterfacesListParams { + o.SetRfRole(rfRole) + return o +} + +// SetRfRole adds the rfRole to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfRole(rfRole *string) { + o.RfRole = rfRole +} + +// WithRfRolen adds the rfRolen to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithRfRolen(rfRolen *string) *DcimInterfacesListParams { + o.SetRfRolen(rfRolen) + return o +} + +// SetRfRolen adds the rfRoleN to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetRfRolen(rfRolen *string) { + o.RfRolen = rfRolen +} + // WithSite adds the site to the dcim interfaces list params func (o *DcimInterfacesListParams) WithSite(site *string) *DcimInterfacesListParams { o.SetSite(site) @@ -1488,6 +1788,72 @@ func (o *DcimInterfacesListParams) SetTagn(tagn *string) { o.Tagn = tagn } +// WithTxPower adds the txPower to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTxPower(txPower *string) *DcimInterfacesListParams { + o.SetTxPower(txPower) + return o +} + +// SetTxPower adds the txPower to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTxPower(txPower *string) { + o.TxPower = txPower +} + +// WithTxPowerGt adds the txPowerGt to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTxPowerGt(txPowerGt *string) *DcimInterfacesListParams { + o.SetTxPowerGt(txPowerGt) + return o +} + +// SetTxPowerGt adds the txPowerGt to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTxPowerGt(txPowerGt *string) { + o.TxPowerGt = txPowerGt +} + +// WithTxPowerGte adds the txPowerGte to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTxPowerGte(txPowerGte *string) *DcimInterfacesListParams { + o.SetTxPowerGte(txPowerGte) + return o +} + +// SetTxPowerGte adds the txPowerGte to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTxPowerGte(txPowerGte *string) { + o.TxPowerGte = txPowerGte +} + +// WithTxPowerLt adds the txPowerLt to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTxPowerLt(txPowerLt *string) *DcimInterfacesListParams { + o.SetTxPowerLt(txPowerLt) + return o +} + +// SetTxPowerLt adds the txPowerLt to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTxPowerLt(txPowerLt *string) { + o.TxPowerLt = txPowerLt +} + +// WithTxPowerLte adds the txPowerLte to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTxPowerLte(txPowerLte *string) *DcimInterfacesListParams { + o.SetTxPowerLte(txPowerLte) + return o +} + +// SetTxPowerLte adds the txPowerLte to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTxPowerLte(txPowerLte *string) { + o.TxPowerLte = txPowerLte +} + +// WithTxPowern adds the txPowern to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTxPowern(txPowern *string) *DcimInterfacesListParams { + o.SetTxPowern(txPowern) + return o +} + +// SetTxPowern adds the txPowerN to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTxPowern(txPowern *string) { + o.TxPowern = txPowern +} + // WithType adds the typeVar to the dcim interfaces list params func (o *DcimInterfacesListParams) WithType(typeVar *string) *DcimInterfacesListParams { o.SetType(typeVar) @@ -1576,6 +1942,116 @@ func (o *DcimInterfacesListParams) SetVlanID(vlanID *string) { o.VlanID = vlanID } +// WithWwn adds the wwn to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwn(wwn *string) *DcimInterfacesListParams { + o.SetWwn(wwn) + return o +} + +// SetWwn adds the wwn to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwn(wwn *string) { + o.Wwn = wwn +} + +// WithWwnIc adds the wwnIc to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnIc(wwnIc *string) *DcimInterfacesListParams { + o.SetWwnIc(wwnIc) + return o +} + +// SetWwnIc adds the wwnIc to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnIc(wwnIc *string) { + o.WwnIc = wwnIc +} + +// WithWwnIe adds the wwnIe to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnIe(wwnIe *string) *DcimInterfacesListParams { + o.SetWwnIe(wwnIe) + return o +} + +// SetWwnIe adds the wwnIe to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnIe(wwnIe *string) { + o.WwnIe = wwnIe +} + +// WithWwnIew adds the wwnIew to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnIew(wwnIew *string) *DcimInterfacesListParams { + o.SetWwnIew(wwnIew) + return o +} + +// SetWwnIew adds the wwnIew to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnIew(wwnIew *string) { + o.WwnIew = wwnIew +} + +// WithWwnIsw adds the wwnIsw to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnIsw(wwnIsw *string) *DcimInterfacesListParams { + o.SetWwnIsw(wwnIsw) + return o +} + +// SetWwnIsw adds the wwnIsw to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnIsw(wwnIsw *string) { + o.WwnIsw = wwnIsw +} + +// WithWwnn adds the wwnn to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnn(wwnn *string) *DcimInterfacesListParams { + o.SetWwnn(wwnn) + return o +} + +// SetWwnn adds the wwnN to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnn(wwnn *string) { + o.Wwnn = wwnn +} + +// WithWwnNic adds the wwnNic to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnNic(wwnNic *string) *DcimInterfacesListParams { + o.SetWwnNic(wwnNic) + return o +} + +// SetWwnNic adds the wwnNic to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnNic(wwnNic *string) { + o.WwnNic = wwnNic +} + +// WithWwnNie adds the wwnNie to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnNie(wwnNie *string) *DcimInterfacesListParams { + o.SetWwnNie(wwnNie) + return o +} + +// SetWwnNie adds the wwnNie to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnNie(wwnNie *string) { + o.WwnNie = wwnNie +} + +// WithWwnNiew adds the wwnNiew to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnNiew(wwnNiew *string) *DcimInterfacesListParams { + o.SetWwnNiew(wwnNiew) + return o +} + +// SetWwnNiew adds the wwnNiew to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnNiew(wwnNiew *string) { + o.WwnNiew = wwnNiew +} + +// WithWwnNisw adds the wwnNisw to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithWwnNisw(wwnNisw *string) *DcimInterfacesListParams { + o.SetWwnNisw(wwnNisw) + return o +} + +// SetWwnNisw adds the wwnNisw to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetWwnNisw(wwnNisw *string) { + o.WwnNisw = wwnNisw +} + // WriteToRequest writes these params to a swagger request func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -1584,6 +2060,40 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.BridgeID != nil { + + // query param bridge_id + var qrBridgeID string + + if o.BridgeID != nil { + qrBridgeID = *o.BridgeID + } + qBridgeID := qrBridgeID + if qBridgeID != "" { + + if err := r.SetQueryParam("bridge_id", qBridgeID); err != nil { + return err + } + } + } + + if o.BridgeIDn != nil { + + // query param bridge_id__n + var qrBridgeIDn string + + if o.BridgeIDn != nil { + qrBridgeIDn = *o.BridgeIDn + } + qBridgeIDn := qrBridgeIDn + if qBridgeIDn != "" { + + if err := r.SetQueryParam("bridge_id__n", qBridgeIDn); err != nil { + return err + } + } + } + if o.Cabled != nil { // query param cabled @@ -3029,6 +3539,278 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } } + if o.RfChannel != nil { + + // query param rf_channel + var qrRfChannel string + + if o.RfChannel != nil { + qrRfChannel = *o.RfChannel + } + qRfChannel := qrRfChannel + if qRfChannel != "" { + + if err := r.SetQueryParam("rf_channel", qRfChannel); err != nil { + return err + } + } + } + + if o.RfChanneln != nil { + + // query param rf_channel__n + var qrRfChanneln string + + if o.RfChanneln != nil { + qrRfChanneln = *o.RfChanneln + } + qRfChanneln := qrRfChanneln + if qRfChanneln != "" { + + if err := r.SetQueryParam("rf_channel__n", qRfChanneln); err != nil { + return err + } + } + } + + if o.RfChannelFrequency != nil { + + // query param rf_channel_frequency + var qrRfChannelFrequency string + + if o.RfChannelFrequency != nil { + qrRfChannelFrequency = *o.RfChannelFrequency + } + qRfChannelFrequency := qrRfChannelFrequency + if qRfChannelFrequency != "" { + + if err := r.SetQueryParam("rf_channel_frequency", qRfChannelFrequency); err != nil { + return err + } + } + } + + if o.RfChannelFrequencyGt != nil { + + // query param rf_channel_frequency__gt + var qrRfChannelFrequencyGt string + + if o.RfChannelFrequencyGt != nil { + qrRfChannelFrequencyGt = *o.RfChannelFrequencyGt + } + qRfChannelFrequencyGt := qrRfChannelFrequencyGt + if qRfChannelFrequencyGt != "" { + + if err := r.SetQueryParam("rf_channel_frequency__gt", qRfChannelFrequencyGt); err != nil { + return err + } + } + } + + if o.RfChannelFrequencyGte != nil { + + // query param rf_channel_frequency__gte + var qrRfChannelFrequencyGte string + + if o.RfChannelFrequencyGte != nil { + qrRfChannelFrequencyGte = *o.RfChannelFrequencyGte + } + qRfChannelFrequencyGte := qrRfChannelFrequencyGte + if qRfChannelFrequencyGte != "" { + + if err := r.SetQueryParam("rf_channel_frequency__gte", qRfChannelFrequencyGte); err != nil { + return err + } + } + } + + if o.RfChannelFrequencyLt != nil { + + // query param rf_channel_frequency__lt + var qrRfChannelFrequencyLt string + + if o.RfChannelFrequencyLt != nil { + qrRfChannelFrequencyLt = *o.RfChannelFrequencyLt + } + qRfChannelFrequencyLt := qrRfChannelFrequencyLt + if qRfChannelFrequencyLt != "" { + + if err := r.SetQueryParam("rf_channel_frequency__lt", qRfChannelFrequencyLt); err != nil { + return err + } + } + } + + if o.RfChannelFrequencyLte != nil { + + // query param rf_channel_frequency__lte + var qrRfChannelFrequencyLte string + + if o.RfChannelFrequencyLte != nil { + qrRfChannelFrequencyLte = *o.RfChannelFrequencyLte + } + qRfChannelFrequencyLte := qrRfChannelFrequencyLte + if qRfChannelFrequencyLte != "" { + + if err := r.SetQueryParam("rf_channel_frequency__lte", qRfChannelFrequencyLte); err != nil { + return err + } + } + } + + if o.RfChannelFrequencyn != nil { + + // query param rf_channel_frequency__n + var qrRfChannelFrequencyn string + + if o.RfChannelFrequencyn != nil { + qrRfChannelFrequencyn = *o.RfChannelFrequencyn + } + qRfChannelFrequencyn := qrRfChannelFrequencyn + if qRfChannelFrequencyn != "" { + + if err := r.SetQueryParam("rf_channel_frequency__n", qRfChannelFrequencyn); err != nil { + return err + } + } + } + + if o.RfChannelWidth != nil { + + // query param rf_channel_width + var qrRfChannelWidth string + + if o.RfChannelWidth != nil { + qrRfChannelWidth = *o.RfChannelWidth + } + qRfChannelWidth := qrRfChannelWidth + if qRfChannelWidth != "" { + + if err := r.SetQueryParam("rf_channel_width", qRfChannelWidth); err != nil { + return err + } + } + } + + if o.RfChannelWidthGt != nil { + + // query param rf_channel_width__gt + var qrRfChannelWidthGt string + + if o.RfChannelWidthGt != nil { + qrRfChannelWidthGt = *o.RfChannelWidthGt + } + qRfChannelWidthGt := qrRfChannelWidthGt + if qRfChannelWidthGt != "" { + + if err := r.SetQueryParam("rf_channel_width__gt", qRfChannelWidthGt); err != nil { + return err + } + } + } + + if o.RfChannelWidthGte != nil { + + // query param rf_channel_width__gte + var qrRfChannelWidthGte string + + if o.RfChannelWidthGte != nil { + qrRfChannelWidthGte = *o.RfChannelWidthGte + } + qRfChannelWidthGte := qrRfChannelWidthGte + if qRfChannelWidthGte != "" { + + if err := r.SetQueryParam("rf_channel_width__gte", qRfChannelWidthGte); err != nil { + return err + } + } + } + + if o.RfChannelWidthLt != nil { + + // query param rf_channel_width__lt + var qrRfChannelWidthLt string + + if o.RfChannelWidthLt != nil { + qrRfChannelWidthLt = *o.RfChannelWidthLt + } + qRfChannelWidthLt := qrRfChannelWidthLt + if qRfChannelWidthLt != "" { + + if err := r.SetQueryParam("rf_channel_width__lt", qRfChannelWidthLt); err != nil { + return err + } + } + } + + if o.RfChannelWidthLte != nil { + + // query param rf_channel_width__lte + var qrRfChannelWidthLte string + + if o.RfChannelWidthLte != nil { + qrRfChannelWidthLte = *o.RfChannelWidthLte + } + qRfChannelWidthLte := qrRfChannelWidthLte + if qRfChannelWidthLte != "" { + + if err := r.SetQueryParam("rf_channel_width__lte", qRfChannelWidthLte); err != nil { + return err + } + } + } + + if o.RfChannelWidthn != nil { + + // query param rf_channel_width__n + var qrRfChannelWidthn string + + if o.RfChannelWidthn != nil { + qrRfChannelWidthn = *o.RfChannelWidthn + } + qRfChannelWidthn := qrRfChannelWidthn + if qRfChannelWidthn != "" { + + if err := r.SetQueryParam("rf_channel_width__n", qRfChannelWidthn); err != nil { + return err + } + } + } + + if o.RfRole != nil { + + // query param rf_role + var qrRfRole string + + if o.RfRole != nil { + qrRfRole = *o.RfRole + } + qRfRole := qrRfRole + if qRfRole != "" { + + if err := r.SetQueryParam("rf_role", qRfRole); err != nil { + return err + } + } + } + + if o.RfRolen != nil { + + // query param rf_role__n + var qrRfRolen string + + if o.RfRolen != nil { + qrRfRolen = *o.RfRolen + } + qRfRolen := qrRfRolen + if qRfRolen != "" { + + if err := r.SetQueryParam("rf_role__n", qRfRolen); err != nil { + return err + } + } + } + if o.Site != nil { // query param site @@ -3199,6 +3981,108 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } } + if o.TxPower != nil { + + // query param tx_power + var qrTxPower string + + if o.TxPower != nil { + qrTxPower = *o.TxPower + } + qTxPower := qrTxPower + if qTxPower != "" { + + if err := r.SetQueryParam("tx_power", qTxPower); err != nil { + return err + } + } + } + + if o.TxPowerGt != nil { + + // query param tx_power__gt + var qrTxPowerGt string + + if o.TxPowerGt != nil { + qrTxPowerGt = *o.TxPowerGt + } + qTxPowerGt := qrTxPowerGt + if qTxPowerGt != "" { + + if err := r.SetQueryParam("tx_power__gt", qTxPowerGt); err != nil { + return err + } + } + } + + if o.TxPowerGte != nil { + + // query param tx_power__gte + var qrTxPowerGte string + + if o.TxPowerGte != nil { + qrTxPowerGte = *o.TxPowerGte + } + qTxPowerGte := qrTxPowerGte + if qTxPowerGte != "" { + + if err := r.SetQueryParam("tx_power__gte", qTxPowerGte); err != nil { + return err + } + } + } + + if o.TxPowerLt != nil { + + // query param tx_power__lt + var qrTxPowerLt string + + if o.TxPowerLt != nil { + qrTxPowerLt = *o.TxPowerLt + } + qTxPowerLt := qrTxPowerLt + if qTxPowerLt != "" { + + if err := r.SetQueryParam("tx_power__lt", qTxPowerLt); err != nil { + return err + } + } + } + + if o.TxPowerLte != nil { + + // query param tx_power__lte + var qrTxPowerLte string + + if o.TxPowerLte != nil { + qrTxPowerLte = *o.TxPowerLte + } + qTxPowerLte := qrTxPowerLte + if qTxPowerLte != "" { + + if err := r.SetQueryParam("tx_power__lte", qTxPowerLte); err != nil { + return err + } + } + } + + if o.TxPowern != nil { + + // query param tx_power__n + var qrTxPowern string + + if o.TxPowern != nil { + qrTxPowern = *o.TxPowern + } + qTxPowern := qrTxPowern + if qTxPowern != "" { + + if err := r.SetQueryParam("tx_power__n", qTxPowern); err != nil { + return err + } + } + } + if o.Type != nil { // query param type @@ -3335,6 +4219,176 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } } + if o.Wwn != nil { + + // query param wwn + var qrWwn string + + if o.Wwn != nil { + qrWwn = *o.Wwn + } + qWwn := qrWwn + if qWwn != "" { + + if err := r.SetQueryParam("wwn", qWwn); err != nil { + return err + } + } + } + + if o.WwnIc != nil { + + // query param wwn__ic + var qrWwnIc string + + if o.WwnIc != nil { + qrWwnIc = *o.WwnIc + } + qWwnIc := qrWwnIc + if qWwnIc != "" { + + if err := r.SetQueryParam("wwn__ic", qWwnIc); err != nil { + return err + } + } + } + + if o.WwnIe != nil { + + // query param wwn__ie + var qrWwnIe string + + if o.WwnIe != nil { + qrWwnIe = *o.WwnIe + } + qWwnIe := qrWwnIe + if qWwnIe != "" { + + if err := r.SetQueryParam("wwn__ie", qWwnIe); err != nil { + return err + } + } + } + + if o.WwnIew != nil { + + // query param wwn__iew + var qrWwnIew string + + if o.WwnIew != nil { + qrWwnIew = *o.WwnIew + } + qWwnIew := qrWwnIew + if qWwnIew != "" { + + if err := r.SetQueryParam("wwn__iew", qWwnIew); err != nil { + return err + } + } + } + + if o.WwnIsw != nil { + + // query param wwn__isw + var qrWwnIsw string + + if o.WwnIsw != nil { + qrWwnIsw = *o.WwnIsw + } + qWwnIsw := qrWwnIsw + if qWwnIsw != "" { + + if err := r.SetQueryParam("wwn__isw", qWwnIsw); err != nil { + return err + } + } + } + + if o.Wwnn != nil { + + // query param wwn__n + var qrWwnn string + + if o.Wwnn != nil { + qrWwnn = *o.Wwnn + } + qWwnn := qrWwnn + if qWwnn != "" { + + if err := r.SetQueryParam("wwn__n", qWwnn); err != nil { + return err + } + } + } + + if o.WwnNic != nil { + + // query param wwn__nic + var qrWwnNic string + + if o.WwnNic != nil { + qrWwnNic = *o.WwnNic + } + qWwnNic := qrWwnNic + if qWwnNic != "" { + + if err := r.SetQueryParam("wwn__nic", qWwnNic); err != nil { + return err + } + } + } + + if o.WwnNie != nil { + + // query param wwn__nie + var qrWwnNie string + + if o.WwnNie != nil { + qrWwnNie = *o.WwnNie + } + qWwnNie := qrWwnNie + if qWwnNie != "" { + + if err := r.SetQueryParam("wwn__nie", qWwnNie); err != nil { + return err + } + } + } + + if o.WwnNiew != nil { + + // query param wwn__niew + var qrWwnNiew string + + if o.WwnNiew != nil { + qrWwnNiew = *o.WwnNiew + } + qWwnNiew := qrWwnNiew + if qWwnNiew != "" { + + if err := r.SetQueryParam("wwn__niew", qWwnNiew); err != nil { + return err + } + } + } + + if o.WwnNisw != nil { + + // query param wwn__nisw + var qrWwnNisw string + + if o.WwnNisw != nil { + qrWwnNisw = *o.WwnNisw + } + qWwnNisw := qrWwnNisw + if qWwnNisw != "" { + + if err := r.SetQueryParam("wwn__nisw", qWwnNisw); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_locations_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_locations_list_parameters.go index bf0ae72a5..7bec7aefc 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_locations_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_locations_list_parameters.go @@ -75,6 +75,18 @@ func NewDcimLocationsListParamsWithHTTPClient(client *http.Client) *DcimLocation */ type DcimLocationsListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -273,6 +285,36 @@ type DcimLocationsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + + // Tenant. + Tenant *string + + // Tenantn. + Tenantn *string + + // TenantGroup. + TenantGroup *string + + // TenantGroupn. + TenantGroupn *string + + // TenantGroupID. + TenantGroupID *string + + // TenantGroupIDn. + TenantGroupIDn *string + + // TenantID. + TenantID *string + + // TenantIDn. + TenantIDn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -326,6 +368,50 @@ func (o *DcimLocationsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithContact adds the contact to the dcim locations list params +func (o *DcimLocationsListParams) WithContact(contact *string) *DcimLocationsListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim locations list params +func (o *DcimLocationsListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim locations list params +func (o *DcimLocationsListParams) WithContactn(contactn *string) *DcimLocationsListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim locations list params +func (o *DcimLocationsListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the dcim locations list params +func (o *DcimLocationsListParams) WithContactRole(contactRole *string) *DcimLocationsListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim locations list params +func (o *DcimLocationsListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim locations list params +func (o *DcimLocationsListParams) WithContactRolen(contactRolen *string) *DcimLocationsListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim locations list params +func (o *DcimLocationsListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim locations list params func (o *DcimLocationsListParams) WithCreated(created *string) *DcimLocationsListParams { o.SetCreated(created) @@ -1030,6 +1116,116 @@ func (o *DcimLocationsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the dcim locations list params +func (o *DcimLocationsListParams) WithTag(tag *string) *DcimLocationsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim locations list params +func (o *DcimLocationsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the dcim locations list params +func (o *DcimLocationsListParams) WithTagn(tagn *string) *DcimLocationsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the dcim locations list params +func (o *DcimLocationsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WithTenant adds the tenant to the dcim locations list params +func (o *DcimLocationsListParams) WithTenant(tenant *string) *DcimLocationsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim locations list params +func (o *DcimLocationsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantn adds the tenantn to the dcim locations list params +func (o *DcimLocationsListParams) WithTenantn(tenantn *string) *DcimLocationsListParams { + o.SetTenantn(tenantn) + return o +} + +// SetTenantn adds the tenantN to the dcim locations list params +func (o *DcimLocationsListParams) SetTenantn(tenantn *string) { + o.Tenantn = tenantn +} + +// WithTenantGroup adds the tenantGroup to the dcim locations list params +func (o *DcimLocationsListParams) WithTenantGroup(tenantGroup *string) *DcimLocationsListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the dcim locations list params +func (o *DcimLocationsListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupn adds the tenantGroupn to the dcim locations list params +func (o *DcimLocationsListParams) WithTenantGroupn(tenantGroupn *string) *DcimLocationsListParams { + o.SetTenantGroupn(tenantGroupn) + return o +} + +// SetTenantGroupn adds the tenantGroupN to the dcim locations list params +func (o *DcimLocationsListParams) SetTenantGroupn(tenantGroupn *string) { + o.TenantGroupn = tenantGroupn +} + +// WithTenantGroupID adds the tenantGroupID to the dcim locations list params +func (o *DcimLocationsListParams) WithTenantGroupID(tenantGroupID *string) *DcimLocationsListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the dcim locations list params +func (o *DcimLocationsListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + +// WithTenantGroupIDn adds the tenantGroupIDn to the dcim locations list params +func (o *DcimLocationsListParams) WithTenantGroupIDn(tenantGroupIDn *string) *DcimLocationsListParams { + o.SetTenantGroupIDn(tenantGroupIDn) + return o +} + +// SetTenantGroupIDn adds the tenantGroupIdN to the dcim locations list params +func (o *DcimLocationsListParams) SetTenantGroupIDn(tenantGroupIDn *string) { + o.TenantGroupIDn = tenantGroupIDn +} + +// WithTenantID adds the tenantID to the dcim locations list params +func (o *DcimLocationsListParams) WithTenantID(tenantID *string) *DcimLocationsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim locations list params +func (o *DcimLocationsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithTenantIDn adds the tenantIDn to the dcim locations list params +func (o *DcimLocationsListParams) WithTenantIDn(tenantIDn *string) *DcimLocationsListParams { + o.SetTenantIDn(tenantIDn) + return o +} + +// SetTenantIDn adds the tenantIdN to the dcim locations list params +func (o *DcimLocationsListParams) SetTenantIDn(tenantIDn *string) { + o.TenantIDn = tenantIDn +} + // WriteToRequest writes these params to a swagger request func (o *DcimLocationsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -1038,6 +1234,74 @@ func (o *DcimLocationsListParams) WriteToRequest(r runtime.ClientRequest, reg st } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -2126,6 +2390,176 @@ func (o *DcimLocationsListParams) WriteToRequest(r runtime.ClientRequest, reg st } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if o.Tenant != nil { + + // query param tenant + var qrTenant string + + if o.Tenant != nil { + qrTenant = *o.Tenant + } + qTenant := qrTenant + if qTenant != "" { + + if err := r.SetQueryParam("tenant", qTenant); err != nil { + return err + } + } + } + + if o.Tenantn != nil { + + // query param tenant__n + var qrTenantn string + + if o.Tenantn != nil { + qrTenantn = *o.Tenantn + } + qTenantn := qrTenantn + if qTenantn != "" { + + if err := r.SetQueryParam("tenant__n", qTenantn); err != nil { + return err + } + } + } + + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + } + + if o.TenantGroupn != nil { + + // query param tenant_group__n + var qrTenantGroupn string + + if o.TenantGroupn != nil { + qrTenantGroupn = *o.TenantGroupn + } + qTenantGroupn := qrTenantGroupn + if qTenantGroupn != "" { + + if err := r.SetQueryParam("tenant_group__n", qTenantGroupn); err != nil { + return err + } + } + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + } + + if o.TenantGroupIDn != nil { + + // query param tenant_group_id__n + var qrTenantGroupIDn string + + if o.TenantGroupIDn != nil { + qrTenantGroupIDn = *o.TenantGroupIDn + } + qTenantGroupIDn := qrTenantGroupIDn + if qTenantGroupIDn != "" { + + if err := r.SetQueryParam("tenant_group_id__n", qTenantGroupIDn); err != nil { + return err + } + } + } + + if o.TenantID != nil { + + // query param tenant_id + var qrTenantID string + + if o.TenantID != nil { + qrTenantID = *o.TenantID + } + qTenantID := qrTenantID + if qTenantID != "" { + + if err := r.SetQueryParam("tenant_id", qTenantID); err != nil { + return err + } + } + } + + if o.TenantIDn != nil { + + // query param tenant_id__n + var qrTenantIDn string + + if o.TenantIDn != nil { + qrTenantIDn = *o.TenantIDn + } + qTenantIDn := qrTenantIDn + if qTenantIDn != "" { + + if err := r.SetQueryParam("tenant_id__n", qTenantIDn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go index 5bcd23b33..44c7f0f17 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_manufacturers_list_parameters.go @@ -75,6 +75,18 @@ func NewDcimManufacturersListParamsWithHTTPClient(client *http.Client) *DcimManu */ type DcimManufacturersListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -225,6 +237,12 @@ type DcimManufacturersListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -278,6 +296,50 @@ func (o *DcimManufacturersListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithContact adds the contact to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithContact(contact *string) *DcimManufacturersListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithContactn(contactn *string) *DcimManufacturersListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithContactRole(contactRole *string) *DcimManufacturersListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithContactRolen(contactRolen *string) *DcimManufacturersListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim manufacturers list params func (o *DcimManufacturersListParams) WithCreated(created *string) *DcimManufacturersListParams { o.SetCreated(created) @@ -806,6 +868,28 @@ func (o *DcimManufacturersListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithTag(tag *string) *DcimManufacturersListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithTagn(tagn *string) *DcimManufacturersListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *DcimManufacturersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -814,6 +898,74 @@ func (o *DcimManufacturersListParams) WriteToRequest(r runtime.ClientRequest, re } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -1630,6 +1782,40 @@ func (o *DcimManufacturersListParams) WriteToRequest(r runtime.ClientRequest, re } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go index 9d587cc17..6e507a8b4 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_platforms_list_parameters.go @@ -270,6 +270,12 @@ type DcimPlatformsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -1016,6 +1022,28 @@ func (o *DcimPlatformsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the dcim platforms list params +func (o *DcimPlatformsListParams) WithTag(tag *string) *DcimPlatformsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim platforms list params +func (o *DcimPlatformsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the dcim platforms list params +func (o *DcimPlatformsListParams) WithTagn(tagn *string) *DcimPlatformsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the dcim platforms list params +func (o *DcimPlatformsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -2095,6 +2123,40 @@ func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg st } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_power_panels_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_power_panels_list_parameters.go index a07426614..15dbb5145 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_power_panels_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_power_panels_list_parameters.go @@ -75,6 +75,18 @@ func NewDcimPowerPanelsListParamsWithHTTPClient(client *http.Client) *DcimPowerP */ type DcimPowerPanelsListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -260,6 +272,50 @@ func (o *DcimPowerPanelsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithContact adds the contact to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithContact(contact *string) *DcimPowerPanelsListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithContactn(contactn *string) *DcimPowerPanelsListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithContactRole(contactRole *string) *DcimPowerPanelsListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithContactRolen(contactRolen *string) *DcimPowerPanelsListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim power panels list params func (o *DcimPowerPanelsListParams) WithCreated(created *string) *DcimPowerPanelsListParams { o.SetCreated(created) @@ -730,6 +786,74 @@ func (o *DcimPowerPanelsListParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go index 7226ca8b1..17bb090a1 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_reservations_list_parameters.go @@ -84,6 +84,39 @@ type DcimRackReservationsListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -284,6 +317,127 @@ func (o *DcimRackReservationsListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescription(description *string) *DcimRackReservationsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionEmpty(descriptionEmpty *string) *DcimRackReservationsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionIc(descriptionIc *string) *DcimRackReservationsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionIe(descriptionIe *string) *DcimRackReservationsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionIew(descriptionIew *string) *DcimRackReservationsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionIsw(descriptionIsw *string) *DcimRackReservationsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionn(descriptionn *string) *DcimRackReservationsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionNic(descriptionNic *string) *DcimRackReservationsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionNie(descriptionNie *string) *DcimRackReservationsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionNiew(descriptionNiew *string) *DcimRackReservationsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithDescriptionNisw(descriptionNisw *string) *DcimRackReservationsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the dcim rack reservations list params func (o *DcimRackReservationsListParams) WithID(id *string) *DcimRackReservationsListParams { o.SetID(id) @@ -739,6 +893,193 @@ func (o *DcimRackReservationsListParams) WriteToRequest(r runtime.ClientRequest, } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go index fca2c19f5..3d5149acd 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_rack_roles_list_parameters.go @@ -117,6 +117,39 @@ type DcimRackRolesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -225,6 +258,12 @@ type DcimRackRolesListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -432,6 +471,127 @@ func (o *DcimRackRolesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescription(description *string) *DcimRackRolesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionEmpty(descriptionEmpty *string) *DcimRackRolesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionIc(descriptionIc *string) *DcimRackRolesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionIe(descriptionIe *string) *DcimRackRolesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionIew(descriptionIew *string) *DcimRackRolesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionIsw(descriptionIsw *string) *DcimRackRolesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionn(descriptionn *string) *DcimRackRolesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionNic(descriptionNic *string) *DcimRackRolesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionNie(descriptionNie *string) *DcimRackRolesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionNiew(descriptionNiew *string) *DcimRackRolesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithDescriptionNisw(descriptionNisw *string) *DcimRackRolesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the dcim rack roles list params func (o *DcimRackRolesListParams) WithID(id *string) *DcimRackRolesListParams { o.SetID(id) @@ -806,6 +966,28 @@ func (o *DcimRackRolesListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithTag(tag *string) *DcimRackRolesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithTagn(tagn *string) *DcimRackRolesListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *DcimRackRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -1052,6 +1234,193 @@ func (o *DcimRackRolesListParams) WriteToRequest(r runtime.ClientRequest, reg st } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id @@ -1630,6 +1999,40 @@ func (o *DcimRackRolesListParams) WriteToRequest(r runtime.ClientRequest, reg st } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go index dd063c9ae..bc84b4c5e 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_racks_list_parameters.go @@ -108,6 +108,18 @@ type DcimRacksListParams struct { // AssetTagNisw. AssetTagNisw *string + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -573,6 +585,50 @@ func (o *DcimRacksListParams) SetAssetTagNisw(assetTagNisw *string) { o.AssetTagNisw = assetTagNisw } +// WithContact adds the contact to the dcim racks list params +func (o *DcimRacksListParams) WithContact(contact *string) *DcimRacksListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim racks list params +func (o *DcimRacksListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim racks list params +func (o *DcimRacksListParams) WithContactn(contactn *string) *DcimRacksListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim racks list params +func (o *DcimRacksListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the dcim racks list params +func (o *DcimRacksListParams) WithContactRole(contactRole *string) *DcimRacksListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim racks list params +func (o *DcimRacksListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim racks list params +func (o *DcimRacksListParams) WithContactRolen(contactRolen *string) *DcimRacksListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim racks list params +func (o *DcimRacksListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim racks list params func (o *DcimRacksListParams) WithCreated(created *string) *DcimRacksListParams { o.SetCreated(created) @@ -1813,6 +1869,74 @@ func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } } + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go index 83de7ac34..22ddc82a8 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_regions_list_parameters.go @@ -75,6 +75,18 @@ func NewDcimRegionsListParamsWithHTTPClient(client *http.Client) *DcimRegionsLis */ type DcimRegionsListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -237,6 +249,12 @@ type DcimRegionsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -290,6 +308,50 @@ func (o *DcimRegionsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithContact adds the contact to the dcim regions list params +func (o *DcimRegionsListParams) WithContact(contact *string) *DcimRegionsListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim regions list params +func (o *DcimRegionsListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim regions list params +func (o *DcimRegionsListParams) WithContactn(contactn *string) *DcimRegionsListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim regions list params +func (o *DcimRegionsListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the dcim regions list params +func (o *DcimRegionsListParams) WithContactRole(contactRole *string) *DcimRegionsListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim regions list params +func (o *DcimRegionsListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim regions list params +func (o *DcimRegionsListParams) WithContactRolen(contactRolen *string) *DcimRegionsListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim regions list params +func (o *DcimRegionsListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim regions list params func (o *DcimRegionsListParams) WithCreated(created *string) *DcimRegionsListParams { o.SetCreated(created) @@ -862,6 +924,28 @@ func (o *DcimRegionsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the dcim regions list params +func (o *DcimRegionsListParams) WithTag(tag *string) *DcimRegionsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim regions list params +func (o *DcimRegionsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the dcim regions list params +func (o *DcimRegionsListParams) WithTagn(tagn *string) *DcimRegionsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the dcim regions list params +func (o *DcimRegionsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *DcimRegionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -870,6 +954,74 @@ func (o *DcimRegionsListParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -1754,6 +1906,40 @@ func (o *DcimRegionsListParams) WriteToRequest(r runtime.ClientRequest, reg strf } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_site_groups_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_site_groups_list_parameters.go index e9210cab9..756832e3c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_site_groups_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_site_groups_list_parameters.go @@ -75,6 +75,18 @@ func NewDcimSiteGroupsListParamsWithHTTPClient(client *http.Client) *DcimSiteGro */ type DcimSiteGroupsListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -237,6 +249,12 @@ type DcimSiteGroupsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -290,6 +308,50 @@ func (o *DcimSiteGroupsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithContact adds the contact to the dcim site groups list params +func (o *DcimSiteGroupsListParams) WithContact(contact *string) *DcimSiteGroupsListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim site groups list params +func (o *DcimSiteGroupsListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim site groups list params +func (o *DcimSiteGroupsListParams) WithContactn(contactn *string) *DcimSiteGroupsListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim site groups list params +func (o *DcimSiteGroupsListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the dcim site groups list params +func (o *DcimSiteGroupsListParams) WithContactRole(contactRole *string) *DcimSiteGroupsListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim site groups list params +func (o *DcimSiteGroupsListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim site groups list params +func (o *DcimSiteGroupsListParams) WithContactRolen(contactRolen *string) *DcimSiteGroupsListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim site groups list params +func (o *DcimSiteGroupsListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim site groups list params func (o *DcimSiteGroupsListParams) WithCreated(created *string) *DcimSiteGroupsListParams { o.SetCreated(created) @@ -862,6 +924,28 @@ func (o *DcimSiteGroupsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the dcim site groups list params +func (o *DcimSiteGroupsListParams) WithTag(tag *string) *DcimSiteGroupsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim site groups list params +func (o *DcimSiteGroupsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the dcim site groups list params +func (o *DcimSiteGroupsListParams) WithTagn(tagn *string) *DcimSiteGroupsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the dcim site groups list params +func (o *DcimSiteGroupsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *DcimSiteGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -870,6 +954,74 @@ func (o *DcimSiteGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -1754,6 +1906,40 @@ func (o *DcimSiteGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg s } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go index fef327759..48ef2d44c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/dcim/dcim_sites_list_parameters.go @@ -93,6 +93,18 @@ type DcimSitesListParams struct { // Asnn. Asnn *string + // AsnID. + AsnID *string + + // AsnIDn. + AsnIDn *string + + // Contact. + Contact *string + + // Contactn. + Contactn *string + // ContactEmail. ContactEmail *string @@ -192,6 +204,12 @@ type DcimSitesListParams struct { // ContactPhoneNisw. ContactPhoneNisw *string + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -201,6 +219,39 @@ type DcimSitesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Facility. Facility *string @@ -557,6 +608,50 @@ func (o *DcimSitesListParams) SetAsnn(asnn *string) { o.Asnn = asnn } +// WithAsnID adds the asnID to the dcim sites list params +func (o *DcimSitesListParams) WithAsnID(asnID *string) *DcimSitesListParams { + o.SetAsnID(asnID) + return o +} + +// SetAsnID adds the asnId to the dcim sites list params +func (o *DcimSitesListParams) SetAsnID(asnID *string) { + o.AsnID = asnID +} + +// WithAsnIDn adds the asnIDn to the dcim sites list params +func (o *DcimSitesListParams) WithAsnIDn(asnIDn *string) *DcimSitesListParams { + o.SetAsnIDn(asnIDn) + return o +} + +// SetAsnIDn adds the asnIdN to the dcim sites list params +func (o *DcimSitesListParams) SetAsnIDn(asnIDn *string) { + o.AsnIDn = asnIDn +} + +// WithContact adds the contact to the dcim sites list params +func (o *DcimSitesListParams) WithContact(contact *string) *DcimSitesListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the dcim sites list params +func (o *DcimSitesListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the dcim sites list params +func (o *DcimSitesListParams) WithContactn(contactn *string) *DcimSitesListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the dcim sites list params +func (o *DcimSitesListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + // WithContactEmail adds the contactEmail to the dcim sites list params func (o *DcimSitesListParams) WithContactEmail(contactEmail *string) *DcimSitesListParams { o.SetContactEmail(contactEmail) @@ -920,6 +1015,28 @@ func (o *DcimSitesListParams) SetContactPhoneNisw(contactPhoneNisw *string) { o.ContactPhoneNisw = contactPhoneNisw } +// WithContactRole adds the contactRole to the dcim sites list params +func (o *DcimSitesListParams) WithContactRole(contactRole *string) *DcimSitesListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the dcim sites list params +func (o *DcimSitesListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the dcim sites list params +func (o *DcimSitesListParams) WithContactRolen(contactRolen *string) *DcimSitesListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the dcim sites list params +func (o *DcimSitesListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the dcim sites list params func (o *DcimSitesListParams) WithCreated(created *string) *DcimSitesListParams { o.SetCreated(created) @@ -953,6 +1070,127 @@ func (o *DcimSitesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the dcim sites list params +func (o *DcimSitesListParams) WithDescription(description *string) *DcimSitesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim sites list params +func (o *DcimSitesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionEmpty(descriptionEmpty *string) *DcimSitesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionIc(descriptionIc *string) *DcimSitesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionIe(descriptionIe *string) *DcimSitesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionIew(descriptionIew *string) *DcimSitesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionIsw(descriptionIsw *string) *DcimSitesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionn(descriptionn *string) *DcimSitesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionNic(descriptionNic *string) *DcimSitesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionNie(descriptionNie *string) *DcimSitesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionNiew(descriptionNiew *string) *DcimSitesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the dcim sites list params +func (o *DcimSitesListParams) WithDescriptionNisw(descriptionNisw *string) *DcimSitesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the dcim sites list params +func (o *DcimSitesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithFacility adds the facility to the dcim sites list params func (o *DcimSitesListParams) WithFacility(facility *string) *DcimSitesListParams { o.SetFacility(facility) @@ -1910,6 +2148,74 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } } + if o.AsnID != nil { + + // query param asn_id + var qrAsnID string + + if o.AsnID != nil { + qrAsnID = *o.AsnID + } + qAsnID := qrAsnID + if qAsnID != "" { + + if err := r.SetQueryParam("asn_id", qAsnID); err != nil { + return err + } + } + } + + if o.AsnIDn != nil { + + // query param asn_id__n + var qrAsnIDn string + + if o.AsnIDn != nil { + qrAsnIDn = *o.AsnIDn + } + qAsnIDn := qrAsnIDn + if qAsnIDn != "" { + + if err := r.SetQueryParam("asn_id__n", qAsnIDn); err != nil { + return err + } + } + } + + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + if o.ContactEmail != nil { // query param contact_email @@ -2471,6 +2777,40 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } } + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -2522,6 +2862,193 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Facility != nil { // query param facility diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_config_contexts_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_config_contexts_list_parameters.go index 4b5f95e19..9b4ccdd2c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_config_contexts_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_config_contexts_list_parameters.go @@ -252,6 +252,12 @@ type ExtrasConfigContextsListParams struct { // Tagn. Tagn *string + // TagID. + TagID *string + + // TagIDn. + TagIDn *string + // Tenant. Tenant *string @@ -956,6 +962,28 @@ func (o *ExtrasConfigContextsListParams) SetTagn(tagn *string) { o.Tagn = tagn } +// WithTagID adds the tagID to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithTagID(tagID *string) *ExtrasConfigContextsListParams { + o.SetTagID(tagID) + return o +} + +// SetTagID adds the tagId to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetTagID(tagID *string) { + o.TagID = tagID +} + +// WithTagIDn adds the tagIDn to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithTagIDn(tagIDn *string) *ExtrasConfigContextsListParams { + o.SetTagIDn(tagIDn) + return o +} + +// SetTagIDn adds the tagIdN to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetTagIDn(tagIDn *string) { + o.TagIDn = tagIDn +} + // WithTenant adds the tenant to the extras config contexts list params func (o *ExtrasConfigContextsListParams) WithTenant(tenant *string) *ExtrasConfigContextsListParams { o.SetTenant(tenant) @@ -2021,6 +2049,40 @@ func (o *ExtrasConfigContextsListParams) WriteToRequest(r runtime.ClientRequest, } } + if o.TagID != nil { + + // query param tag_id + var qrTagID string + + if o.TagID != nil { + qrTagID = *o.TagID + } + qTagID := qrTagID + if qTagID != "" { + + if err := r.SetQueryParam("tag_id", qTagID); err != nil { + return err + } + } + } + + if o.TagIDn != nil { + + // query param tag_id__n + var qrTagIDn string + + if o.TagIDn != nil { + qrTagIDn = *o.TagIDn + } + qTagIDn := qrTagIDn + if qTagIDn != "" { + + if err := r.SetQueryParam("tag_id__n", qTagIDn); err != nil { + return err + } + } + } + if o.Tenant != nil { // query param tenant diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_custom_fields_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_custom_fields_list_parameters.go index a84a62c57..115919b08 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_custom_fields_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_custom_fields_list_parameters.go @@ -105,6 +105,39 @@ type ExtrasCustomFieldsListParams struct { // ContentTypesNisw. ContentTypesNisw *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // FilterLogic. FilterLogic *string @@ -361,6 +394,127 @@ func (o *ExtrasCustomFieldsListParams) SetContentTypesNisw(contentTypesNisw *str o.ContentTypesNisw = contentTypesNisw } +// WithDescription adds the description to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescription(description *string) *ExtrasCustomFieldsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionEmpty(descriptionEmpty *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionIc(descriptionIc *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionIe(descriptionIe *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionIew(descriptionIew *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionIsw(descriptionIsw *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionn(descriptionn *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionNic(descriptionNic *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionNie(descriptionNie *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionNiew(descriptionNiew *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) WithDescriptionNisw(descriptionNisw *string) *ExtrasCustomFieldsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the extras custom fields list params +func (o *ExtrasCustomFieldsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithFilterLogic adds the filterLogic to the extras custom fields list params func (o *ExtrasCustomFieldsListParams) WithFilterLogic(filterLogic *string) *ExtrasCustomFieldsListParams { o.SetFilterLogic(filterLogic) @@ -858,6 +1012,193 @@ func (o *ExtrasCustomFieldsListParams) WriteToRequest(r runtime.ClientRequest, r } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.FilterLogic != nil { // query param filter_logic diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go index 9a6048113..70d923a59 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_export_templates_list_parameters.go @@ -81,6 +81,39 @@ type ExtrasExportTemplatesListParams struct { // ContentTypen. ContentTypen *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -222,6 +255,127 @@ func (o *ExtrasExportTemplatesListParams) SetContentTypen(contentTypen *string) o.ContentTypen = contentTypen } +// WithDescription adds the description to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescription(description *string) *ExtrasExportTemplatesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionEmpty(descriptionEmpty *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionIc(descriptionIc *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionIe(descriptionIe *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionIew(descriptionIew *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionIsw(descriptionIsw *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionn(descriptionn *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionNic(descriptionNic *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionNie(descriptionNie *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionNiew(descriptionNiew *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithDescriptionNisw(descriptionNisw *string) *ExtrasExportTemplatesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the extras export templates list params func (o *ExtrasExportTemplatesListParams) WithID(id *string) *ExtrasExportTemplatesListParams { o.SetID(id) @@ -484,6 +638,193 @@ func (o *ExtrasExportTemplatesListParams) WriteToRequest(r runtime.ClientRequest } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_tags_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_tags_list_parameters.go index bd31e9cbf..cfc68236b 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_tags_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/extras/extras_tags_list_parameters.go @@ -123,6 +123,39 @@ type ExtrasTagsListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -460,6 +493,127 @@ func (o *ExtrasTagsListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the extras tags list params +func (o *ExtrasTagsListParams) WithDescription(description *string) *ExtrasTagsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the extras tags list params +func (o *ExtrasTagsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionEmpty(descriptionEmpty *string) *ExtrasTagsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionIc(descriptionIc *string) *ExtrasTagsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionIe(descriptionIe *string) *ExtrasTagsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionIew(descriptionIew *string) *ExtrasTagsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionIsw(descriptionIsw *string) *ExtrasTagsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionn(descriptionn *string) *ExtrasTagsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionNic(descriptionNic *string) *ExtrasTagsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionNie(descriptionNie *string) *ExtrasTagsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionNiew(descriptionNiew *string) *ExtrasTagsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the extras tags list params +func (o *ExtrasTagsListParams) WithDescriptionNisw(descriptionNisw *string) *ExtrasTagsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the extras tags list params +func (o *ExtrasTagsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the extras tags list params func (o *ExtrasTagsListParams) WithID(id *string) *ExtrasTagsListParams { o.SetID(id) @@ -1114,6 +1268,193 @@ func (o *ExtrasTagsListParams) WriteToRequest(r runtime.ClientRequest, reg strfm } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_aggregates_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_aggregates_list_parameters.go index e0f7edb03..592f05d57 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_aggregates_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_aggregates_list_parameters.go @@ -102,6 +102,39 @@ type IpamAggregatesListParams struct { // DateAddedn. DateAddedn *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Family. Family *float64 @@ -344,6 +377,127 @@ func (o *IpamAggregatesListParams) SetDateAddedn(dateAddedn *string) { o.DateAddedn = dateAddedn } +// WithDescription adds the description to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescription(description *string) *IpamAggregatesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamAggregatesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionIc(descriptionIc *string) *IpamAggregatesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionIe(descriptionIe *string) *IpamAggregatesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionIew(descriptionIew *string) *IpamAggregatesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionIsw(descriptionIsw *string) *IpamAggregatesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionn(descriptionn *string) *IpamAggregatesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionNic(descriptionNic *string) *IpamAggregatesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionNie(descriptionNie *string) *IpamAggregatesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionNiew(descriptionNiew *string) *IpamAggregatesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam aggregates list params +func (o *IpamAggregatesListParams) WithDescriptionNisw(descriptionNisw *string) *IpamAggregatesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam aggregates list params +func (o *IpamAggregatesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithFamily adds the family to the ipam aggregates list params func (o *IpamAggregatesListParams) WithFamily(family *float64) *IpamAggregatesListParams { o.SetFamily(family) @@ -813,6 +967,193 @@ func (o *IpamAggregatesListParams) WriteToRequest(r runtime.ClientRequest, reg s } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Family != nil { // query param family diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_parameters.go new file mode 100644 index 000000000..6368d1872 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewIpamAsnsBulkDeleteParams creates a new IpamAsnsBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsBulkDeleteParams() *IpamAsnsBulkDeleteParams { + return &IpamAsnsBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsBulkDeleteParamsWithTimeout creates a new IpamAsnsBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsBulkDeleteParamsWithTimeout(timeout time.Duration) *IpamAsnsBulkDeleteParams { + return &IpamAsnsBulkDeleteParams{ + timeout: timeout, + } +} + +// NewIpamAsnsBulkDeleteParamsWithContext creates a new IpamAsnsBulkDeleteParams object +// with the ability to set a context for a request. +func NewIpamAsnsBulkDeleteParamsWithContext(ctx context.Context) *IpamAsnsBulkDeleteParams { + return &IpamAsnsBulkDeleteParams{ + Context: ctx, + } +} + +// NewIpamAsnsBulkDeleteParamsWithHTTPClient creates a new IpamAsnsBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsBulkDeleteParamsWithHTTPClient(client *http.Client) *IpamAsnsBulkDeleteParams { + return &IpamAsnsBulkDeleteParams{ + HTTPClient: client, + } +} + +/* IpamAsnsBulkDeleteParams contains all the parameters to send to the API endpoint + for the ipam asns bulk delete operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsBulkDeleteParams) WithDefaults() *IpamAsnsBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns bulk delete params +func (o *IpamAsnsBulkDeleteParams) WithTimeout(timeout time.Duration) *IpamAsnsBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns bulk delete params +func (o *IpamAsnsBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns bulk delete params +func (o *IpamAsnsBulkDeleteParams) WithContext(ctx context.Context) *IpamAsnsBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns bulk delete params +func (o *IpamAsnsBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns bulk delete params +func (o *IpamAsnsBulkDeleteParams) WithHTTPClient(client *http.Client) *IpamAsnsBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns bulk delete params +func (o *IpamAsnsBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_responses.go new file mode 100644 index 000000000..b2105e1a6 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IpamAsnsBulkDeleteReader is a Reader for the IpamAsnsBulkDelete structure. +type IpamAsnsBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewIpamAsnsBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsBulkDeleteNoContent creates a IpamAsnsBulkDeleteNoContent with default headers values +func NewIpamAsnsBulkDeleteNoContent() *IpamAsnsBulkDeleteNoContent { + return &IpamAsnsBulkDeleteNoContent{} +} + +/* IpamAsnsBulkDeleteNoContent describes a response with status code 204, with default header values. + +IpamAsnsBulkDeleteNoContent ipam asns bulk delete no content +*/ +type IpamAsnsBulkDeleteNoContent struct { +} + +func (o *IpamAsnsBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/asns/][%d] ipamAsnsBulkDeleteNoContent ", 204) +} + +func (o *IpamAsnsBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_parameters.go new file mode 100644 index 000000000..0a7d9917b --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamAsnsBulkPartialUpdateParams creates a new IpamAsnsBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsBulkPartialUpdateParams() *IpamAsnsBulkPartialUpdateParams { + return &IpamAsnsBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsBulkPartialUpdateParamsWithTimeout creates a new IpamAsnsBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *IpamAsnsBulkPartialUpdateParams { + return &IpamAsnsBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewIpamAsnsBulkPartialUpdateParamsWithContext creates a new IpamAsnsBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewIpamAsnsBulkPartialUpdateParamsWithContext(ctx context.Context) *IpamAsnsBulkPartialUpdateParams { + return &IpamAsnsBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewIpamAsnsBulkPartialUpdateParamsWithHTTPClient creates a new IpamAsnsBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *IpamAsnsBulkPartialUpdateParams { + return &IpamAsnsBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* IpamAsnsBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the ipam asns bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableASN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsBulkPartialUpdateParams) WithDefaults() *IpamAsnsBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *IpamAsnsBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) WithContext(ctx context.Context) *IpamAsnsBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *IpamAsnsBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) WithData(data *models.WritableASN) *IpamAsnsBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam asns bulk partial update params +func (o *IpamAsnsBulkPartialUpdateParams) SetData(data *models.WritableASN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_responses.go new file mode 100644 index 000000000..7154480f1 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamAsnsBulkPartialUpdateReader is a Reader for the IpamAsnsBulkPartialUpdate structure. +type IpamAsnsBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamAsnsBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsBulkPartialUpdateOK creates a IpamAsnsBulkPartialUpdateOK with default headers values +func NewIpamAsnsBulkPartialUpdateOK() *IpamAsnsBulkPartialUpdateOK { + return &IpamAsnsBulkPartialUpdateOK{} +} + +/* IpamAsnsBulkPartialUpdateOK describes a response with status code 200, with default header values. + +IpamAsnsBulkPartialUpdateOK ipam asns bulk partial update o k +*/ +type IpamAsnsBulkPartialUpdateOK struct { + Payload *models.ASN +} + +func (o *IpamAsnsBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/asns/][%d] ipamAsnsBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *IpamAsnsBulkPartialUpdateOK) GetPayload() *models.ASN { + return o.Payload +} + +func (o *IpamAsnsBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ASN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_parameters.go new file mode 100644 index 000000000..20afc7b57 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamAsnsBulkUpdateParams creates a new IpamAsnsBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsBulkUpdateParams() *IpamAsnsBulkUpdateParams { + return &IpamAsnsBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsBulkUpdateParamsWithTimeout creates a new IpamAsnsBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsBulkUpdateParamsWithTimeout(timeout time.Duration) *IpamAsnsBulkUpdateParams { + return &IpamAsnsBulkUpdateParams{ + timeout: timeout, + } +} + +// NewIpamAsnsBulkUpdateParamsWithContext creates a new IpamAsnsBulkUpdateParams object +// with the ability to set a context for a request. +func NewIpamAsnsBulkUpdateParamsWithContext(ctx context.Context) *IpamAsnsBulkUpdateParams { + return &IpamAsnsBulkUpdateParams{ + Context: ctx, + } +} + +// NewIpamAsnsBulkUpdateParamsWithHTTPClient creates a new IpamAsnsBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsBulkUpdateParamsWithHTTPClient(client *http.Client) *IpamAsnsBulkUpdateParams { + return &IpamAsnsBulkUpdateParams{ + HTTPClient: client, + } +} + +/* IpamAsnsBulkUpdateParams contains all the parameters to send to the API endpoint + for the ipam asns bulk update operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsBulkUpdateParams struct { + + // Data. + Data *models.WritableASN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsBulkUpdateParams) WithDefaults() *IpamAsnsBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) WithTimeout(timeout time.Duration) *IpamAsnsBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) WithContext(ctx context.Context) *IpamAsnsBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) WithHTTPClient(client *http.Client) *IpamAsnsBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) WithData(data *models.WritableASN) *IpamAsnsBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam asns bulk update params +func (o *IpamAsnsBulkUpdateParams) SetData(data *models.WritableASN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_responses.go new file mode 100644 index 000000000..500e19cd9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamAsnsBulkUpdateReader is a Reader for the IpamAsnsBulkUpdate structure. +type IpamAsnsBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamAsnsBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsBulkUpdateOK creates a IpamAsnsBulkUpdateOK with default headers values +func NewIpamAsnsBulkUpdateOK() *IpamAsnsBulkUpdateOK { + return &IpamAsnsBulkUpdateOK{} +} + +/* IpamAsnsBulkUpdateOK describes a response with status code 200, with default header values. + +IpamAsnsBulkUpdateOK ipam asns bulk update o k +*/ +type IpamAsnsBulkUpdateOK struct { + Payload *models.ASN +} + +func (o *IpamAsnsBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/asns/][%d] ipamAsnsBulkUpdateOK %+v", 200, o.Payload) +} +func (o *IpamAsnsBulkUpdateOK) GetPayload() *models.ASN { + return o.Payload +} + +func (o *IpamAsnsBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ASN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_parameters.go new file mode 100644 index 000000000..aa8a323a8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamAsnsCreateParams creates a new IpamAsnsCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsCreateParams() *IpamAsnsCreateParams { + return &IpamAsnsCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsCreateParamsWithTimeout creates a new IpamAsnsCreateParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsCreateParamsWithTimeout(timeout time.Duration) *IpamAsnsCreateParams { + return &IpamAsnsCreateParams{ + timeout: timeout, + } +} + +// NewIpamAsnsCreateParamsWithContext creates a new IpamAsnsCreateParams object +// with the ability to set a context for a request. +func NewIpamAsnsCreateParamsWithContext(ctx context.Context) *IpamAsnsCreateParams { + return &IpamAsnsCreateParams{ + Context: ctx, + } +} + +// NewIpamAsnsCreateParamsWithHTTPClient creates a new IpamAsnsCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsCreateParamsWithHTTPClient(client *http.Client) *IpamAsnsCreateParams { + return &IpamAsnsCreateParams{ + HTTPClient: client, + } +} + +/* IpamAsnsCreateParams contains all the parameters to send to the API endpoint + for the ipam asns create operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsCreateParams struct { + + // Data. + Data *models.WritableASN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsCreateParams) WithDefaults() *IpamAsnsCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns create params +func (o *IpamAsnsCreateParams) WithTimeout(timeout time.Duration) *IpamAsnsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns create params +func (o *IpamAsnsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns create params +func (o *IpamAsnsCreateParams) WithContext(ctx context.Context) *IpamAsnsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns create params +func (o *IpamAsnsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns create params +func (o *IpamAsnsCreateParams) WithHTTPClient(client *http.Client) *IpamAsnsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns create params +func (o *IpamAsnsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam asns create params +func (o *IpamAsnsCreateParams) WithData(data *models.WritableASN) *IpamAsnsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam asns create params +func (o *IpamAsnsCreateParams) SetData(data *models.WritableASN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_responses.go new file mode 100644 index 000000000..266a19d84 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamAsnsCreateReader is a Reader for the IpamAsnsCreate structure. +type IpamAsnsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewIpamAsnsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsCreateCreated creates a IpamAsnsCreateCreated with default headers values +func NewIpamAsnsCreateCreated() *IpamAsnsCreateCreated { + return &IpamAsnsCreateCreated{} +} + +/* IpamAsnsCreateCreated describes a response with status code 201, with default header values. + +IpamAsnsCreateCreated ipam asns create created +*/ +type IpamAsnsCreateCreated struct { + Payload *models.ASN +} + +func (o *IpamAsnsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/asns/][%d] ipamAsnsCreateCreated %+v", 201, o.Payload) +} +func (o *IpamAsnsCreateCreated) GetPayload() *models.ASN { + return o.Payload +} + +func (o *IpamAsnsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ASN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_parameters.go new file mode 100644 index 000000000..9638f23a1 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamAsnsDeleteParams creates a new IpamAsnsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsDeleteParams() *IpamAsnsDeleteParams { + return &IpamAsnsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsDeleteParamsWithTimeout creates a new IpamAsnsDeleteParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsDeleteParamsWithTimeout(timeout time.Duration) *IpamAsnsDeleteParams { + return &IpamAsnsDeleteParams{ + timeout: timeout, + } +} + +// NewIpamAsnsDeleteParamsWithContext creates a new IpamAsnsDeleteParams object +// with the ability to set a context for a request. +func NewIpamAsnsDeleteParamsWithContext(ctx context.Context) *IpamAsnsDeleteParams { + return &IpamAsnsDeleteParams{ + Context: ctx, + } +} + +// NewIpamAsnsDeleteParamsWithHTTPClient creates a new IpamAsnsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsDeleteParamsWithHTTPClient(client *http.Client) *IpamAsnsDeleteParams { + return &IpamAsnsDeleteParams{ + HTTPClient: client, + } +} + +/* IpamAsnsDeleteParams contains all the parameters to send to the API endpoint + for the ipam asns delete operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsDeleteParams struct { + + /* ID. + + A unique integer value identifying this ASN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsDeleteParams) WithDefaults() *IpamAsnsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns delete params +func (o *IpamAsnsDeleteParams) WithTimeout(timeout time.Duration) *IpamAsnsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns delete params +func (o *IpamAsnsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns delete params +func (o *IpamAsnsDeleteParams) WithContext(ctx context.Context) *IpamAsnsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns delete params +func (o *IpamAsnsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns delete params +func (o *IpamAsnsDeleteParams) WithHTTPClient(client *http.Client) *IpamAsnsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns delete params +func (o *IpamAsnsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam asns delete params +func (o *IpamAsnsDeleteParams) WithID(id int64) *IpamAsnsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam asns delete params +func (o *IpamAsnsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_responses.go new file mode 100644 index 000000000..25eafc37b --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IpamAsnsDeleteReader is a Reader for the IpamAsnsDelete structure. +type IpamAsnsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewIpamAsnsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsDeleteNoContent creates a IpamAsnsDeleteNoContent with default headers values +func NewIpamAsnsDeleteNoContent() *IpamAsnsDeleteNoContent { + return &IpamAsnsDeleteNoContent{} +} + +/* IpamAsnsDeleteNoContent describes a response with status code 204, with default header values. + +IpamAsnsDeleteNoContent ipam asns delete no content +*/ +type IpamAsnsDeleteNoContent struct { +} + +func (o *IpamAsnsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/asns/{id}/][%d] ipamAsnsDeleteNoContent ", 204) +} + +func (o *IpamAsnsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_parameters.go new file mode 100644 index 000000000..ba572b62a --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_parameters.go @@ -0,0 +1,1637 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamAsnsListParams creates a new IpamAsnsListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsListParams() *IpamAsnsListParams { + return &IpamAsnsListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsListParamsWithTimeout creates a new IpamAsnsListParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsListParamsWithTimeout(timeout time.Duration) *IpamAsnsListParams { + return &IpamAsnsListParams{ + timeout: timeout, + } +} + +// NewIpamAsnsListParamsWithContext creates a new IpamAsnsListParams object +// with the ability to set a context for a request. +func NewIpamAsnsListParamsWithContext(ctx context.Context) *IpamAsnsListParams { + return &IpamAsnsListParams{ + Context: ctx, + } +} + +// NewIpamAsnsListParamsWithHTTPClient creates a new IpamAsnsListParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsListParamsWithHTTPClient(client *http.Client) *IpamAsnsListParams { + return &IpamAsnsListParams{ + HTTPClient: client, + } +} + +/* IpamAsnsListParams contains all the parameters to send to the API endpoint + for the ipam asns list operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsListParams struct { + + // Asn. + Asn *string + + // AsnGt. + AsnGt *string + + // AsnGte. + AsnGte *string + + // AsnLt. + AsnLt *string + + // AsnLte. + AsnLte *string + + // Asnn. + Asnn *string + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Q. + Q *string + + // Rir. + Rir *string + + // Rirn. + Rirn *string + + // RirID. + RirID *string + + // RirIDn. + RirIDn *string + + // Site. + Site *string + + // Siten. + Siten *string + + // SiteID. + SiteID *string + + // SiteIDn. + SiteIDn *string + + // Tenant. + Tenant *string + + // Tenantn. + Tenantn *string + + // TenantGroup. + TenantGroup *string + + // TenantGroupn. + TenantGroupn *string + + // TenantGroupID. + TenantGroupID *string + + // TenantGroupIDn. + TenantGroupIDn *string + + // TenantID. + TenantID *string + + // TenantIDn. + TenantIDn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsListParams) WithDefaults() *IpamAsnsListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns list params +func (o *IpamAsnsListParams) WithTimeout(timeout time.Duration) *IpamAsnsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns list params +func (o *IpamAsnsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns list params +func (o *IpamAsnsListParams) WithContext(ctx context.Context) *IpamAsnsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns list params +func (o *IpamAsnsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns list params +func (o *IpamAsnsListParams) WithHTTPClient(client *http.Client) *IpamAsnsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns list params +func (o *IpamAsnsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAsn adds the asn to the ipam asns list params +func (o *IpamAsnsListParams) WithAsn(asn *string) *IpamAsnsListParams { + o.SetAsn(asn) + return o +} + +// SetAsn adds the asn to the ipam asns list params +func (o *IpamAsnsListParams) SetAsn(asn *string) { + o.Asn = asn +} + +// WithAsnGt adds the asnGt to the ipam asns list params +func (o *IpamAsnsListParams) WithAsnGt(asnGt *string) *IpamAsnsListParams { + o.SetAsnGt(asnGt) + return o +} + +// SetAsnGt adds the asnGt to the ipam asns list params +func (o *IpamAsnsListParams) SetAsnGt(asnGt *string) { + o.AsnGt = asnGt +} + +// WithAsnGte adds the asnGte to the ipam asns list params +func (o *IpamAsnsListParams) WithAsnGte(asnGte *string) *IpamAsnsListParams { + o.SetAsnGte(asnGte) + return o +} + +// SetAsnGte adds the asnGte to the ipam asns list params +func (o *IpamAsnsListParams) SetAsnGte(asnGte *string) { + o.AsnGte = asnGte +} + +// WithAsnLt adds the asnLt to the ipam asns list params +func (o *IpamAsnsListParams) WithAsnLt(asnLt *string) *IpamAsnsListParams { + o.SetAsnLt(asnLt) + return o +} + +// SetAsnLt adds the asnLt to the ipam asns list params +func (o *IpamAsnsListParams) SetAsnLt(asnLt *string) { + o.AsnLt = asnLt +} + +// WithAsnLte adds the asnLte to the ipam asns list params +func (o *IpamAsnsListParams) WithAsnLte(asnLte *string) *IpamAsnsListParams { + o.SetAsnLte(asnLte) + return o +} + +// SetAsnLte adds the asnLte to the ipam asns list params +func (o *IpamAsnsListParams) SetAsnLte(asnLte *string) { + o.AsnLte = asnLte +} + +// WithAsnn adds the asnn to the ipam asns list params +func (o *IpamAsnsListParams) WithAsnn(asnn *string) *IpamAsnsListParams { + o.SetAsnn(asnn) + return o +} + +// SetAsnn adds the asnN to the ipam asns list params +func (o *IpamAsnsListParams) SetAsnn(asnn *string) { + o.Asnn = asnn +} + +// WithCreated adds the created to the ipam asns list params +func (o *IpamAsnsListParams) WithCreated(created *string) *IpamAsnsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the ipam asns list params +func (o *IpamAsnsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the ipam asns list params +func (o *IpamAsnsListParams) WithCreatedGte(createdGte *string) *IpamAsnsListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the ipam asns list params +func (o *IpamAsnsListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the ipam asns list params +func (o *IpamAsnsListParams) WithCreatedLte(createdLte *string) *IpamAsnsListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the ipam asns list params +func (o *IpamAsnsListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithDescription adds the description to the ipam asns list params +func (o *IpamAsnsListParams) WithDescription(description *string) *IpamAsnsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam asns list params +func (o *IpamAsnsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamAsnsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionIc(descriptionIc *string) *IpamAsnsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionIe(descriptionIe *string) *IpamAsnsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionIew(descriptionIew *string) *IpamAsnsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionIsw(descriptionIsw *string) *IpamAsnsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionn(descriptionn *string) *IpamAsnsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionNic(descriptionNic *string) *IpamAsnsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionNie(descriptionNie *string) *IpamAsnsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionNiew(descriptionNiew *string) *IpamAsnsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam asns list params +func (o *IpamAsnsListParams) WithDescriptionNisw(descriptionNisw *string) *IpamAsnsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam asns list params +func (o *IpamAsnsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + +// WithID adds the id to the ipam asns list params +func (o *IpamAsnsListParams) WithID(id *string) *IpamAsnsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam asns list params +func (o *IpamAsnsListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the ipam asns list params +func (o *IpamAsnsListParams) WithIDGt(iDGt *string) *IpamAsnsListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the ipam asns list params +func (o *IpamAsnsListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the ipam asns list params +func (o *IpamAsnsListParams) WithIDGte(iDGte *string) *IpamAsnsListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the ipam asns list params +func (o *IpamAsnsListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the ipam asns list params +func (o *IpamAsnsListParams) WithIDLt(iDLt *string) *IpamAsnsListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the ipam asns list params +func (o *IpamAsnsListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the ipam asns list params +func (o *IpamAsnsListParams) WithIDLte(iDLte *string) *IpamAsnsListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the ipam asns list params +func (o *IpamAsnsListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the ipam asns list params +func (o *IpamAsnsListParams) WithIDn(iDn *string) *IpamAsnsListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the ipam asns list params +func (o *IpamAsnsListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the ipam asns list params +func (o *IpamAsnsListParams) WithLastUpdated(lastUpdated *string) *IpamAsnsListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the ipam asns list params +func (o *IpamAsnsListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the ipam asns list params +func (o *IpamAsnsListParams) WithLastUpdatedGte(lastUpdatedGte *string) *IpamAsnsListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the ipam asns list params +func (o *IpamAsnsListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the ipam asns list params +func (o *IpamAsnsListParams) WithLastUpdatedLte(lastUpdatedLte *string) *IpamAsnsListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the ipam asns list params +func (o *IpamAsnsListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the ipam asns list params +func (o *IpamAsnsListParams) WithLimit(limit *int64) *IpamAsnsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam asns list params +func (o *IpamAsnsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the ipam asns list params +func (o *IpamAsnsListParams) WithOffset(offset *int64) *IpamAsnsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam asns list params +func (o *IpamAsnsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam asns list params +func (o *IpamAsnsListParams) WithQ(q *string) *IpamAsnsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam asns list params +func (o *IpamAsnsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRir adds the rir to the ipam asns list params +func (o *IpamAsnsListParams) WithRir(rir *string) *IpamAsnsListParams { + o.SetRir(rir) + return o +} + +// SetRir adds the rir to the ipam asns list params +func (o *IpamAsnsListParams) SetRir(rir *string) { + o.Rir = rir +} + +// WithRirn adds the rirn to the ipam asns list params +func (o *IpamAsnsListParams) WithRirn(rirn *string) *IpamAsnsListParams { + o.SetRirn(rirn) + return o +} + +// SetRirn adds the rirN to the ipam asns list params +func (o *IpamAsnsListParams) SetRirn(rirn *string) { + o.Rirn = rirn +} + +// WithRirID adds the rirID to the ipam asns list params +func (o *IpamAsnsListParams) WithRirID(rirID *string) *IpamAsnsListParams { + o.SetRirID(rirID) + return o +} + +// SetRirID adds the rirId to the ipam asns list params +func (o *IpamAsnsListParams) SetRirID(rirID *string) { + o.RirID = rirID +} + +// WithRirIDn adds the rirIDn to the ipam asns list params +func (o *IpamAsnsListParams) WithRirIDn(rirIDn *string) *IpamAsnsListParams { + o.SetRirIDn(rirIDn) + return o +} + +// SetRirIDn adds the rirIdN to the ipam asns list params +func (o *IpamAsnsListParams) SetRirIDn(rirIDn *string) { + o.RirIDn = rirIDn +} + +// WithSite adds the site to the ipam asns list params +func (o *IpamAsnsListParams) WithSite(site *string) *IpamAsnsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the ipam asns list params +func (o *IpamAsnsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiten adds the siten to the ipam asns list params +func (o *IpamAsnsListParams) WithSiten(siten *string) *IpamAsnsListParams { + o.SetSiten(siten) + return o +} + +// SetSiten adds the siteN to the ipam asns list params +func (o *IpamAsnsListParams) SetSiten(siten *string) { + o.Siten = siten +} + +// WithSiteID adds the siteID to the ipam asns list params +func (o *IpamAsnsListParams) WithSiteID(siteID *string) *IpamAsnsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the ipam asns list params +func (o *IpamAsnsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSiteIDn adds the siteIDn to the ipam asns list params +func (o *IpamAsnsListParams) WithSiteIDn(siteIDn *string) *IpamAsnsListParams { + o.SetSiteIDn(siteIDn) + return o +} + +// SetSiteIDn adds the siteIdN to the ipam asns list params +func (o *IpamAsnsListParams) SetSiteIDn(siteIDn *string) { + o.SiteIDn = siteIDn +} + +// WithTenant adds the tenant to the ipam asns list params +func (o *IpamAsnsListParams) WithTenant(tenant *string) *IpamAsnsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam asns list params +func (o *IpamAsnsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantn adds the tenantn to the ipam asns list params +func (o *IpamAsnsListParams) WithTenantn(tenantn *string) *IpamAsnsListParams { + o.SetTenantn(tenantn) + return o +} + +// SetTenantn adds the tenantN to the ipam asns list params +func (o *IpamAsnsListParams) SetTenantn(tenantn *string) { + o.Tenantn = tenantn +} + +// WithTenantGroup adds the tenantGroup to the ipam asns list params +func (o *IpamAsnsListParams) WithTenantGroup(tenantGroup *string) *IpamAsnsListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the ipam asns list params +func (o *IpamAsnsListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupn adds the tenantGroupn to the ipam asns list params +func (o *IpamAsnsListParams) WithTenantGroupn(tenantGroupn *string) *IpamAsnsListParams { + o.SetTenantGroupn(tenantGroupn) + return o +} + +// SetTenantGroupn adds the tenantGroupN to the ipam asns list params +func (o *IpamAsnsListParams) SetTenantGroupn(tenantGroupn *string) { + o.TenantGroupn = tenantGroupn +} + +// WithTenantGroupID adds the tenantGroupID to the ipam asns list params +func (o *IpamAsnsListParams) WithTenantGroupID(tenantGroupID *string) *IpamAsnsListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the ipam asns list params +func (o *IpamAsnsListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + +// WithTenantGroupIDn adds the tenantGroupIDn to the ipam asns list params +func (o *IpamAsnsListParams) WithTenantGroupIDn(tenantGroupIDn *string) *IpamAsnsListParams { + o.SetTenantGroupIDn(tenantGroupIDn) + return o +} + +// SetTenantGroupIDn adds the tenantGroupIdN to the ipam asns list params +func (o *IpamAsnsListParams) SetTenantGroupIDn(tenantGroupIDn *string) { + o.TenantGroupIDn = tenantGroupIDn +} + +// WithTenantID adds the tenantID to the ipam asns list params +func (o *IpamAsnsListParams) WithTenantID(tenantID *string) *IpamAsnsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam asns list params +func (o *IpamAsnsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithTenantIDn adds the tenantIDn to the ipam asns list params +func (o *IpamAsnsListParams) WithTenantIDn(tenantIDn *string) *IpamAsnsListParams { + o.SetTenantIDn(tenantIDn) + return o +} + +// SetTenantIDn adds the tenantIdN to the ipam asns list params +func (o *IpamAsnsListParams) SetTenantIDn(tenantIDn *string) { + o.TenantIDn = tenantIDn +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Asn != nil { + + // query param asn + var qrAsn string + + if o.Asn != nil { + qrAsn = *o.Asn + } + qAsn := qrAsn + if qAsn != "" { + + if err := r.SetQueryParam("asn", qAsn); err != nil { + return err + } + } + } + + if o.AsnGt != nil { + + // query param asn__gt + var qrAsnGt string + + if o.AsnGt != nil { + qrAsnGt = *o.AsnGt + } + qAsnGt := qrAsnGt + if qAsnGt != "" { + + if err := r.SetQueryParam("asn__gt", qAsnGt); err != nil { + return err + } + } + } + + if o.AsnGte != nil { + + // query param asn__gte + var qrAsnGte string + + if o.AsnGte != nil { + qrAsnGte = *o.AsnGte + } + qAsnGte := qrAsnGte + if qAsnGte != "" { + + if err := r.SetQueryParam("asn__gte", qAsnGte); err != nil { + return err + } + } + } + + if o.AsnLt != nil { + + // query param asn__lt + var qrAsnLt string + + if o.AsnLt != nil { + qrAsnLt = *o.AsnLt + } + qAsnLt := qrAsnLt + if qAsnLt != "" { + + if err := r.SetQueryParam("asn__lt", qAsnLt); err != nil { + return err + } + } + } + + if o.AsnLte != nil { + + // query param asn__lte + var qrAsnLte string + + if o.AsnLte != nil { + qrAsnLte = *o.AsnLte + } + qAsnLte := qrAsnLte + if qAsnLte != "" { + + if err := r.SetQueryParam("asn__lte", qAsnLte); err != nil { + return err + } + } + } + + if o.Asnn != nil { + + // query param asn__n + var qrAsnn string + + if o.Asnn != nil { + qrAsnn = *o.Asnn + } + qAsnn := qrAsnn + if qAsnn != "" { + + if err := r.SetQueryParam("asn__n", qAsnn); err != nil { + return err + } + } + } + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Rir != nil { + + // query param rir + var qrRir string + + if o.Rir != nil { + qrRir = *o.Rir + } + qRir := qrRir + if qRir != "" { + + if err := r.SetQueryParam("rir", qRir); err != nil { + return err + } + } + } + + if o.Rirn != nil { + + // query param rir__n + var qrRirn string + + if o.Rirn != nil { + qrRirn = *o.Rirn + } + qRirn := qrRirn + if qRirn != "" { + + if err := r.SetQueryParam("rir__n", qRirn); err != nil { + return err + } + } + } + + if o.RirID != nil { + + // query param rir_id + var qrRirID string + + if o.RirID != nil { + qrRirID = *o.RirID + } + qRirID := qrRirID + if qRirID != "" { + + if err := r.SetQueryParam("rir_id", qRirID); err != nil { + return err + } + } + } + + if o.RirIDn != nil { + + // query param rir_id__n + var qrRirIDn string + + if o.RirIDn != nil { + qrRirIDn = *o.RirIDn + } + qRirIDn := qrRirIDn + if qRirIDn != "" { + + if err := r.SetQueryParam("rir_id__n", qRirIDn); err != nil { + return err + } + } + } + + if o.Site != nil { + + // query param site + var qrSite string + + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + } + + if o.Siten != nil { + + // query param site__n + var qrSiten string + + if o.Siten != nil { + qrSiten = *o.Siten + } + qSiten := qrSiten + if qSiten != "" { + + if err := r.SetQueryParam("site__n", qSiten); err != nil { + return err + } + } + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + } + + if o.SiteIDn != nil { + + // query param site_id__n + var qrSiteIDn string + + if o.SiteIDn != nil { + qrSiteIDn = *o.SiteIDn + } + qSiteIDn := qrSiteIDn + if qSiteIDn != "" { + + if err := r.SetQueryParam("site_id__n", qSiteIDn); err != nil { + return err + } + } + } + + if o.Tenant != nil { + + // query param tenant + var qrTenant string + + if o.Tenant != nil { + qrTenant = *o.Tenant + } + qTenant := qrTenant + if qTenant != "" { + + if err := r.SetQueryParam("tenant", qTenant); err != nil { + return err + } + } + } + + if o.Tenantn != nil { + + // query param tenant__n + var qrTenantn string + + if o.Tenantn != nil { + qrTenantn = *o.Tenantn + } + qTenantn := qrTenantn + if qTenantn != "" { + + if err := r.SetQueryParam("tenant__n", qTenantn); err != nil { + return err + } + } + } + + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + } + + if o.TenantGroupn != nil { + + // query param tenant_group__n + var qrTenantGroupn string + + if o.TenantGroupn != nil { + qrTenantGroupn = *o.TenantGroupn + } + qTenantGroupn := qrTenantGroupn + if qTenantGroupn != "" { + + if err := r.SetQueryParam("tenant_group__n", qTenantGroupn); err != nil { + return err + } + } + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + } + + if o.TenantGroupIDn != nil { + + // query param tenant_group_id__n + var qrTenantGroupIDn string + + if o.TenantGroupIDn != nil { + qrTenantGroupIDn = *o.TenantGroupIDn + } + qTenantGroupIDn := qrTenantGroupIDn + if qTenantGroupIDn != "" { + + if err := r.SetQueryParam("tenant_group_id__n", qTenantGroupIDn); err != nil { + return err + } + } + } + + if o.TenantID != nil { + + // query param tenant_id + var qrTenantID string + + if o.TenantID != nil { + qrTenantID = *o.TenantID + } + qTenantID := qrTenantID + if qTenantID != "" { + + if err := r.SetQueryParam("tenant_id", qTenantID); err != nil { + return err + } + } + } + + if o.TenantIDn != nil { + + // query param tenant_id__n + var qrTenantIDn string + + if o.TenantIDn != nil { + qrTenantIDn = *o.TenantIDn + } + qTenantIDn := qrTenantIDn + if qTenantIDn != "" { + + if err := r.SetQueryParam("tenant_id__n", qTenantIDn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_responses.go new file mode 100644 index 000000000..caa123763 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamAsnsListReader is a Reader for the IpamAsnsList structure. +type IpamAsnsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamAsnsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsListOK creates a IpamAsnsListOK with default headers values +func NewIpamAsnsListOK() *IpamAsnsListOK { + return &IpamAsnsListOK{} +} + +/* IpamAsnsListOK describes a response with status code 200, with default header values. + +IpamAsnsListOK ipam asns list o k +*/ +type IpamAsnsListOK struct { + Payload *IpamAsnsListOKBody +} + +func (o *IpamAsnsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/asns/][%d] ipamAsnsListOK %+v", 200, o.Payload) +} +func (o *IpamAsnsListOK) GetPayload() *IpamAsnsListOKBody { + return o.Payload +} + +func (o *IpamAsnsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IpamAsnsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IpamAsnsListOKBody ipam asns list o k body +swagger:model IpamAsnsListOKBody +*/ +type IpamAsnsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ASN `json:"results"` +} + +// Validate validates this ipam asns list o k body +func (o *IpamAsnsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IpamAsnsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamAsnsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IpamAsnsListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamAsnsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IpamAsnsListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamAsnsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IpamAsnsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamAsnsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamAsnsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipamAsnsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this ipam asns list o k body based on the context it is used +func (o *IpamAsnsListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IpamAsnsListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamAsnsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipamAsnsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IpamAsnsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IpamAsnsListOKBody) UnmarshalBinary(b []byte) error { + var res IpamAsnsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_parameters.go new file mode 100644 index 000000000..7e16f0e7c --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamAsnsPartialUpdateParams creates a new IpamAsnsPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsPartialUpdateParams() *IpamAsnsPartialUpdateParams { + return &IpamAsnsPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsPartialUpdateParamsWithTimeout creates a new IpamAsnsPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsPartialUpdateParamsWithTimeout(timeout time.Duration) *IpamAsnsPartialUpdateParams { + return &IpamAsnsPartialUpdateParams{ + timeout: timeout, + } +} + +// NewIpamAsnsPartialUpdateParamsWithContext creates a new IpamAsnsPartialUpdateParams object +// with the ability to set a context for a request. +func NewIpamAsnsPartialUpdateParamsWithContext(ctx context.Context) *IpamAsnsPartialUpdateParams { + return &IpamAsnsPartialUpdateParams{ + Context: ctx, + } +} + +// NewIpamAsnsPartialUpdateParamsWithHTTPClient creates a new IpamAsnsPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsPartialUpdateParamsWithHTTPClient(client *http.Client) *IpamAsnsPartialUpdateParams { + return &IpamAsnsPartialUpdateParams{ + HTTPClient: client, + } +} + +/* IpamAsnsPartialUpdateParams contains all the parameters to send to the API endpoint + for the ipam asns partial update operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsPartialUpdateParams struct { + + // Data. + Data *models.WritableASN + + /* ID. + + A unique integer value identifying this ASN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsPartialUpdateParams) WithDefaults() *IpamAsnsPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) WithTimeout(timeout time.Duration) *IpamAsnsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) WithContext(ctx context.Context) *IpamAsnsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) WithHTTPClient(client *http.Client) *IpamAsnsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) WithData(data *models.WritableASN) *IpamAsnsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) SetData(data *models.WritableASN) { + o.Data = data +} + +// WithID adds the id to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) WithID(id int64) *IpamAsnsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam asns partial update params +func (o *IpamAsnsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_responses.go new file mode 100644 index 000000000..56fc7a41c --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamAsnsPartialUpdateReader is a Reader for the IpamAsnsPartialUpdate structure. +type IpamAsnsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamAsnsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsPartialUpdateOK creates a IpamAsnsPartialUpdateOK with default headers values +func NewIpamAsnsPartialUpdateOK() *IpamAsnsPartialUpdateOK { + return &IpamAsnsPartialUpdateOK{} +} + +/* IpamAsnsPartialUpdateOK describes a response with status code 200, with default header values. + +IpamAsnsPartialUpdateOK ipam asns partial update o k +*/ +type IpamAsnsPartialUpdateOK struct { + Payload *models.ASN +} + +func (o *IpamAsnsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/asns/{id}/][%d] ipamAsnsPartialUpdateOK %+v", 200, o.Payload) +} +func (o *IpamAsnsPartialUpdateOK) GetPayload() *models.ASN { + return o.Payload +} + +func (o *IpamAsnsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ASN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_parameters.go new file mode 100644 index 000000000..cb164eaed --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamAsnsReadParams creates a new IpamAsnsReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsReadParams() *IpamAsnsReadParams { + return &IpamAsnsReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsReadParamsWithTimeout creates a new IpamAsnsReadParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsReadParamsWithTimeout(timeout time.Duration) *IpamAsnsReadParams { + return &IpamAsnsReadParams{ + timeout: timeout, + } +} + +// NewIpamAsnsReadParamsWithContext creates a new IpamAsnsReadParams object +// with the ability to set a context for a request. +func NewIpamAsnsReadParamsWithContext(ctx context.Context) *IpamAsnsReadParams { + return &IpamAsnsReadParams{ + Context: ctx, + } +} + +// NewIpamAsnsReadParamsWithHTTPClient creates a new IpamAsnsReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsReadParamsWithHTTPClient(client *http.Client) *IpamAsnsReadParams { + return &IpamAsnsReadParams{ + HTTPClient: client, + } +} + +/* IpamAsnsReadParams contains all the parameters to send to the API endpoint + for the ipam asns read operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsReadParams struct { + + /* ID. + + A unique integer value identifying this ASN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsReadParams) WithDefaults() *IpamAsnsReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns read params +func (o *IpamAsnsReadParams) WithTimeout(timeout time.Duration) *IpamAsnsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns read params +func (o *IpamAsnsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns read params +func (o *IpamAsnsReadParams) WithContext(ctx context.Context) *IpamAsnsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns read params +func (o *IpamAsnsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns read params +func (o *IpamAsnsReadParams) WithHTTPClient(client *http.Client) *IpamAsnsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns read params +func (o *IpamAsnsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam asns read params +func (o *IpamAsnsReadParams) WithID(id int64) *IpamAsnsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam asns read params +func (o *IpamAsnsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_responses.go new file mode 100644 index 000000000..88988820c --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamAsnsReadReader is a Reader for the IpamAsnsRead structure. +type IpamAsnsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamAsnsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsReadOK creates a IpamAsnsReadOK with default headers values +func NewIpamAsnsReadOK() *IpamAsnsReadOK { + return &IpamAsnsReadOK{} +} + +/* IpamAsnsReadOK describes a response with status code 200, with default header values. + +IpamAsnsReadOK ipam asns read o k +*/ +type IpamAsnsReadOK struct { + Payload *models.ASN +} + +func (o *IpamAsnsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/asns/{id}/][%d] ipamAsnsReadOK %+v", 200, o.Payload) +} +func (o *IpamAsnsReadOK) GetPayload() *models.ASN { + return o.Payload +} + +func (o *IpamAsnsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ASN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_parameters.go new file mode 100644 index 000000000..fcb6da270 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamAsnsUpdateParams creates a new IpamAsnsUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamAsnsUpdateParams() *IpamAsnsUpdateParams { + return &IpamAsnsUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamAsnsUpdateParamsWithTimeout creates a new IpamAsnsUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamAsnsUpdateParamsWithTimeout(timeout time.Duration) *IpamAsnsUpdateParams { + return &IpamAsnsUpdateParams{ + timeout: timeout, + } +} + +// NewIpamAsnsUpdateParamsWithContext creates a new IpamAsnsUpdateParams object +// with the ability to set a context for a request. +func NewIpamAsnsUpdateParamsWithContext(ctx context.Context) *IpamAsnsUpdateParams { + return &IpamAsnsUpdateParams{ + Context: ctx, + } +} + +// NewIpamAsnsUpdateParamsWithHTTPClient creates a new IpamAsnsUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamAsnsUpdateParamsWithHTTPClient(client *http.Client) *IpamAsnsUpdateParams { + return &IpamAsnsUpdateParams{ + HTTPClient: client, + } +} + +/* IpamAsnsUpdateParams contains all the parameters to send to the API endpoint + for the ipam asns update operation. + + Typically these are written to a http.Request. +*/ +type IpamAsnsUpdateParams struct { + + // Data. + Data *models.WritableASN + + /* ID. + + A unique integer value identifying this ASN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam asns update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsUpdateParams) WithDefaults() *IpamAsnsUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam asns update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamAsnsUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam asns update params +func (o *IpamAsnsUpdateParams) WithTimeout(timeout time.Duration) *IpamAsnsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam asns update params +func (o *IpamAsnsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam asns update params +func (o *IpamAsnsUpdateParams) WithContext(ctx context.Context) *IpamAsnsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam asns update params +func (o *IpamAsnsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam asns update params +func (o *IpamAsnsUpdateParams) WithHTTPClient(client *http.Client) *IpamAsnsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam asns update params +func (o *IpamAsnsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam asns update params +func (o *IpamAsnsUpdateParams) WithData(data *models.WritableASN) *IpamAsnsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam asns update params +func (o *IpamAsnsUpdateParams) SetData(data *models.WritableASN) { + o.Data = data +} + +// WithID adds the id to the ipam asns update params +func (o *IpamAsnsUpdateParams) WithID(id int64) *IpamAsnsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam asns update params +func (o *IpamAsnsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamAsnsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_responses.go new file mode 100644 index 000000000..4aa7e94d4 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_asns_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamAsnsUpdateReader is a Reader for the IpamAsnsUpdate structure. +type IpamAsnsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamAsnsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamAsnsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamAsnsUpdateOK creates a IpamAsnsUpdateOK with default headers values +func NewIpamAsnsUpdateOK() *IpamAsnsUpdateOK { + return &IpamAsnsUpdateOK{} +} + +/* IpamAsnsUpdateOK describes a response with status code 200, with default header values. + +IpamAsnsUpdateOK ipam asns update o k +*/ +type IpamAsnsUpdateOK struct { + Payload *models.ASN +} + +func (o *IpamAsnsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/asns/{id}/][%d] ipamAsnsUpdateOK %+v", 200, o.Payload) +} +func (o *IpamAsnsUpdateOK) GetPayload() *models.ASN { + return o.Payload +} + +func (o *IpamAsnsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ASN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_client.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_client.go index 5e08cc229..81cebf0ad 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_client.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_client.go @@ -63,6 +63,60 @@ type ClientService interface { IpamAggregatesUpdate(params *IpamAggregatesUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAggregatesUpdateOK, error) + IpamAsnsBulkDelete(params *IpamAsnsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsBulkDeleteNoContent, error) + + IpamAsnsBulkPartialUpdate(params *IpamAsnsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsBulkPartialUpdateOK, error) + + IpamAsnsBulkUpdate(params *IpamAsnsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsBulkUpdateOK, error) + + IpamAsnsCreate(params *IpamAsnsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsCreateCreated, error) + + IpamAsnsDelete(params *IpamAsnsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsDeleteNoContent, error) + + IpamAsnsList(params *IpamAsnsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsListOK, error) + + IpamAsnsPartialUpdate(params *IpamAsnsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsPartialUpdateOK, error) + + IpamAsnsRead(params *IpamAsnsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsReadOK, error) + + IpamAsnsUpdate(params *IpamAsnsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsUpdateOK, error) + + IpamFhrpGroupAssignmentsBulkDelete(params *IpamFhrpGroupAssignmentsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsBulkDeleteNoContent, error) + + IpamFhrpGroupAssignmentsBulkPartialUpdate(params *IpamFhrpGroupAssignmentsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsBulkPartialUpdateOK, error) + + IpamFhrpGroupAssignmentsBulkUpdate(params *IpamFhrpGroupAssignmentsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsBulkUpdateOK, error) + + IpamFhrpGroupAssignmentsCreate(params *IpamFhrpGroupAssignmentsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsCreateCreated, error) + + IpamFhrpGroupAssignmentsDelete(params *IpamFhrpGroupAssignmentsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsDeleteNoContent, error) + + IpamFhrpGroupAssignmentsList(params *IpamFhrpGroupAssignmentsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsListOK, error) + + IpamFhrpGroupAssignmentsPartialUpdate(params *IpamFhrpGroupAssignmentsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsPartialUpdateOK, error) + + IpamFhrpGroupAssignmentsRead(params *IpamFhrpGroupAssignmentsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsReadOK, error) + + IpamFhrpGroupAssignmentsUpdate(params *IpamFhrpGroupAssignmentsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsUpdateOK, error) + + IpamFhrpGroupsBulkDelete(params *IpamFhrpGroupsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsBulkDeleteNoContent, error) + + IpamFhrpGroupsBulkPartialUpdate(params *IpamFhrpGroupsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsBulkPartialUpdateOK, error) + + IpamFhrpGroupsBulkUpdate(params *IpamFhrpGroupsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsBulkUpdateOK, error) + + IpamFhrpGroupsCreate(params *IpamFhrpGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsCreateCreated, error) + + IpamFhrpGroupsDelete(params *IpamFhrpGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsDeleteNoContent, error) + + IpamFhrpGroupsList(params *IpamFhrpGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsListOK, error) + + IpamFhrpGroupsPartialUpdate(params *IpamFhrpGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsPartialUpdateOK, error) + + IpamFhrpGroupsRead(params *IpamFhrpGroupsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsReadOK, error) + + IpamFhrpGroupsUpdate(params *IpamFhrpGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsUpdateOK, error) + IpamIPAddressesBulkDelete(params *IpamIPAddressesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkDeleteNoContent, error) IpamIPAddressesBulkPartialUpdate(params *IpamIPAddressesBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkPartialUpdateOK, error) @@ -83,7 +137,7 @@ type ClientService interface { IpamIPRangesAvailableIpsCreate(params *IpamIPRangesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesAvailableIpsCreateCreated, error) - IpamIPRangesAvailableIpsRead(params *IpamIPRangesAvailableIpsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesAvailableIpsReadOK, error) + IpamIPRangesAvailableIpsList(params *IpamIPRangesAvailableIpsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesAvailableIpsListOK, error) IpamIPRangesBulkDelete(params *IpamIPRangesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesBulkDeleteNoContent, error) @@ -105,11 +159,11 @@ type ClientService interface { IpamPrefixesAvailableIpsCreate(params *IpamPrefixesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailableIpsCreateCreated, error) - IpamPrefixesAvailableIpsRead(params *IpamPrefixesAvailableIpsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailableIpsReadOK, error) + IpamPrefixesAvailableIpsList(params *IpamPrefixesAvailableIpsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailableIpsListOK, error) IpamPrefixesAvailablePrefixesCreate(params *IpamPrefixesAvailablePrefixesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailablePrefixesCreateCreated, error) - IpamPrefixesAvailablePrefixesRead(params *IpamPrefixesAvailablePrefixesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailablePrefixesReadOK, error) + IpamPrefixesAvailablePrefixesList(params *IpamPrefixesAvailablePrefixesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailablePrefixesListOK, error) IpamPrefixesBulkDelete(params *IpamPrefixesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesBulkDeleteNoContent, error) @@ -610,22 +664,22 @@ func (a *Client) IpamAggregatesUpdate(params *IpamAggregatesUpdateParams, authIn } /* - IpamIPAddressesBulkDelete ipam ip addresses bulk delete API + IpamAsnsBulkDelete ipam asns bulk delete API */ -func (a *Client) IpamIPAddressesBulkDelete(params *IpamIPAddressesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkDeleteNoContent, error) { +func (a *Client) IpamAsnsBulkDelete(params *IpamAsnsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsBulkDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesBulkDeleteParams() + params = NewIpamAsnsBulkDeleteParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_bulk_delete", + ID: "ipam_asns_bulk_delete", Method: "DELETE", - PathPattern: "/ipam/ip-addresses/", + PathPattern: "/ipam/asns/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesBulkDeleteReader{formats: a.formats}, + Reader: &IpamAsnsBulkDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -638,33 +692,33 @@ func (a *Client) IpamIPAddressesBulkDelete(params *IpamIPAddressesBulkDeletePara if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesBulkDeleteNoContent) + success, ok := result.(*IpamAsnsBulkDeleteNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesBulkPartialUpdate ipam ip addresses bulk partial update API + IpamAsnsBulkPartialUpdate ipam asns bulk partial update API */ -func (a *Client) IpamIPAddressesBulkPartialUpdate(params *IpamIPAddressesBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkPartialUpdateOK, error) { +func (a *Client) IpamAsnsBulkPartialUpdate(params *IpamAsnsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsBulkPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesBulkPartialUpdateParams() + params = NewIpamAsnsBulkPartialUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_bulk_partial_update", + ID: "ipam_asns_bulk_partial_update", Method: "PATCH", - PathPattern: "/ipam/ip-addresses/", + PathPattern: "/ipam/asns/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesBulkPartialUpdateReader{formats: a.formats}, + Reader: &IpamAsnsBulkPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -677,33 +731,33 @@ func (a *Client) IpamIPAddressesBulkPartialUpdate(params *IpamIPAddressesBulkPar if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesBulkPartialUpdateOK) + success, ok := result.(*IpamAsnsBulkPartialUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesBulkUpdate ipam ip addresses bulk update API + IpamAsnsBulkUpdate ipam asns bulk update API */ -func (a *Client) IpamIPAddressesBulkUpdate(params *IpamIPAddressesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkUpdateOK, error) { +func (a *Client) IpamAsnsBulkUpdate(params *IpamAsnsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsBulkUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesBulkUpdateParams() + params = NewIpamAsnsBulkUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_bulk_update", + ID: "ipam_asns_bulk_update", Method: "PUT", - PathPattern: "/ipam/ip-addresses/", + PathPattern: "/ipam/asns/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesBulkUpdateReader{formats: a.formats}, + Reader: &IpamAsnsBulkUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -716,33 +770,33 @@ func (a *Client) IpamIPAddressesBulkUpdate(params *IpamIPAddressesBulkUpdatePara if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesBulkUpdateOK) + success, ok := result.(*IpamAsnsBulkUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesCreate ipam ip addresses create API + IpamAsnsCreate ipam asns create API */ -func (a *Client) IpamIPAddressesCreate(params *IpamIPAddressesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesCreateCreated, error) { +func (a *Client) IpamAsnsCreate(params *IpamAsnsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesCreateParams() + params = NewIpamAsnsCreateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_create", + ID: "ipam_asns_create", Method: "POST", - PathPattern: "/ipam/ip-addresses/", + PathPattern: "/ipam/asns/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesCreateReader{formats: a.formats}, + Reader: &IpamAsnsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -755,33 +809,33 @@ func (a *Client) IpamIPAddressesCreate(params *IpamIPAddressesCreateParams, auth if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesCreateCreated) + success, ok := result.(*IpamAsnsCreateCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesDelete ipam ip addresses delete API + IpamAsnsDelete ipam asns delete API */ -func (a *Client) IpamIPAddressesDelete(params *IpamIPAddressesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesDeleteNoContent, error) { +func (a *Client) IpamAsnsDelete(params *IpamAsnsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesDeleteParams() + params = NewIpamAsnsDeleteParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_delete", + ID: "ipam_asns_delete", Method: "DELETE", - PathPattern: "/ipam/ip-addresses/{id}/", + PathPattern: "/ipam/asns/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesDeleteReader{formats: a.formats}, + Reader: &IpamAsnsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -794,33 +848,33 @@ func (a *Client) IpamIPAddressesDelete(params *IpamIPAddressesDeleteParams, auth if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesDeleteNoContent) + success, ok := result.(*IpamAsnsDeleteNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesList Overrides ListModelMixin to allow processing ExportTemplates. + IpamAsnsList Overrides ListModelMixin to allow processing ExportTemplates. */ -func (a *Client) IpamIPAddressesList(params *IpamIPAddressesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesListOK, error) { +func (a *Client) IpamAsnsList(params *IpamAsnsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesListParams() + params = NewIpamAsnsListParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_list", + ID: "ipam_asns_list", Method: "GET", - PathPattern: "/ipam/ip-addresses/", + PathPattern: "/ipam/asns/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesListReader{formats: a.formats}, + Reader: &IpamAsnsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -833,33 +887,33 @@ func (a *Client) IpamIPAddressesList(params *IpamIPAddressesListParams, authInfo if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesListOK) + success, ok := result.(*IpamAsnsListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesPartialUpdate ipam ip addresses partial update API + IpamAsnsPartialUpdate ipam asns partial update API */ -func (a *Client) IpamIPAddressesPartialUpdate(params *IpamIPAddressesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesPartialUpdateOK, error) { +func (a *Client) IpamAsnsPartialUpdate(params *IpamAsnsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesPartialUpdateParams() + params = NewIpamAsnsPartialUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_partial_update", + ID: "ipam_asns_partial_update", Method: "PATCH", - PathPattern: "/ipam/ip-addresses/{id}/", + PathPattern: "/ipam/asns/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesPartialUpdateReader{formats: a.formats}, + Reader: &IpamAsnsPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -872,33 +926,33 @@ func (a *Client) IpamIPAddressesPartialUpdate(params *IpamIPAddressesPartialUpda if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesPartialUpdateOK) + success, ok := result.(*IpamAsnsPartialUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesRead ipam ip addresses read API + IpamAsnsRead ipam asns read API */ -func (a *Client) IpamIPAddressesRead(params *IpamIPAddressesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesReadOK, error) { +func (a *Client) IpamAsnsRead(params *IpamAsnsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesReadParams() + params = NewIpamAsnsReadParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_read", + ID: "ipam_asns_read", Method: "GET", - PathPattern: "/ipam/ip-addresses/{id}/", + PathPattern: "/ipam/asns/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesReadReader{formats: a.formats}, + Reader: &IpamAsnsReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -911,33 +965,33 @@ func (a *Client) IpamIPAddressesRead(params *IpamIPAddressesReadParams, authInfo if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesReadOK) + success, ok := result.(*IpamAsnsReadOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPAddressesUpdate ipam ip addresses update API + IpamAsnsUpdate ipam asns update API */ -func (a *Client) IpamIPAddressesUpdate(params *IpamIPAddressesUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesUpdateOK, error) { +func (a *Client) IpamAsnsUpdate(params *IpamAsnsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamAsnsUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPAddressesUpdateParams() + params = NewIpamAsnsUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-addresses_update", + ID: "ipam_asns_update", Method: "PUT", - PathPattern: "/ipam/ip-addresses/{id}/", + PathPattern: "/ipam/asns/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPAddressesUpdateReader{formats: a.formats}, + Reader: &IpamAsnsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -950,38 +1004,33 @@ func (a *Client) IpamIPAddressesUpdate(params *IpamIPAddressesUpdateParams, auth if err != nil { return nil, err } - success, ok := result.(*IpamIPAddressesUpdateOK) + success, ok := result.(*IpamAsnsUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_asns_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesAvailableIpsCreate A convenience method for returning available IP addresses within a Prefix or IPRange. By default, the number of -IPs returned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be -passed, however results will not be paginated. - -The advisory lock decorator uses a PostgreSQL advisory lock to prevent this API from being -invoked in parallel, which results in a race condition where multiple insertions can occur. + IpamFhrpGroupAssignmentsBulkDelete ipam fhrp group assignments bulk delete API */ -func (a *Client) IpamIPRangesAvailableIpsCreate(params *IpamIPRangesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesAvailableIpsCreateCreated, error) { +func (a *Client) IpamFhrpGroupAssignmentsBulkDelete(params *IpamFhrpGroupAssignmentsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsBulkDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesAvailableIpsCreateParams() + params = NewIpamFhrpGroupAssignmentsBulkDeleteParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_available-ips_create", - Method: "POST", - PathPattern: "/ipam/ip-ranges/{id}/available-ips/", + ID: "ipam_fhrp-group-assignments_bulk_delete", + Method: "DELETE", + PathPattern: "/ipam/fhrp-group-assignments/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesAvailableIpsCreateReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsBulkDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -994,38 +1043,33 @@ func (a *Client) IpamIPRangesAvailableIpsCreate(params *IpamIPRangesAvailableIps if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesAvailableIpsCreateCreated) + success, ok := result.(*IpamFhrpGroupAssignmentsBulkDeleteNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_available-ips_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesAvailableIpsRead A convenience method for returning available IP addresses within a Prefix or IPRange. By default, the number of -IPs returned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be -passed, however results will not be paginated. - -The advisory lock decorator uses a PostgreSQL advisory lock to prevent this API from being -invoked in parallel, which results in a race condition where multiple insertions can occur. + IpamFhrpGroupAssignmentsBulkPartialUpdate ipam fhrp group assignments bulk partial update API */ -func (a *Client) IpamIPRangesAvailableIpsRead(params *IpamIPRangesAvailableIpsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesAvailableIpsReadOK, error) { +func (a *Client) IpamFhrpGroupAssignmentsBulkPartialUpdate(params *IpamFhrpGroupAssignmentsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsBulkPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesAvailableIpsReadParams() + params = NewIpamFhrpGroupAssignmentsBulkPartialUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_available-ips_read", - Method: "GET", - PathPattern: "/ipam/ip-ranges/{id}/available-ips/", + ID: "ipam_fhrp-group-assignments_bulk_partial_update", + Method: "PATCH", + PathPattern: "/ipam/fhrp-group-assignments/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesAvailableIpsReadReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsBulkPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1038,33 +1082,33 @@ func (a *Client) IpamIPRangesAvailableIpsRead(params *IpamIPRangesAvailableIpsRe if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesAvailableIpsReadOK) + success, ok := result.(*IpamFhrpGroupAssignmentsBulkPartialUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_available-ips_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesBulkDelete ipam ip ranges bulk delete API + IpamFhrpGroupAssignmentsBulkUpdate ipam fhrp group assignments bulk update API */ -func (a *Client) IpamIPRangesBulkDelete(params *IpamIPRangesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesBulkDeleteNoContent, error) { +func (a *Client) IpamFhrpGroupAssignmentsBulkUpdate(params *IpamFhrpGroupAssignmentsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsBulkUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesBulkDeleteParams() + params = NewIpamFhrpGroupAssignmentsBulkUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_bulk_delete", - Method: "DELETE", - PathPattern: "/ipam/ip-ranges/", + ID: "ipam_fhrp-group-assignments_bulk_update", + Method: "PUT", + PathPattern: "/ipam/fhrp-group-assignments/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesBulkDeleteReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsBulkUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1077,33 +1121,33 @@ func (a *Client) IpamIPRangesBulkDelete(params *IpamIPRangesBulkDeleteParams, au if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesBulkDeleteNoContent) + success, ok := result.(*IpamFhrpGroupAssignmentsBulkUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesBulkPartialUpdate ipam ip ranges bulk partial update API + IpamFhrpGroupAssignmentsCreate ipam fhrp group assignments create API */ -func (a *Client) IpamIPRangesBulkPartialUpdate(params *IpamIPRangesBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesBulkPartialUpdateOK, error) { +func (a *Client) IpamFhrpGroupAssignmentsCreate(params *IpamFhrpGroupAssignmentsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesBulkPartialUpdateParams() + params = NewIpamFhrpGroupAssignmentsCreateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_bulk_partial_update", - Method: "PATCH", - PathPattern: "/ipam/ip-ranges/", + ID: "ipam_fhrp-group-assignments_create", + Method: "POST", + PathPattern: "/ipam/fhrp-group-assignments/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesBulkPartialUpdateReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1116,33 +1160,33 @@ func (a *Client) IpamIPRangesBulkPartialUpdate(params *IpamIPRangesBulkPartialUp if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesBulkPartialUpdateOK) + success, ok := result.(*IpamFhrpGroupAssignmentsCreateCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesBulkUpdate ipam ip ranges bulk update API + IpamFhrpGroupAssignmentsDelete ipam fhrp group assignments delete API */ -func (a *Client) IpamIPRangesBulkUpdate(params *IpamIPRangesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesBulkUpdateOK, error) { +func (a *Client) IpamFhrpGroupAssignmentsDelete(params *IpamFhrpGroupAssignmentsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesBulkUpdateParams() + params = NewIpamFhrpGroupAssignmentsDeleteParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_bulk_update", - Method: "PUT", - PathPattern: "/ipam/ip-ranges/", + ID: "ipam_fhrp-group-assignments_delete", + Method: "DELETE", + PathPattern: "/ipam/fhrp-group-assignments/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesBulkUpdateReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1155,33 +1199,33 @@ func (a *Client) IpamIPRangesBulkUpdate(params *IpamIPRangesBulkUpdateParams, au if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesBulkUpdateOK) + success, ok := result.(*IpamFhrpGroupAssignmentsDeleteNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesCreate ipam ip ranges create API + IpamFhrpGroupAssignmentsList Overrides ListModelMixin to allow processing ExportTemplates. */ -func (a *Client) IpamIPRangesCreate(params *IpamIPRangesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesCreateCreated, error) { +func (a *Client) IpamFhrpGroupAssignmentsList(params *IpamFhrpGroupAssignmentsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesCreateParams() + params = NewIpamFhrpGroupAssignmentsListParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_create", - Method: "POST", - PathPattern: "/ipam/ip-ranges/", + ID: "ipam_fhrp-group-assignments_list", + Method: "GET", + PathPattern: "/ipam/fhrp-group-assignments/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesCreateReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1194,33 +1238,33 @@ func (a *Client) IpamIPRangesCreate(params *IpamIPRangesCreateParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesCreateCreated) + success, ok := result.(*IpamFhrpGroupAssignmentsListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesDelete ipam ip ranges delete API + IpamFhrpGroupAssignmentsPartialUpdate ipam fhrp group assignments partial update API */ -func (a *Client) IpamIPRangesDelete(params *IpamIPRangesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesDeleteNoContent, error) { +func (a *Client) IpamFhrpGroupAssignmentsPartialUpdate(params *IpamFhrpGroupAssignmentsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesDeleteParams() + params = NewIpamFhrpGroupAssignmentsPartialUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_delete", - Method: "DELETE", - PathPattern: "/ipam/ip-ranges/{id}/", + ID: "ipam_fhrp-group-assignments_partial_update", + Method: "PATCH", + PathPattern: "/ipam/fhrp-group-assignments/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesDeleteReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1233,33 +1277,33 @@ func (a *Client) IpamIPRangesDelete(params *IpamIPRangesDeleteParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesDeleteNoContent) + success, ok := result.(*IpamFhrpGroupAssignmentsPartialUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesList Overrides ListModelMixin to allow processing ExportTemplates. + IpamFhrpGroupAssignmentsRead ipam fhrp group assignments read API */ -func (a *Client) IpamIPRangesList(params *IpamIPRangesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesListOK, error) { +func (a *Client) IpamFhrpGroupAssignmentsRead(params *IpamFhrpGroupAssignmentsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesListParams() + params = NewIpamFhrpGroupAssignmentsReadParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_list", + ID: "ipam_fhrp-group-assignments_read", Method: "GET", - PathPattern: "/ipam/ip-ranges/", + PathPattern: "/ipam/fhrp-group-assignments/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesListReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1272,33 +1316,33 @@ func (a *Client) IpamIPRangesList(params *IpamIPRangesListParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesListOK) + success, ok := result.(*IpamFhrpGroupAssignmentsReadOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesPartialUpdate ipam ip ranges partial update API + IpamFhrpGroupAssignmentsUpdate ipam fhrp group assignments update API */ -func (a *Client) IpamIPRangesPartialUpdate(params *IpamIPRangesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesPartialUpdateOK, error) { +func (a *Client) IpamFhrpGroupAssignmentsUpdate(params *IpamFhrpGroupAssignmentsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupAssignmentsUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesPartialUpdateParams() + params = NewIpamFhrpGroupAssignmentsUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_partial_update", - Method: "PATCH", - PathPattern: "/ipam/ip-ranges/{id}/", + ID: "ipam_fhrp-group-assignments_update", + Method: "PUT", + PathPattern: "/ipam/fhrp-group-assignments/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesPartialUpdateReader{formats: a.formats}, + Reader: &IpamFhrpGroupAssignmentsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1311,33 +1355,33 @@ func (a *Client) IpamIPRangesPartialUpdate(params *IpamIPRangesPartialUpdatePara if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesPartialUpdateOK) + success, ok := result.(*IpamFhrpGroupAssignmentsUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-group-assignments_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesRead ipam ip ranges read API + IpamFhrpGroupsBulkDelete ipam fhrp groups bulk delete API */ -func (a *Client) IpamIPRangesRead(params *IpamIPRangesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesReadOK, error) { +func (a *Client) IpamFhrpGroupsBulkDelete(params *IpamFhrpGroupsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsBulkDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesReadParams() + params = NewIpamFhrpGroupsBulkDeleteParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_read", - Method: "GET", - PathPattern: "/ipam/ip-ranges/{id}/", + ID: "ipam_fhrp-groups_bulk_delete", + Method: "DELETE", + PathPattern: "/ipam/fhrp-groups/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesReadReader{formats: a.formats}, + Reader: &IpamFhrpGroupsBulkDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1350,33 +1394,33 @@ func (a *Client) IpamIPRangesRead(params *IpamIPRangesReadParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesReadOK) + success, ok := result.(*IpamFhrpGroupsBulkDeleteNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamIPRangesUpdate ipam ip ranges update API + IpamFhrpGroupsBulkPartialUpdate ipam fhrp groups bulk partial update API */ -func (a *Client) IpamIPRangesUpdate(params *IpamIPRangesUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesUpdateOK, error) { +func (a *Client) IpamFhrpGroupsBulkPartialUpdate(params *IpamFhrpGroupsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsBulkPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamIPRangesUpdateParams() + params = NewIpamFhrpGroupsBulkPartialUpdateParams() } op := &runtime.ClientOperation{ - ID: "ipam_ip-ranges_update", - Method: "PUT", - PathPattern: "/ipam/ip-ranges/{id}/", + ID: "ipam_fhrp-groups_bulk_partial_update", + Method: "PATCH", + PathPattern: "/ipam/fhrp-groups/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamIPRangesUpdateReader{formats: a.formats}, + Reader: &IpamFhrpGroupsBulkPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1389,38 +1433,72 @@ func (a *Client) IpamIPRangesUpdate(params *IpamIPRangesUpdateParams, authInfo r if err != nil { return nil, err } - success, ok := result.(*IpamIPRangesUpdateOK) + success, ok := result.(*IpamFhrpGroupsBulkPartialUpdateOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamPrefixesAvailableIpsCreate A convenience method for returning available IP addresses within a Prefix or IPRange. By default, the number of -IPs returned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be -passed, however results will not be paginated. + IpamFhrpGroupsBulkUpdate ipam fhrp groups bulk update API +*/ +func (a *Client) IpamFhrpGroupsBulkUpdate(params *IpamFhrpGroupsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamFhrpGroupsBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_fhrp-groups_bulk_update", + Method: "PUT", + PathPattern: "/ipam/fhrp-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamFhrpGroupsBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamFhrpGroupsBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} -The advisory lock decorator uses a PostgreSQL advisory lock to prevent this API from being -invoked in parallel, which results in a race condition where multiple insertions can occur. +/* + IpamFhrpGroupsCreate ipam fhrp groups create API */ -func (a *Client) IpamPrefixesAvailableIpsCreate(params *IpamPrefixesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailableIpsCreateCreated, error) { +func (a *Client) IpamFhrpGroupsCreate(params *IpamFhrpGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamPrefixesAvailableIpsCreateParams() + params = NewIpamFhrpGroupsCreateParams() } op := &runtime.ClientOperation{ - ID: "ipam_prefixes_available-ips_create", + ID: "ipam_fhrp-groups_create", Method: "POST", - PathPattern: "/ipam/prefixes/{id}/available-ips/", + PathPattern: "/ipam/fhrp-groups/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamPrefixesAvailableIpsCreateReader{formats: a.formats}, + Reader: &IpamFhrpGroupsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1433,38 +1511,33 @@ func (a *Client) IpamPrefixesAvailableIpsCreate(params *IpamPrefixesAvailableIps if err != nil { return nil, err } - success, ok := result.(*IpamPrefixesAvailableIpsCreateCreated) + success, ok := result.(*IpamFhrpGroupsCreateCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-ips_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamPrefixesAvailableIpsRead A convenience method for returning available IP addresses within a Prefix or IPRange. By default, the number of -IPs returned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be -passed, however results will not be paginated. - -The advisory lock decorator uses a PostgreSQL advisory lock to prevent this API from being -invoked in parallel, which results in a race condition where multiple insertions can occur. + IpamFhrpGroupsDelete ipam fhrp groups delete API */ -func (a *Client) IpamPrefixesAvailableIpsRead(params *IpamPrefixesAvailableIpsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailableIpsReadOK, error) { +func (a *Client) IpamFhrpGroupsDelete(params *IpamFhrpGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamPrefixesAvailableIpsReadParams() + params = NewIpamFhrpGroupsDeleteParams() } op := &runtime.ClientOperation{ - ID: "ipam_prefixes_available-ips_read", - Method: "GET", - PathPattern: "/ipam/prefixes/{id}/available-ips/", + ID: "ipam_fhrp-groups_delete", + Method: "DELETE", + PathPattern: "/ipam/fhrp-groups/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamPrefixesAvailableIpsReadReader{formats: a.formats}, + Reader: &IpamFhrpGroupsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1477,36 +1550,33 @@ func (a *Client) IpamPrefixesAvailableIpsRead(params *IpamPrefixesAvailableIpsRe if err != nil { return nil, err } - success, ok := result.(*IpamPrefixesAvailableIpsReadOK) + success, ok := result.(*IpamFhrpGroupsDeleteNoContent) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-ips_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamPrefixesAvailablePrefixesCreate as convenience method for returning available child prefixes within a parent - - The advisory lock decorator uses a PostgreSQL advisory lock to prevent this API from being -invoked in parallel, which results in a race condition where multiple insertions can occur. + IpamFhrpGroupsList Overrides ListModelMixin to allow processing ExportTemplates. */ -func (a *Client) IpamPrefixesAvailablePrefixesCreate(params *IpamPrefixesAvailablePrefixesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailablePrefixesCreateCreated, error) { +func (a *Client) IpamFhrpGroupsList(params *IpamFhrpGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamPrefixesAvailablePrefixesCreateParams() + params = NewIpamFhrpGroupsListParams() } op := &runtime.ClientOperation{ - ID: "ipam_prefixes_available-prefixes_create", - Method: "POST", - PathPattern: "/ipam/prefixes/{id}/available-prefixes/", + ID: "ipam_fhrp-groups_list", + Method: "GET", + PathPattern: "/ipam/fhrp-groups/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamPrefixesAvailablePrefixesCreateReader{formats: a.formats}, + Reader: &IpamFhrpGroupsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1519,36 +1589,1047 @@ func (a *Client) IpamPrefixesAvailablePrefixesCreate(params *IpamPrefixesAvailab if err != nil { return nil, err } - success, ok := result.(*IpamPrefixesAvailablePrefixesCreateCreated) + success, ok := result.(*IpamFhrpGroupsListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-prefixes_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* - IpamPrefixesAvailablePrefixesRead as convenience method for returning available child prefixes within a parent - - The advisory lock decorator uses a PostgreSQL advisory lock to prevent this API from being -invoked in parallel, which results in a race condition where multiple insertions can occur. + IpamFhrpGroupsPartialUpdate ipam fhrp groups partial update API +*/ +func (a *Client) IpamFhrpGroupsPartialUpdate(params *IpamFhrpGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamFhrpGroupsPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_fhrp-groups_partial_update", + Method: "PATCH", + PathPattern: "/ipam/fhrp-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamFhrpGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamFhrpGroupsPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamFhrpGroupsRead ipam fhrp groups read API +*/ +func (a *Client) IpamFhrpGroupsRead(params *IpamFhrpGroupsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamFhrpGroupsReadParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_fhrp-groups_read", + Method: "GET", + PathPattern: "/ipam/fhrp-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamFhrpGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamFhrpGroupsReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamFhrpGroupsUpdate ipam fhrp groups update API +*/ +func (a *Client) IpamFhrpGroupsUpdate(params *IpamFhrpGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamFhrpGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamFhrpGroupsUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_fhrp-groups_update", + Method: "PUT", + PathPattern: "/ipam/fhrp-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamFhrpGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamFhrpGroupsUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_fhrp-groups_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesBulkDelete ipam ip addresses bulk delete API +*/ +func (a *Client) IpamIPAddressesBulkDelete(params *IpamIPAddressesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_bulk_delete", + Method: "DELETE", + PathPattern: "/ipam/ip-addresses/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesBulkPartialUpdate ipam ip addresses bulk partial update API +*/ +func (a *Client) IpamIPAddressesBulkPartialUpdate(params *IpamIPAddressesBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_bulk_partial_update", + Method: "PATCH", + PathPattern: "/ipam/ip-addresses/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesBulkUpdate ipam ip addresses bulk update API +*/ +func (a *Client) IpamIPAddressesBulkUpdate(params *IpamIPAddressesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_bulk_update", + Method: "PUT", + PathPattern: "/ipam/ip-addresses/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesCreate ipam ip addresses create API +*/ +func (a *Client) IpamIPAddressesCreate(params *IpamIPAddressesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesCreateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_create", + Method: "POST", + PathPattern: "/ipam/ip-addresses/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesDelete ipam ip addresses delete API +*/ +func (a *Client) IpamIPAddressesDelete(params *IpamIPAddressesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_delete", + Method: "DELETE", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) IpamIPAddressesList(params *IpamIPAddressesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesListParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_list", + Method: "GET", + PathPattern: "/ipam/ip-addresses/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesPartialUpdate ipam ip addresses partial update API +*/ +func (a *Client) IpamIPAddressesPartialUpdate(params *IpamIPAddressesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_partial_update", + Method: "PATCH", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesRead ipam ip addresses read API +*/ +func (a *Client) IpamIPAddressesRead(params *IpamIPAddressesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesReadParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_read", + Method: "GET", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPAddressesUpdate ipam ip addresses update API +*/ +func (a *Client) IpamIPAddressesUpdate(params *IpamIPAddressesUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPAddressesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPAddressesUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-addresses_update", + Method: "PUT", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPAddressesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPAddressesUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-addresses_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesAvailableIpsCreate ipam ip ranges available ips create API +*/ +func (a *Client) IpamIPRangesAvailableIpsCreate(params *IpamIPRangesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesAvailableIpsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesAvailableIpsCreateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_available-ips_create", + Method: "POST", + PathPattern: "/ipam/ip-ranges/{id}/available-ips/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesAvailableIpsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesAvailableIpsCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_available-ips_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesAvailableIpsList ipam ip ranges available ips list API +*/ +func (a *Client) IpamIPRangesAvailableIpsList(params *IpamIPRangesAvailableIpsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesAvailableIpsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesAvailableIpsListParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_available-ips_list", + Method: "GET", + PathPattern: "/ipam/ip-ranges/{id}/available-ips/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesAvailableIpsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesAvailableIpsListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_available-ips_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesBulkDelete ipam ip ranges bulk delete API +*/ +func (a *Client) IpamIPRangesBulkDelete(params *IpamIPRangesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_bulk_delete", + Method: "DELETE", + PathPattern: "/ipam/ip-ranges/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesBulkPartialUpdate ipam ip ranges bulk partial update API +*/ +func (a *Client) IpamIPRangesBulkPartialUpdate(params *IpamIPRangesBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_bulk_partial_update", + Method: "PATCH", + PathPattern: "/ipam/ip-ranges/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesBulkUpdate ipam ip ranges bulk update API +*/ +func (a *Client) IpamIPRangesBulkUpdate(params *IpamIPRangesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_bulk_update", + Method: "PUT", + PathPattern: "/ipam/ip-ranges/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesCreate ipam ip ranges create API +*/ +func (a *Client) IpamIPRangesCreate(params *IpamIPRangesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesCreateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_create", + Method: "POST", + PathPattern: "/ipam/ip-ranges/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesDelete ipam ip ranges delete API +*/ +func (a *Client) IpamIPRangesDelete(params *IpamIPRangesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_delete", + Method: "DELETE", + PathPattern: "/ipam/ip-ranges/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) IpamIPRangesList(params *IpamIPRangesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesListParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_list", + Method: "GET", + PathPattern: "/ipam/ip-ranges/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesPartialUpdate ipam ip ranges partial update API +*/ +func (a *Client) IpamIPRangesPartialUpdate(params *IpamIPRangesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_partial_update", + Method: "PATCH", + PathPattern: "/ipam/ip-ranges/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesRead ipam ip ranges read API +*/ +func (a *Client) IpamIPRangesRead(params *IpamIPRangesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesReadParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_read", + Method: "GET", + PathPattern: "/ipam/ip-ranges/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamIPRangesUpdate ipam ip ranges update API +*/ +func (a *Client) IpamIPRangesUpdate(params *IpamIPRangesUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamIPRangesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamIPRangesUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_ip-ranges_update", + Method: "PUT", + PathPattern: "/ipam/ip-ranges/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamIPRangesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamIPRangesUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_ip-ranges_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamPrefixesAvailableIpsCreate ipam prefixes available ips create API +*/ +func (a *Client) IpamPrefixesAvailableIpsCreate(params *IpamPrefixesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailableIpsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamPrefixesAvailableIpsCreateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_prefixes_available-ips_create", + Method: "POST", + PathPattern: "/ipam/prefixes/{id}/available-ips/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamPrefixesAvailableIpsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamPrefixesAvailableIpsCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-ips_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamPrefixesAvailableIpsList ipam prefixes available ips list API +*/ +func (a *Client) IpamPrefixesAvailableIpsList(params *IpamPrefixesAvailableIpsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailableIpsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamPrefixesAvailableIpsListParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_prefixes_available-ips_list", + Method: "GET", + PathPattern: "/ipam/prefixes/{id}/available-ips/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamPrefixesAvailableIpsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamPrefixesAvailableIpsListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-ips_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamPrefixesAvailablePrefixesCreate ipam prefixes available prefixes create API +*/ +func (a *Client) IpamPrefixesAvailablePrefixesCreate(params *IpamPrefixesAvailablePrefixesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailablePrefixesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIpamPrefixesAvailablePrefixesCreateParams() + } + op := &runtime.ClientOperation{ + ID: "ipam_prefixes_available-prefixes_create", + Method: "POST", + PathPattern: "/ipam/prefixes/{id}/available-prefixes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IpamPrefixesAvailablePrefixesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*IpamPrefixesAvailablePrefixesCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-prefixes_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + IpamPrefixesAvailablePrefixesList ipam prefixes available prefixes list API */ -func (a *Client) IpamPrefixesAvailablePrefixesRead(params *IpamPrefixesAvailablePrefixesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailablePrefixesReadOK, error) { +func (a *Client) IpamPrefixesAvailablePrefixesList(params *IpamPrefixesAvailablePrefixesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*IpamPrefixesAvailablePrefixesListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewIpamPrefixesAvailablePrefixesReadParams() + params = NewIpamPrefixesAvailablePrefixesListParams() } op := &runtime.ClientOperation{ - ID: "ipam_prefixes_available-prefixes_read", + ID: "ipam_prefixes_available-prefixes_list", Method: "GET", PathPattern: "/ipam/prefixes/{id}/available-prefixes/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &IpamPrefixesAvailablePrefixesReadReader{formats: a.formats}, + Reader: &IpamPrefixesAvailablePrefixesListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1561,13 +2642,13 @@ func (a *Client) IpamPrefixesAvailablePrefixesRead(params *IpamPrefixesAvailable if err != nil { return nil, err } - success, ok := result.(*IpamPrefixesAvailablePrefixesReadOK) + success, ok := result.(*IpamPrefixesAvailablePrefixesListOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-prefixes_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for ipam_prefixes_available-prefixes_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_parameters.go new file mode 100644 index 000000000..92364e29d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewIpamFhrpGroupAssignmentsBulkDeleteParams creates a new IpamFhrpGroupAssignmentsBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsBulkDeleteParams() *IpamFhrpGroupAssignmentsBulkDeleteParams { + return &IpamFhrpGroupAssignmentsBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsBulkDeleteParamsWithTimeout creates a new IpamFhrpGroupAssignmentsBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsBulkDeleteParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsBulkDeleteParams { + return &IpamFhrpGroupAssignmentsBulkDeleteParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsBulkDeleteParamsWithContext creates a new IpamFhrpGroupAssignmentsBulkDeleteParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsBulkDeleteParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsBulkDeleteParams { + return &IpamFhrpGroupAssignmentsBulkDeleteParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsBulkDeleteParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsBulkDeleteParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsBulkDeleteParams { + return &IpamFhrpGroupAssignmentsBulkDeleteParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsBulkDeleteParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments bulk delete operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) WithDefaults() *IpamFhrpGroupAssignmentsBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments bulk delete params +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments bulk delete params +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments bulk delete params +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments bulk delete params +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments bulk delete params +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments bulk delete params +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_responses.go new file mode 100644 index 000000000..454e82120 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IpamFhrpGroupAssignmentsBulkDeleteReader is a Reader for the IpamFhrpGroupAssignmentsBulkDelete structure. +type IpamFhrpGroupAssignmentsBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewIpamFhrpGroupAssignmentsBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsBulkDeleteNoContent creates a IpamFhrpGroupAssignmentsBulkDeleteNoContent with default headers values +func NewIpamFhrpGroupAssignmentsBulkDeleteNoContent() *IpamFhrpGroupAssignmentsBulkDeleteNoContent { + return &IpamFhrpGroupAssignmentsBulkDeleteNoContent{} +} + +/* IpamFhrpGroupAssignmentsBulkDeleteNoContent describes a response with status code 204, with default header values. + +IpamFhrpGroupAssignmentsBulkDeleteNoContent ipam fhrp group assignments bulk delete no content +*/ +type IpamFhrpGroupAssignmentsBulkDeleteNoContent struct { +} + +func (o *IpamFhrpGroupAssignmentsBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/fhrp-group-assignments/][%d] ipamFhrpGroupAssignmentsBulkDeleteNoContent ", 204) +} + +func (o *IpamFhrpGroupAssignmentsBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_parameters.go new file mode 100644 index 000000000..143f8319e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupAssignmentsBulkPartialUpdateParams creates a new IpamFhrpGroupAssignmentsBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsBulkPartialUpdateParams() *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + return &IpamFhrpGroupAssignmentsBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsBulkPartialUpdateParamsWithTimeout creates a new IpamFhrpGroupAssignmentsBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + return &IpamFhrpGroupAssignmentsBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsBulkPartialUpdateParamsWithContext creates a new IpamFhrpGroupAssignmentsBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsBulkPartialUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + return &IpamFhrpGroupAssignmentsBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsBulkPartialUpdateParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + return &IpamFhrpGroupAssignmentsBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableFHRPGroupAssignment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) WithDefaults() *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) WithData(data *models.WritableFHRPGroupAssignment) *IpamFhrpGroupAssignmentsBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp group assignments bulk partial update params +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) SetData(data *models.WritableFHRPGroupAssignment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_responses.go new file mode 100644 index 000000000..2d3804842 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupAssignmentsBulkPartialUpdateReader is a Reader for the IpamFhrpGroupAssignmentsBulkPartialUpdate structure. +type IpamFhrpGroupAssignmentsBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupAssignmentsBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsBulkPartialUpdateOK creates a IpamFhrpGroupAssignmentsBulkPartialUpdateOK with default headers values +func NewIpamFhrpGroupAssignmentsBulkPartialUpdateOK() *IpamFhrpGroupAssignmentsBulkPartialUpdateOK { + return &IpamFhrpGroupAssignmentsBulkPartialUpdateOK{} +} + +/* IpamFhrpGroupAssignmentsBulkPartialUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupAssignmentsBulkPartialUpdateOK ipam fhrp group assignments bulk partial update o k +*/ +type IpamFhrpGroupAssignmentsBulkPartialUpdateOK struct { + Payload *models.FHRPGroupAssignment +} + +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/fhrp-group-assignments/][%d] ipamFhrpGroupAssignmentsBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateOK) GetPayload() *models.FHRPGroupAssignment { + return o.Payload +} + +func (o *IpamFhrpGroupAssignmentsBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroupAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_parameters.go new file mode 100644 index 000000000..92ce054d4 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupAssignmentsBulkUpdateParams creates a new IpamFhrpGroupAssignmentsBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsBulkUpdateParams() *IpamFhrpGroupAssignmentsBulkUpdateParams { + return &IpamFhrpGroupAssignmentsBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsBulkUpdateParamsWithTimeout creates a new IpamFhrpGroupAssignmentsBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsBulkUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsBulkUpdateParams { + return &IpamFhrpGroupAssignmentsBulkUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsBulkUpdateParamsWithContext creates a new IpamFhrpGroupAssignmentsBulkUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsBulkUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsBulkUpdateParams { + return &IpamFhrpGroupAssignmentsBulkUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsBulkUpdateParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsBulkUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsBulkUpdateParams { + return &IpamFhrpGroupAssignmentsBulkUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsBulkUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments bulk update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsBulkUpdateParams struct { + + // Data. + Data *models.WritableFHRPGroupAssignment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) WithDefaults() *IpamFhrpGroupAssignmentsBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) WithData(data *models.WritableFHRPGroupAssignment) *IpamFhrpGroupAssignmentsBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp group assignments bulk update params +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) SetData(data *models.WritableFHRPGroupAssignment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_responses.go new file mode 100644 index 000000000..07c4e55ec --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupAssignmentsBulkUpdateReader is a Reader for the IpamFhrpGroupAssignmentsBulkUpdate structure. +type IpamFhrpGroupAssignmentsBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupAssignmentsBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsBulkUpdateOK creates a IpamFhrpGroupAssignmentsBulkUpdateOK with default headers values +func NewIpamFhrpGroupAssignmentsBulkUpdateOK() *IpamFhrpGroupAssignmentsBulkUpdateOK { + return &IpamFhrpGroupAssignmentsBulkUpdateOK{} +} + +/* IpamFhrpGroupAssignmentsBulkUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupAssignmentsBulkUpdateOK ipam fhrp group assignments bulk update o k +*/ +type IpamFhrpGroupAssignmentsBulkUpdateOK struct { + Payload *models.FHRPGroupAssignment +} + +func (o *IpamFhrpGroupAssignmentsBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/fhrp-group-assignments/][%d] ipamFhrpGroupAssignmentsBulkUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupAssignmentsBulkUpdateOK) GetPayload() *models.FHRPGroupAssignment { + return o.Payload +} + +func (o *IpamFhrpGroupAssignmentsBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroupAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_parameters.go new file mode 100644 index 000000000..22f14ef07 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupAssignmentsCreateParams creates a new IpamFhrpGroupAssignmentsCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsCreateParams() *IpamFhrpGroupAssignmentsCreateParams { + return &IpamFhrpGroupAssignmentsCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsCreateParamsWithTimeout creates a new IpamFhrpGroupAssignmentsCreateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsCreateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsCreateParams { + return &IpamFhrpGroupAssignmentsCreateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsCreateParamsWithContext creates a new IpamFhrpGroupAssignmentsCreateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsCreateParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsCreateParams { + return &IpamFhrpGroupAssignmentsCreateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsCreateParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsCreateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsCreateParams { + return &IpamFhrpGroupAssignmentsCreateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsCreateParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments create operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsCreateParams struct { + + // Data. + Data *models.WritableFHRPGroupAssignment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsCreateParams) WithDefaults() *IpamFhrpGroupAssignmentsCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) WithData(data *models.WritableFHRPGroupAssignment) *IpamFhrpGroupAssignmentsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp group assignments create params +func (o *IpamFhrpGroupAssignmentsCreateParams) SetData(data *models.WritableFHRPGroupAssignment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_responses.go new file mode 100644 index 000000000..c530098eb --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupAssignmentsCreateReader is a Reader for the IpamFhrpGroupAssignmentsCreate structure. +type IpamFhrpGroupAssignmentsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewIpamFhrpGroupAssignmentsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsCreateCreated creates a IpamFhrpGroupAssignmentsCreateCreated with default headers values +func NewIpamFhrpGroupAssignmentsCreateCreated() *IpamFhrpGroupAssignmentsCreateCreated { + return &IpamFhrpGroupAssignmentsCreateCreated{} +} + +/* IpamFhrpGroupAssignmentsCreateCreated describes a response with status code 201, with default header values. + +IpamFhrpGroupAssignmentsCreateCreated ipam fhrp group assignments create created +*/ +type IpamFhrpGroupAssignmentsCreateCreated struct { + Payload *models.FHRPGroupAssignment +} + +func (o *IpamFhrpGroupAssignmentsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/fhrp-group-assignments/][%d] ipamFhrpGroupAssignmentsCreateCreated %+v", 201, o.Payload) +} +func (o *IpamFhrpGroupAssignmentsCreateCreated) GetPayload() *models.FHRPGroupAssignment { + return o.Payload +} + +func (o *IpamFhrpGroupAssignmentsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroupAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_parameters.go new file mode 100644 index 000000000..6ed132d35 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamFhrpGroupAssignmentsDeleteParams creates a new IpamFhrpGroupAssignmentsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsDeleteParams() *IpamFhrpGroupAssignmentsDeleteParams { + return &IpamFhrpGroupAssignmentsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsDeleteParamsWithTimeout creates a new IpamFhrpGroupAssignmentsDeleteParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsDeleteParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsDeleteParams { + return &IpamFhrpGroupAssignmentsDeleteParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsDeleteParamsWithContext creates a new IpamFhrpGroupAssignmentsDeleteParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsDeleteParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsDeleteParams { + return &IpamFhrpGroupAssignmentsDeleteParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsDeleteParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsDeleteParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsDeleteParams { + return &IpamFhrpGroupAssignmentsDeleteParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsDeleteParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments delete operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsDeleteParams struct { + + /* ID. + + A unique integer value identifying this FHRP group assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsDeleteParams) WithDefaults() *IpamFhrpGroupAssignmentsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) WithID(id int64) *IpamFhrpGroupAssignmentsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp group assignments delete params +func (o *IpamFhrpGroupAssignmentsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_responses.go new file mode 100644 index 000000000..d586b2712 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IpamFhrpGroupAssignmentsDeleteReader is a Reader for the IpamFhrpGroupAssignmentsDelete structure. +type IpamFhrpGroupAssignmentsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewIpamFhrpGroupAssignmentsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsDeleteNoContent creates a IpamFhrpGroupAssignmentsDeleteNoContent with default headers values +func NewIpamFhrpGroupAssignmentsDeleteNoContent() *IpamFhrpGroupAssignmentsDeleteNoContent { + return &IpamFhrpGroupAssignmentsDeleteNoContent{} +} + +/* IpamFhrpGroupAssignmentsDeleteNoContent describes a response with status code 204, with default header values. + +IpamFhrpGroupAssignmentsDeleteNoContent ipam fhrp group assignments delete no content +*/ +type IpamFhrpGroupAssignmentsDeleteNoContent struct { +} + +func (o *IpamFhrpGroupAssignmentsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/fhrp-group-assignments/{id}/][%d] ipamFhrpGroupAssignmentsDeleteNoContent ", 204) +} + +func (o *IpamFhrpGroupAssignmentsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_parameters.go new file mode 100644 index 000000000..dedaafbf9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_parameters.go @@ -0,0 +1,1079 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamFhrpGroupAssignmentsListParams creates a new IpamFhrpGroupAssignmentsListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsListParams() *IpamFhrpGroupAssignmentsListParams { + return &IpamFhrpGroupAssignmentsListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsListParamsWithTimeout creates a new IpamFhrpGroupAssignmentsListParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsListParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsListParams { + return &IpamFhrpGroupAssignmentsListParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsListParamsWithContext creates a new IpamFhrpGroupAssignmentsListParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsListParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsListParams { + return &IpamFhrpGroupAssignmentsListParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsListParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsListParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsListParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsListParams { + return &IpamFhrpGroupAssignmentsListParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsListParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments list operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsListParams struct { + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // GroupID. + GroupID *string + + // GroupIDn. + GroupIDn *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // InterfaceID. + InterfaceID *string + + // InterfaceIDGt. + InterfaceIDGt *string + + // InterfaceIDGte. + InterfaceIDGte *string + + // InterfaceIDLt. + InterfaceIDLt *string + + // InterfaceIDLte. + InterfaceIDLte *string + + // InterfaceIDn. + InterfaceIDn *string + + // InterfaceType. + InterfaceType *string + + // InterfaceTypen. + InterfaceTypen *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Priority. + Priority *string + + // PriorityGt. + PriorityGt *string + + // PriorityGte. + PriorityGte *string + + // PriorityLt. + PriorityLt *string + + // PriorityLte. + PriorityLte *string + + // Priorityn. + Priorityn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsListParams) WithDefaults() *IpamFhrpGroupAssignmentsListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreated adds the created to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithCreated(created *string) *IpamFhrpGroupAssignmentsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithCreatedGte(createdGte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithCreatedLte(createdLte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithGroupID adds the groupID to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithGroupID(groupID *string) *IpamFhrpGroupAssignmentsListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithGroupIDn adds the groupIDn to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithGroupIDn(groupIDn *string) *IpamFhrpGroupAssignmentsListParams { + o.SetGroupIDn(groupIDn) + return o +} + +// SetGroupIDn adds the groupIdN to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetGroupIDn(groupIDn *string) { + o.GroupIDn = groupIDn +} + +// WithID adds the id to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithID(id *string) *IpamFhrpGroupAssignmentsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithIDGt(iDGt *string) *IpamFhrpGroupAssignmentsListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithIDGte(iDGte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithIDLt(iDLt *string) *IpamFhrpGroupAssignmentsListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithIDLte(iDLte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithIDn(iDn *string) *IpamFhrpGroupAssignmentsListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithInterfaceID adds the interfaceID to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceID(interfaceID *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceID(interfaceID) + return o +} + +// SetInterfaceID adds the interfaceId to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceID(interfaceID *string) { + o.InterfaceID = interfaceID +} + +// WithInterfaceIDGt adds the interfaceIDGt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceIDGt(interfaceIDGt *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceIDGt(interfaceIDGt) + return o +} + +// SetInterfaceIDGt adds the interfaceIdGt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceIDGt(interfaceIDGt *string) { + o.InterfaceIDGt = interfaceIDGt +} + +// WithInterfaceIDGte adds the interfaceIDGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceIDGte(interfaceIDGte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceIDGte(interfaceIDGte) + return o +} + +// SetInterfaceIDGte adds the interfaceIdGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceIDGte(interfaceIDGte *string) { + o.InterfaceIDGte = interfaceIDGte +} + +// WithInterfaceIDLt adds the interfaceIDLt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceIDLt(interfaceIDLt *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceIDLt(interfaceIDLt) + return o +} + +// SetInterfaceIDLt adds the interfaceIdLt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceIDLt(interfaceIDLt *string) { + o.InterfaceIDLt = interfaceIDLt +} + +// WithInterfaceIDLte adds the interfaceIDLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceIDLte(interfaceIDLte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceIDLte(interfaceIDLte) + return o +} + +// SetInterfaceIDLte adds the interfaceIdLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceIDLte(interfaceIDLte *string) { + o.InterfaceIDLte = interfaceIDLte +} + +// WithInterfaceIDn adds the interfaceIDn to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceIDn(interfaceIDn *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceIDn(interfaceIDn) + return o +} + +// SetInterfaceIDn adds the interfaceIdN to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceIDn(interfaceIDn *string) { + o.InterfaceIDn = interfaceIDn +} + +// WithInterfaceType adds the interfaceType to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceType(interfaceType *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceType(interfaceType) + return o +} + +// SetInterfaceType adds the interfaceType to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceType(interfaceType *string) { + o.InterfaceType = interfaceType +} + +// WithInterfaceTypen adds the interfaceTypen to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithInterfaceTypen(interfaceTypen *string) *IpamFhrpGroupAssignmentsListParams { + o.SetInterfaceTypen(interfaceTypen) + return o +} + +// SetInterfaceTypen adds the interfaceTypeN to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetInterfaceTypen(interfaceTypen *string) { + o.InterfaceTypen = interfaceTypen +} + +// WithLastUpdated adds the lastUpdated to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithLastUpdated(lastUpdated *string) *IpamFhrpGroupAssignmentsListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithLastUpdatedGte(lastUpdatedGte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithLastUpdatedLte(lastUpdatedLte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithLimit(limit *int64) *IpamFhrpGroupAssignmentsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithOffset(offset *int64) *IpamFhrpGroupAssignmentsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPriority adds the priority to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithPriority(priority *string) *IpamFhrpGroupAssignmentsListParams { + o.SetPriority(priority) + return o +} + +// SetPriority adds the priority to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetPriority(priority *string) { + o.Priority = priority +} + +// WithPriorityGt adds the priorityGt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithPriorityGt(priorityGt *string) *IpamFhrpGroupAssignmentsListParams { + o.SetPriorityGt(priorityGt) + return o +} + +// SetPriorityGt adds the priorityGt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetPriorityGt(priorityGt *string) { + o.PriorityGt = priorityGt +} + +// WithPriorityGte adds the priorityGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithPriorityGte(priorityGte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetPriorityGte(priorityGte) + return o +} + +// SetPriorityGte adds the priorityGte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetPriorityGte(priorityGte *string) { + o.PriorityGte = priorityGte +} + +// WithPriorityLt adds the priorityLt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithPriorityLt(priorityLt *string) *IpamFhrpGroupAssignmentsListParams { + o.SetPriorityLt(priorityLt) + return o +} + +// SetPriorityLt adds the priorityLt to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetPriorityLt(priorityLt *string) { + o.PriorityLt = priorityLt +} + +// WithPriorityLte adds the priorityLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithPriorityLte(priorityLte *string) *IpamFhrpGroupAssignmentsListParams { + o.SetPriorityLte(priorityLte) + return o +} + +// SetPriorityLte adds the priorityLte to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetPriorityLte(priorityLte *string) { + o.PriorityLte = priorityLte +} + +// WithPriorityn adds the priorityn to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) WithPriorityn(priorityn *string) *IpamFhrpGroupAssignmentsListParams { + o.SetPriorityn(priorityn) + return o +} + +// SetPriorityn adds the priorityN to the ipam fhrp group assignments list params +func (o *IpamFhrpGroupAssignmentsListParams) SetPriorityn(priorityn *string) { + o.Priorityn = priorityn +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + } + + if o.GroupIDn != nil { + + // query param group_id__n + var qrGroupIDn string + + if o.GroupIDn != nil { + qrGroupIDn = *o.GroupIDn + } + qGroupIDn := qrGroupIDn + if qGroupIDn != "" { + + if err := r.SetQueryParam("group_id__n", qGroupIDn); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.InterfaceID != nil { + + // query param interface_id + var qrInterfaceID string + + if o.InterfaceID != nil { + qrInterfaceID = *o.InterfaceID + } + qInterfaceID := qrInterfaceID + if qInterfaceID != "" { + + if err := r.SetQueryParam("interface_id", qInterfaceID); err != nil { + return err + } + } + } + + if o.InterfaceIDGt != nil { + + // query param interface_id__gt + var qrInterfaceIDGt string + + if o.InterfaceIDGt != nil { + qrInterfaceIDGt = *o.InterfaceIDGt + } + qInterfaceIDGt := qrInterfaceIDGt + if qInterfaceIDGt != "" { + + if err := r.SetQueryParam("interface_id__gt", qInterfaceIDGt); err != nil { + return err + } + } + } + + if o.InterfaceIDGte != nil { + + // query param interface_id__gte + var qrInterfaceIDGte string + + if o.InterfaceIDGte != nil { + qrInterfaceIDGte = *o.InterfaceIDGte + } + qInterfaceIDGte := qrInterfaceIDGte + if qInterfaceIDGte != "" { + + if err := r.SetQueryParam("interface_id__gte", qInterfaceIDGte); err != nil { + return err + } + } + } + + if o.InterfaceIDLt != nil { + + // query param interface_id__lt + var qrInterfaceIDLt string + + if o.InterfaceIDLt != nil { + qrInterfaceIDLt = *o.InterfaceIDLt + } + qInterfaceIDLt := qrInterfaceIDLt + if qInterfaceIDLt != "" { + + if err := r.SetQueryParam("interface_id__lt", qInterfaceIDLt); err != nil { + return err + } + } + } + + if o.InterfaceIDLte != nil { + + // query param interface_id__lte + var qrInterfaceIDLte string + + if o.InterfaceIDLte != nil { + qrInterfaceIDLte = *o.InterfaceIDLte + } + qInterfaceIDLte := qrInterfaceIDLte + if qInterfaceIDLte != "" { + + if err := r.SetQueryParam("interface_id__lte", qInterfaceIDLte); err != nil { + return err + } + } + } + + if o.InterfaceIDn != nil { + + // query param interface_id__n + var qrInterfaceIDn string + + if o.InterfaceIDn != nil { + qrInterfaceIDn = *o.InterfaceIDn + } + qInterfaceIDn := qrInterfaceIDn + if qInterfaceIDn != "" { + + if err := r.SetQueryParam("interface_id__n", qInterfaceIDn); err != nil { + return err + } + } + } + + if o.InterfaceType != nil { + + // query param interface_type + var qrInterfaceType string + + if o.InterfaceType != nil { + qrInterfaceType = *o.InterfaceType + } + qInterfaceType := qrInterfaceType + if qInterfaceType != "" { + + if err := r.SetQueryParam("interface_type", qInterfaceType); err != nil { + return err + } + } + } + + if o.InterfaceTypen != nil { + + // query param interface_type__n + var qrInterfaceTypen string + + if o.InterfaceTypen != nil { + qrInterfaceTypen = *o.InterfaceTypen + } + qInterfaceTypen := qrInterfaceTypen + if qInterfaceTypen != "" { + + if err := r.SetQueryParam("interface_type__n", qInterfaceTypen); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Priority != nil { + + // query param priority + var qrPriority string + + if o.Priority != nil { + qrPriority = *o.Priority + } + qPriority := qrPriority + if qPriority != "" { + + if err := r.SetQueryParam("priority", qPriority); err != nil { + return err + } + } + } + + if o.PriorityGt != nil { + + // query param priority__gt + var qrPriorityGt string + + if o.PriorityGt != nil { + qrPriorityGt = *o.PriorityGt + } + qPriorityGt := qrPriorityGt + if qPriorityGt != "" { + + if err := r.SetQueryParam("priority__gt", qPriorityGt); err != nil { + return err + } + } + } + + if o.PriorityGte != nil { + + // query param priority__gte + var qrPriorityGte string + + if o.PriorityGte != nil { + qrPriorityGte = *o.PriorityGte + } + qPriorityGte := qrPriorityGte + if qPriorityGte != "" { + + if err := r.SetQueryParam("priority__gte", qPriorityGte); err != nil { + return err + } + } + } + + if o.PriorityLt != nil { + + // query param priority__lt + var qrPriorityLt string + + if o.PriorityLt != nil { + qrPriorityLt = *o.PriorityLt + } + qPriorityLt := qrPriorityLt + if qPriorityLt != "" { + + if err := r.SetQueryParam("priority__lt", qPriorityLt); err != nil { + return err + } + } + } + + if o.PriorityLte != nil { + + // query param priority__lte + var qrPriorityLte string + + if o.PriorityLte != nil { + qrPriorityLte = *o.PriorityLte + } + qPriorityLte := qrPriorityLte + if qPriorityLte != "" { + + if err := r.SetQueryParam("priority__lte", qPriorityLte); err != nil { + return err + } + } + } + + if o.Priorityn != nil { + + // query param priority__n + var qrPriorityn string + + if o.Priorityn != nil { + qrPriorityn = *o.Priorityn + } + qPriorityn := qrPriorityn + if qPriorityn != "" { + + if err := r.SetQueryParam("priority__n", qPriorityn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_responses.go new file mode 100644 index 000000000..a05891568 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupAssignmentsListReader is a Reader for the IpamFhrpGroupAssignmentsList structure. +type IpamFhrpGroupAssignmentsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupAssignmentsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsListOK creates a IpamFhrpGroupAssignmentsListOK with default headers values +func NewIpamFhrpGroupAssignmentsListOK() *IpamFhrpGroupAssignmentsListOK { + return &IpamFhrpGroupAssignmentsListOK{} +} + +/* IpamFhrpGroupAssignmentsListOK describes a response with status code 200, with default header values. + +IpamFhrpGroupAssignmentsListOK ipam fhrp group assignments list o k +*/ +type IpamFhrpGroupAssignmentsListOK struct { + Payload *IpamFhrpGroupAssignmentsListOKBody +} + +func (o *IpamFhrpGroupAssignmentsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/fhrp-group-assignments/][%d] ipamFhrpGroupAssignmentsListOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupAssignmentsListOK) GetPayload() *IpamFhrpGroupAssignmentsListOKBody { + return o.Payload +} + +func (o *IpamFhrpGroupAssignmentsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IpamFhrpGroupAssignmentsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IpamFhrpGroupAssignmentsListOKBody ipam fhrp group assignments list o k body +swagger:model IpamFhrpGroupAssignmentsListOKBody +*/ +type IpamFhrpGroupAssignmentsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.FHRPGroupAssignment `json:"results"` +} + +// Validate validates this ipam fhrp group assignments list o k body +func (o *IpamFhrpGroupAssignmentsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IpamFhrpGroupAssignmentsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamFhrpGroupAssignmentsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IpamFhrpGroupAssignmentsListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamFhrpGroupAssignmentsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IpamFhrpGroupAssignmentsListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamFhrpGroupAssignmentsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IpamFhrpGroupAssignmentsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamFhrpGroupAssignmentsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamFhrpGroupAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipamFhrpGroupAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this ipam fhrp group assignments list o k body based on the context it is used +func (o *IpamFhrpGroupAssignmentsListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IpamFhrpGroupAssignmentsListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamFhrpGroupAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipamFhrpGroupAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IpamFhrpGroupAssignmentsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IpamFhrpGroupAssignmentsListOKBody) UnmarshalBinary(b []byte) error { + var res IpamFhrpGroupAssignmentsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_parameters.go new file mode 100644 index 000000000..9ccecd906 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupAssignmentsPartialUpdateParams creates a new IpamFhrpGroupAssignmentsPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsPartialUpdateParams() *IpamFhrpGroupAssignmentsPartialUpdateParams { + return &IpamFhrpGroupAssignmentsPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsPartialUpdateParamsWithTimeout creates a new IpamFhrpGroupAssignmentsPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsPartialUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsPartialUpdateParams { + return &IpamFhrpGroupAssignmentsPartialUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsPartialUpdateParamsWithContext creates a new IpamFhrpGroupAssignmentsPartialUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsPartialUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsPartialUpdateParams { + return &IpamFhrpGroupAssignmentsPartialUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsPartialUpdateParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsPartialUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsPartialUpdateParams { + return &IpamFhrpGroupAssignmentsPartialUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsPartialUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments partial update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsPartialUpdateParams struct { + + // Data. + Data *models.WritableFHRPGroupAssignment + + /* ID. + + A unique integer value identifying this FHRP group assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) WithDefaults() *IpamFhrpGroupAssignmentsPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) WithData(data *models.WritableFHRPGroupAssignment) *IpamFhrpGroupAssignmentsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) SetData(data *models.WritableFHRPGroupAssignment) { + o.Data = data +} + +// WithID adds the id to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) WithID(id int64) *IpamFhrpGroupAssignmentsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp group assignments partial update params +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_responses.go new file mode 100644 index 000000000..1fb61c818 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupAssignmentsPartialUpdateReader is a Reader for the IpamFhrpGroupAssignmentsPartialUpdate structure. +type IpamFhrpGroupAssignmentsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupAssignmentsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsPartialUpdateOK creates a IpamFhrpGroupAssignmentsPartialUpdateOK with default headers values +func NewIpamFhrpGroupAssignmentsPartialUpdateOK() *IpamFhrpGroupAssignmentsPartialUpdateOK { + return &IpamFhrpGroupAssignmentsPartialUpdateOK{} +} + +/* IpamFhrpGroupAssignmentsPartialUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupAssignmentsPartialUpdateOK ipam fhrp group assignments partial update o k +*/ +type IpamFhrpGroupAssignmentsPartialUpdateOK struct { + Payload *models.FHRPGroupAssignment +} + +func (o *IpamFhrpGroupAssignmentsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/fhrp-group-assignments/{id}/][%d] ipamFhrpGroupAssignmentsPartialUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupAssignmentsPartialUpdateOK) GetPayload() *models.FHRPGroupAssignment { + return o.Payload +} + +func (o *IpamFhrpGroupAssignmentsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroupAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_parameters.go new file mode 100644 index 000000000..daf7f084c --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamFhrpGroupAssignmentsReadParams creates a new IpamFhrpGroupAssignmentsReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsReadParams() *IpamFhrpGroupAssignmentsReadParams { + return &IpamFhrpGroupAssignmentsReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsReadParamsWithTimeout creates a new IpamFhrpGroupAssignmentsReadParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsReadParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsReadParams { + return &IpamFhrpGroupAssignmentsReadParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsReadParamsWithContext creates a new IpamFhrpGroupAssignmentsReadParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsReadParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsReadParams { + return &IpamFhrpGroupAssignmentsReadParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsReadParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsReadParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsReadParams { + return &IpamFhrpGroupAssignmentsReadParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsReadParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments read operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsReadParams struct { + + /* ID. + + A unique integer value identifying this FHRP group assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsReadParams) WithDefaults() *IpamFhrpGroupAssignmentsReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) WithID(id int64) *IpamFhrpGroupAssignmentsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp group assignments read params +func (o *IpamFhrpGroupAssignmentsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_responses.go new file mode 100644 index 000000000..be7b0c7ea --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupAssignmentsReadReader is a Reader for the IpamFhrpGroupAssignmentsRead structure. +type IpamFhrpGroupAssignmentsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupAssignmentsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsReadOK creates a IpamFhrpGroupAssignmentsReadOK with default headers values +func NewIpamFhrpGroupAssignmentsReadOK() *IpamFhrpGroupAssignmentsReadOK { + return &IpamFhrpGroupAssignmentsReadOK{} +} + +/* IpamFhrpGroupAssignmentsReadOK describes a response with status code 200, with default header values. + +IpamFhrpGroupAssignmentsReadOK ipam fhrp group assignments read o k +*/ +type IpamFhrpGroupAssignmentsReadOK struct { + Payload *models.FHRPGroupAssignment +} + +func (o *IpamFhrpGroupAssignmentsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/fhrp-group-assignments/{id}/][%d] ipamFhrpGroupAssignmentsReadOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupAssignmentsReadOK) GetPayload() *models.FHRPGroupAssignment { + return o.Payload +} + +func (o *IpamFhrpGroupAssignmentsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroupAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_parameters.go new file mode 100644 index 000000000..ad6dca7e1 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupAssignmentsUpdateParams creates a new IpamFhrpGroupAssignmentsUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupAssignmentsUpdateParams() *IpamFhrpGroupAssignmentsUpdateParams { + return &IpamFhrpGroupAssignmentsUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupAssignmentsUpdateParamsWithTimeout creates a new IpamFhrpGroupAssignmentsUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupAssignmentsUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsUpdateParams { + return &IpamFhrpGroupAssignmentsUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupAssignmentsUpdateParamsWithContext creates a new IpamFhrpGroupAssignmentsUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupAssignmentsUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupAssignmentsUpdateParams { + return &IpamFhrpGroupAssignmentsUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupAssignmentsUpdateParamsWithHTTPClient creates a new IpamFhrpGroupAssignmentsUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupAssignmentsUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsUpdateParams { + return &IpamFhrpGroupAssignmentsUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupAssignmentsUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp group assignments update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupAssignmentsUpdateParams struct { + + // Data. + Data *models.WritableFHRPGroupAssignment + + /* ID. + + A unique integer value identifying this FHRP group assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp group assignments update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsUpdateParams) WithDefaults() *IpamFhrpGroupAssignmentsUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp group assignments update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupAssignmentsUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupAssignmentsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupAssignmentsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupAssignmentsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) WithData(data *models.WritableFHRPGroupAssignment) *IpamFhrpGroupAssignmentsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) SetData(data *models.WritableFHRPGroupAssignment) { + o.Data = data +} + +// WithID adds the id to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) WithID(id int64) *IpamFhrpGroupAssignmentsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp group assignments update params +func (o *IpamFhrpGroupAssignmentsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupAssignmentsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_responses.go new file mode 100644 index 000000000..d1c82b294 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_group_assignments_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupAssignmentsUpdateReader is a Reader for the IpamFhrpGroupAssignmentsUpdate structure. +type IpamFhrpGroupAssignmentsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupAssignmentsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupAssignmentsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupAssignmentsUpdateOK creates a IpamFhrpGroupAssignmentsUpdateOK with default headers values +func NewIpamFhrpGroupAssignmentsUpdateOK() *IpamFhrpGroupAssignmentsUpdateOK { + return &IpamFhrpGroupAssignmentsUpdateOK{} +} + +/* IpamFhrpGroupAssignmentsUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupAssignmentsUpdateOK ipam fhrp group assignments update o k +*/ +type IpamFhrpGroupAssignmentsUpdateOK struct { + Payload *models.FHRPGroupAssignment +} + +func (o *IpamFhrpGroupAssignmentsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/fhrp-group-assignments/{id}/][%d] ipamFhrpGroupAssignmentsUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupAssignmentsUpdateOK) GetPayload() *models.FHRPGroupAssignment { + return o.Payload +} + +func (o *IpamFhrpGroupAssignmentsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroupAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_parameters.go new file mode 100644 index 000000000..923bdf3d9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewIpamFhrpGroupsBulkDeleteParams creates a new IpamFhrpGroupsBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsBulkDeleteParams() *IpamFhrpGroupsBulkDeleteParams { + return &IpamFhrpGroupsBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsBulkDeleteParamsWithTimeout creates a new IpamFhrpGroupsBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsBulkDeleteParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsBulkDeleteParams { + return &IpamFhrpGroupsBulkDeleteParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsBulkDeleteParamsWithContext creates a new IpamFhrpGroupsBulkDeleteParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsBulkDeleteParamsWithContext(ctx context.Context) *IpamFhrpGroupsBulkDeleteParams { + return &IpamFhrpGroupsBulkDeleteParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsBulkDeleteParamsWithHTTPClient creates a new IpamFhrpGroupsBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsBulkDeleteParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsBulkDeleteParams { + return &IpamFhrpGroupsBulkDeleteParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsBulkDeleteParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups bulk delete operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsBulkDeleteParams) WithDefaults() *IpamFhrpGroupsBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups bulk delete params +func (o *IpamFhrpGroupsBulkDeleteParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups bulk delete params +func (o *IpamFhrpGroupsBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups bulk delete params +func (o *IpamFhrpGroupsBulkDeleteParams) WithContext(ctx context.Context) *IpamFhrpGroupsBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups bulk delete params +func (o *IpamFhrpGroupsBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups bulk delete params +func (o *IpamFhrpGroupsBulkDeleteParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups bulk delete params +func (o *IpamFhrpGroupsBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_responses.go new file mode 100644 index 000000000..2a6c849d5 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IpamFhrpGroupsBulkDeleteReader is a Reader for the IpamFhrpGroupsBulkDelete structure. +type IpamFhrpGroupsBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewIpamFhrpGroupsBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsBulkDeleteNoContent creates a IpamFhrpGroupsBulkDeleteNoContent with default headers values +func NewIpamFhrpGroupsBulkDeleteNoContent() *IpamFhrpGroupsBulkDeleteNoContent { + return &IpamFhrpGroupsBulkDeleteNoContent{} +} + +/* IpamFhrpGroupsBulkDeleteNoContent describes a response with status code 204, with default header values. + +IpamFhrpGroupsBulkDeleteNoContent ipam fhrp groups bulk delete no content +*/ +type IpamFhrpGroupsBulkDeleteNoContent struct { +} + +func (o *IpamFhrpGroupsBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/fhrp-groups/][%d] ipamFhrpGroupsBulkDeleteNoContent ", 204) +} + +func (o *IpamFhrpGroupsBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_parameters.go new file mode 100644 index 000000000..a3b4985b9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupsBulkPartialUpdateParams creates a new IpamFhrpGroupsBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsBulkPartialUpdateParams() *IpamFhrpGroupsBulkPartialUpdateParams { + return &IpamFhrpGroupsBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsBulkPartialUpdateParamsWithTimeout creates a new IpamFhrpGroupsBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsBulkPartialUpdateParams { + return &IpamFhrpGroupsBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsBulkPartialUpdateParamsWithContext creates a new IpamFhrpGroupsBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsBulkPartialUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupsBulkPartialUpdateParams { + return &IpamFhrpGroupsBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsBulkPartialUpdateParamsWithHTTPClient creates a new IpamFhrpGroupsBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsBulkPartialUpdateParams { + return &IpamFhrpGroupsBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsBulkPartialUpdateParams struct { + + // Data. + Data *models.FHRPGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsBulkPartialUpdateParams) WithDefaults() *IpamFhrpGroupsBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupsBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) WithData(data *models.FHRPGroup) *IpamFhrpGroupsBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp groups bulk partial update params +func (o *IpamFhrpGroupsBulkPartialUpdateParams) SetData(data *models.FHRPGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_responses.go new file mode 100644 index 000000000..875c48703 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupsBulkPartialUpdateReader is a Reader for the IpamFhrpGroupsBulkPartialUpdate structure. +type IpamFhrpGroupsBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupsBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsBulkPartialUpdateOK creates a IpamFhrpGroupsBulkPartialUpdateOK with default headers values +func NewIpamFhrpGroupsBulkPartialUpdateOK() *IpamFhrpGroupsBulkPartialUpdateOK { + return &IpamFhrpGroupsBulkPartialUpdateOK{} +} + +/* IpamFhrpGroupsBulkPartialUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupsBulkPartialUpdateOK ipam fhrp groups bulk partial update o k +*/ +type IpamFhrpGroupsBulkPartialUpdateOK struct { + Payload *models.FHRPGroup +} + +func (o *IpamFhrpGroupsBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/fhrp-groups/][%d] ipamFhrpGroupsBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupsBulkPartialUpdateOK) GetPayload() *models.FHRPGroup { + return o.Payload +} + +func (o *IpamFhrpGroupsBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_parameters.go new file mode 100644 index 000000000..aef6d6433 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupsBulkUpdateParams creates a new IpamFhrpGroupsBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsBulkUpdateParams() *IpamFhrpGroupsBulkUpdateParams { + return &IpamFhrpGroupsBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsBulkUpdateParamsWithTimeout creates a new IpamFhrpGroupsBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsBulkUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsBulkUpdateParams { + return &IpamFhrpGroupsBulkUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsBulkUpdateParamsWithContext creates a new IpamFhrpGroupsBulkUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsBulkUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupsBulkUpdateParams { + return &IpamFhrpGroupsBulkUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsBulkUpdateParamsWithHTTPClient creates a new IpamFhrpGroupsBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsBulkUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsBulkUpdateParams { + return &IpamFhrpGroupsBulkUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsBulkUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups bulk update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsBulkUpdateParams struct { + + // Data. + Data *models.FHRPGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsBulkUpdateParams) WithDefaults() *IpamFhrpGroupsBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupsBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) WithData(data *models.FHRPGroup) *IpamFhrpGroupsBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp groups bulk update params +func (o *IpamFhrpGroupsBulkUpdateParams) SetData(data *models.FHRPGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_responses.go new file mode 100644 index 000000000..6bb4e9ae9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupsBulkUpdateReader is a Reader for the IpamFhrpGroupsBulkUpdate structure. +type IpamFhrpGroupsBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupsBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsBulkUpdateOK creates a IpamFhrpGroupsBulkUpdateOK with default headers values +func NewIpamFhrpGroupsBulkUpdateOK() *IpamFhrpGroupsBulkUpdateOK { + return &IpamFhrpGroupsBulkUpdateOK{} +} + +/* IpamFhrpGroupsBulkUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupsBulkUpdateOK ipam fhrp groups bulk update o k +*/ +type IpamFhrpGroupsBulkUpdateOK struct { + Payload *models.FHRPGroup +} + +func (o *IpamFhrpGroupsBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/fhrp-groups/][%d] ipamFhrpGroupsBulkUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupsBulkUpdateOK) GetPayload() *models.FHRPGroup { + return o.Payload +} + +func (o *IpamFhrpGroupsBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_parameters.go new file mode 100644 index 000000000..a58be8f9d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupsCreateParams creates a new IpamFhrpGroupsCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsCreateParams() *IpamFhrpGroupsCreateParams { + return &IpamFhrpGroupsCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsCreateParamsWithTimeout creates a new IpamFhrpGroupsCreateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsCreateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsCreateParams { + return &IpamFhrpGroupsCreateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsCreateParamsWithContext creates a new IpamFhrpGroupsCreateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsCreateParamsWithContext(ctx context.Context) *IpamFhrpGroupsCreateParams { + return &IpamFhrpGroupsCreateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsCreateParamsWithHTTPClient creates a new IpamFhrpGroupsCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsCreateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsCreateParams { + return &IpamFhrpGroupsCreateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsCreateParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups create operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsCreateParams struct { + + // Data. + Data *models.FHRPGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsCreateParams) WithDefaults() *IpamFhrpGroupsCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) WithContext(ctx context.Context) *IpamFhrpGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) WithData(data *models.FHRPGroup) *IpamFhrpGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp groups create params +func (o *IpamFhrpGroupsCreateParams) SetData(data *models.FHRPGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_responses.go new file mode 100644 index 000000000..31bd5eacd --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupsCreateReader is a Reader for the IpamFhrpGroupsCreate structure. +type IpamFhrpGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewIpamFhrpGroupsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsCreateCreated creates a IpamFhrpGroupsCreateCreated with default headers values +func NewIpamFhrpGroupsCreateCreated() *IpamFhrpGroupsCreateCreated { + return &IpamFhrpGroupsCreateCreated{} +} + +/* IpamFhrpGroupsCreateCreated describes a response with status code 201, with default header values. + +IpamFhrpGroupsCreateCreated ipam fhrp groups create created +*/ +type IpamFhrpGroupsCreateCreated struct { + Payload *models.FHRPGroup +} + +func (o *IpamFhrpGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/fhrp-groups/][%d] ipamFhrpGroupsCreateCreated %+v", 201, o.Payload) +} +func (o *IpamFhrpGroupsCreateCreated) GetPayload() *models.FHRPGroup { + return o.Payload +} + +func (o *IpamFhrpGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_parameters.go new file mode 100644 index 000000000..fbb7001b9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamFhrpGroupsDeleteParams creates a new IpamFhrpGroupsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsDeleteParams() *IpamFhrpGroupsDeleteParams { + return &IpamFhrpGroupsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsDeleteParamsWithTimeout creates a new IpamFhrpGroupsDeleteParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsDeleteParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsDeleteParams { + return &IpamFhrpGroupsDeleteParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsDeleteParamsWithContext creates a new IpamFhrpGroupsDeleteParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsDeleteParamsWithContext(ctx context.Context) *IpamFhrpGroupsDeleteParams { + return &IpamFhrpGroupsDeleteParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsDeleteParamsWithHTTPClient creates a new IpamFhrpGroupsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsDeleteParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsDeleteParams { + return &IpamFhrpGroupsDeleteParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsDeleteParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups delete operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsDeleteParams struct { + + /* ID. + + A unique integer value identifying this FHRP group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsDeleteParams) WithDefaults() *IpamFhrpGroupsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) WithContext(ctx context.Context) *IpamFhrpGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) WithID(id int64) *IpamFhrpGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp groups delete params +func (o *IpamFhrpGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_responses.go new file mode 100644 index 000000000..0d21609e6 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// IpamFhrpGroupsDeleteReader is a Reader for the IpamFhrpGroupsDelete structure. +type IpamFhrpGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewIpamFhrpGroupsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsDeleteNoContent creates a IpamFhrpGroupsDeleteNoContent with default headers values +func NewIpamFhrpGroupsDeleteNoContent() *IpamFhrpGroupsDeleteNoContent { + return &IpamFhrpGroupsDeleteNoContent{} +} + +/* IpamFhrpGroupsDeleteNoContent describes a response with status code 204, with default header values. + +IpamFhrpGroupsDeleteNoContent ipam fhrp groups delete no content +*/ +type IpamFhrpGroupsDeleteNoContent struct { +} + +func (o *IpamFhrpGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/fhrp-groups/{id}/][%d] ipamFhrpGroupsDeleteNoContent ", 204) +} + +func (o *IpamFhrpGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_parameters.go new file mode 100644 index 000000000..52b00ce11 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_parameters.go @@ -0,0 +1,1358 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamFhrpGroupsListParams creates a new IpamFhrpGroupsListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsListParams() *IpamFhrpGroupsListParams { + return &IpamFhrpGroupsListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsListParamsWithTimeout creates a new IpamFhrpGroupsListParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsListParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsListParams { + return &IpamFhrpGroupsListParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsListParamsWithContext creates a new IpamFhrpGroupsListParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsListParamsWithContext(ctx context.Context) *IpamFhrpGroupsListParams { + return &IpamFhrpGroupsListParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsListParamsWithHTTPClient creates a new IpamFhrpGroupsListParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsListParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsListParams { + return &IpamFhrpGroupsListParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsListParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups list operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsListParams struct { + + // AuthKey. + AuthKey *string + + // AuthKeyEmpty. + AuthKeyEmpty *string + + // AuthKeyIc. + AuthKeyIc *string + + // AuthKeyIe. + AuthKeyIe *string + + // AuthKeyIew. + AuthKeyIew *string + + // AuthKeyIsw. + AuthKeyIsw *string + + // AuthKeyn. + AuthKeyn *string + + // AuthKeyNic. + AuthKeyNic *string + + // AuthKeyNie. + AuthKeyNie *string + + // AuthKeyNiew. + AuthKeyNiew *string + + // AuthKeyNisw. + AuthKeyNisw *string + + // AuthType. + AuthType *string + + // AuthTypen. + AuthTypen *string + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // GroupID. + GroupID *string + + // GroupIDGt. + GroupIDGt *string + + // GroupIDGte. + GroupIDGte *string + + // GroupIDLt. + GroupIDLt *string + + // GroupIDLte. + GroupIDLte *string + + // GroupIDn. + GroupIDn *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Protocol. + Protocol *string + + // Protocoln. + Protocoln *string + + // Q. + Q *string + + // RelatedIP. + RelatedIP *string + + // Tag. + Tag *string + + // Tagn. + Tagn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsListParams) WithDefaults() *IpamFhrpGroupsListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithContext(ctx context.Context) *IpamFhrpGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthKey adds the authKey to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKey(authKey *string) *IpamFhrpGroupsListParams { + o.SetAuthKey(authKey) + return o +} + +// SetAuthKey adds the authKey to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKey(authKey *string) { + o.AuthKey = authKey +} + +// WithAuthKeyEmpty adds the authKeyEmpty to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyEmpty(authKeyEmpty *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyEmpty(authKeyEmpty) + return o +} + +// SetAuthKeyEmpty adds the authKeyEmpty to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyEmpty(authKeyEmpty *string) { + o.AuthKeyEmpty = authKeyEmpty +} + +// WithAuthKeyIc adds the authKeyIc to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyIc(authKeyIc *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyIc(authKeyIc) + return o +} + +// SetAuthKeyIc adds the authKeyIc to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyIc(authKeyIc *string) { + o.AuthKeyIc = authKeyIc +} + +// WithAuthKeyIe adds the authKeyIe to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyIe(authKeyIe *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyIe(authKeyIe) + return o +} + +// SetAuthKeyIe adds the authKeyIe to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyIe(authKeyIe *string) { + o.AuthKeyIe = authKeyIe +} + +// WithAuthKeyIew adds the authKeyIew to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyIew(authKeyIew *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyIew(authKeyIew) + return o +} + +// SetAuthKeyIew adds the authKeyIew to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyIew(authKeyIew *string) { + o.AuthKeyIew = authKeyIew +} + +// WithAuthKeyIsw adds the authKeyIsw to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyIsw(authKeyIsw *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyIsw(authKeyIsw) + return o +} + +// SetAuthKeyIsw adds the authKeyIsw to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyIsw(authKeyIsw *string) { + o.AuthKeyIsw = authKeyIsw +} + +// WithAuthKeyn adds the authKeyn to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyn(authKeyn *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyn(authKeyn) + return o +} + +// SetAuthKeyn adds the authKeyN to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyn(authKeyn *string) { + o.AuthKeyn = authKeyn +} + +// WithAuthKeyNic adds the authKeyNic to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyNic(authKeyNic *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyNic(authKeyNic) + return o +} + +// SetAuthKeyNic adds the authKeyNic to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyNic(authKeyNic *string) { + o.AuthKeyNic = authKeyNic +} + +// WithAuthKeyNie adds the authKeyNie to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyNie(authKeyNie *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyNie(authKeyNie) + return o +} + +// SetAuthKeyNie adds the authKeyNie to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyNie(authKeyNie *string) { + o.AuthKeyNie = authKeyNie +} + +// WithAuthKeyNiew adds the authKeyNiew to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyNiew(authKeyNiew *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyNiew(authKeyNiew) + return o +} + +// SetAuthKeyNiew adds the authKeyNiew to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyNiew(authKeyNiew *string) { + o.AuthKeyNiew = authKeyNiew +} + +// WithAuthKeyNisw adds the authKeyNisw to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthKeyNisw(authKeyNisw *string) *IpamFhrpGroupsListParams { + o.SetAuthKeyNisw(authKeyNisw) + return o +} + +// SetAuthKeyNisw adds the authKeyNisw to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthKeyNisw(authKeyNisw *string) { + o.AuthKeyNisw = authKeyNisw +} + +// WithAuthType adds the authType to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthType(authType *string) *IpamFhrpGroupsListParams { + o.SetAuthType(authType) + return o +} + +// SetAuthType adds the authType to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthType(authType *string) { + o.AuthType = authType +} + +// WithAuthTypen adds the authTypen to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithAuthTypen(authTypen *string) *IpamFhrpGroupsListParams { + o.SetAuthTypen(authTypen) + return o +} + +// SetAuthTypen adds the authTypeN to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetAuthTypen(authTypen *string) { + o.AuthTypen = authTypen +} + +// WithCreated adds the created to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithCreated(created *string) *IpamFhrpGroupsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithCreatedGte(createdGte *string) *IpamFhrpGroupsListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithCreatedLte(createdLte *string) *IpamFhrpGroupsListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithGroupID adds the groupID to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithGroupID(groupID *string) *IpamFhrpGroupsListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithGroupIDGt adds the groupIDGt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithGroupIDGt(groupIDGt *string) *IpamFhrpGroupsListParams { + o.SetGroupIDGt(groupIDGt) + return o +} + +// SetGroupIDGt adds the groupIdGt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetGroupIDGt(groupIDGt *string) { + o.GroupIDGt = groupIDGt +} + +// WithGroupIDGte adds the groupIDGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithGroupIDGte(groupIDGte *string) *IpamFhrpGroupsListParams { + o.SetGroupIDGte(groupIDGte) + return o +} + +// SetGroupIDGte adds the groupIdGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetGroupIDGte(groupIDGte *string) { + o.GroupIDGte = groupIDGte +} + +// WithGroupIDLt adds the groupIDLt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithGroupIDLt(groupIDLt *string) *IpamFhrpGroupsListParams { + o.SetGroupIDLt(groupIDLt) + return o +} + +// SetGroupIDLt adds the groupIdLt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetGroupIDLt(groupIDLt *string) { + o.GroupIDLt = groupIDLt +} + +// WithGroupIDLte adds the groupIDLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithGroupIDLte(groupIDLte *string) *IpamFhrpGroupsListParams { + o.SetGroupIDLte(groupIDLte) + return o +} + +// SetGroupIDLte adds the groupIdLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetGroupIDLte(groupIDLte *string) { + o.GroupIDLte = groupIDLte +} + +// WithGroupIDn adds the groupIDn to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithGroupIDn(groupIDn *string) *IpamFhrpGroupsListParams { + o.SetGroupIDn(groupIDn) + return o +} + +// SetGroupIDn adds the groupIdN to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetGroupIDn(groupIDn *string) { + o.GroupIDn = groupIDn +} + +// WithID adds the id to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithID(id *string) *IpamFhrpGroupsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithIDGt(iDGt *string) *IpamFhrpGroupsListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithIDGte(iDGte *string) *IpamFhrpGroupsListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithIDLt(iDLt *string) *IpamFhrpGroupsListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithIDLte(iDLte *string) *IpamFhrpGroupsListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithIDn(iDn *string) *IpamFhrpGroupsListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithLastUpdated(lastUpdated *string) *IpamFhrpGroupsListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithLastUpdatedGte(lastUpdatedGte *string) *IpamFhrpGroupsListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithLastUpdatedLte(lastUpdatedLte *string) *IpamFhrpGroupsListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithLimit(limit *int64) *IpamFhrpGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithOffset(offset *int64) *IpamFhrpGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithProtocol adds the protocol to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithProtocol(protocol *string) *IpamFhrpGroupsListParams { + o.SetProtocol(protocol) + return o +} + +// SetProtocol adds the protocol to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetProtocol(protocol *string) { + o.Protocol = protocol +} + +// WithProtocoln adds the protocoln to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithProtocoln(protocoln *string) *IpamFhrpGroupsListParams { + o.SetProtocoln(protocoln) + return o +} + +// SetProtocoln adds the protocolN to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetProtocoln(protocoln *string) { + o.Protocoln = protocoln +} + +// WithQ adds the q to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithQ(q *string) *IpamFhrpGroupsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRelatedIP adds the relatedIP to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithRelatedIP(relatedIP *string) *IpamFhrpGroupsListParams { + o.SetRelatedIP(relatedIP) + return o +} + +// SetRelatedIP adds the relatedIp to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetRelatedIP(relatedIP *string) { + o.RelatedIP = relatedIP +} + +// WithTag adds the tag to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithTag(tag *string) *IpamFhrpGroupsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) WithTagn(tagn *string) *IpamFhrpGroupsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the ipam fhrp groups list params +func (o *IpamFhrpGroupsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AuthKey != nil { + + // query param auth_key + var qrAuthKey string + + if o.AuthKey != nil { + qrAuthKey = *o.AuthKey + } + qAuthKey := qrAuthKey + if qAuthKey != "" { + + if err := r.SetQueryParam("auth_key", qAuthKey); err != nil { + return err + } + } + } + + if o.AuthKeyEmpty != nil { + + // query param auth_key__empty + var qrAuthKeyEmpty string + + if o.AuthKeyEmpty != nil { + qrAuthKeyEmpty = *o.AuthKeyEmpty + } + qAuthKeyEmpty := qrAuthKeyEmpty + if qAuthKeyEmpty != "" { + + if err := r.SetQueryParam("auth_key__empty", qAuthKeyEmpty); err != nil { + return err + } + } + } + + if o.AuthKeyIc != nil { + + // query param auth_key__ic + var qrAuthKeyIc string + + if o.AuthKeyIc != nil { + qrAuthKeyIc = *o.AuthKeyIc + } + qAuthKeyIc := qrAuthKeyIc + if qAuthKeyIc != "" { + + if err := r.SetQueryParam("auth_key__ic", qAuthKeyIc); err != nil { + return err + } + } + } + + if o.AuthKeyIe != nil { + + // query param auth_key__ie + var qrAuthKeyIe string + + if o.AuthKeyIe != nil { + qrAuthKeyIe = *o.AuthKeyIe + } + qAuthKeyIe := qrAuthKeyIe + if qAuthKeyIe != "" { + + if err := r.SetQueryParam("auth_key__ie", qAuthKeyIe); err != nil { + return err + } + } + } + + if o.AuthKeyIew != nil { + + // query param auth_key__iew + var qrAuthKeyIew string + + if o.AuthKeyIew != nil { + qrAuthKeyIew = *o.AuthKeyIew + } + qAuthKeyIew := qrAuthKeyIew + if qAuthKeyIew != "" { + + if err := r.SetQueryParam("auth_key__iew", qAuthKeyIew); err != nil { + return err + } + } + } + + if o.AuthKeyIsw != nil { + + // query param auth_key__isw + var qrAuthKeyIsw string + + if o.AuthKeyIsw != nil { + qrAuthKeyIsw = *o.AuthKeyIsw + } + qAuthKeyIsw := qrAuthKeyIsw + if qAuthKeyIsw != "" { + + if err := r.SetQueryParam("auth_key__isw", qAuthKeyIsw); err != nil { + return err + } + } + } + + if o.AuthKeyn != nil { + + // query param auth_key__n + var qrAuthKeyn string + + if o.AuthKeyn != nil { + qrAuthKeyn = *o.AuthKeyn + } + qAuthKeyn := qrAuthKeyn + if qAuthKeyn != "" { + + if err := r.SetQueryParam("auth_key__n", qAuthKeyn); err != nil { + return err + } + } + } + + if o.AuthKeyNic != nil { + + // query param auth_key__nic + var qrAuthKeyNic string + + if o.AuthKeyNic != nil { + qrAuthKeyNic = *o.AuthKeyNic + } + qAuthKeyNic := qrAuthKeyNic + if qAuthKeyNic != "" { + + if err := r.SetQueryParam("auth_key__nic", qAuthKeyNic); err != nil { + return err + } + } + } + + if o.AuthKeyNie != nil { + + // query param auth_key__nie + var qrAuthKeyNie string + + if o.AuthKeyNie != nil { + qrAuthKeyNie = *o.AuthKeyNie + } + qAuthKeyNie := qrAuthKeyNie + if qAuthKeyNie != "" { + + if err := r.SetQueryParam("auth_key__nie", qAuthKeyNie); err != nil { + return err + } + } + } + + if o.AuthKeyNiew != nil { + + // query param auth_key__niew + var qrAuthKeyNiew string + + if o.AuthKeyNiew != nil { + qrAuthKeyNiew = *o.AuthKeyNiew + } + qAuthKeyNiew := qrAuthKeyNiew + if qAuthKeyNiew != "" { + + if err := r.SetQueryParam("auth_key__niew", qAuthKeyNiew); err != nil { + return err + } + } + } + + if o.AuthKeyNisw != nil { + + // query param auth_key__nisw + var qrAuthKeyNisw string + + if o.AuthKeyNisw != nil { + qrAuthKeyNisw = *o.AuthKeyNisw + } + qAuthKeyNisw := qrAuthKeyNisw + if qAuthKeyNisw != "" { + + if err := r.SetQueryParam("auth_key__nisw", qAuthKeyNisw); err != nil { + return err + } + } + } + + if o.AuthType != nil { + + // query param auth_type + var qrAuthType string + + if o.AuthType != nil { + qrAuthType = *o.AuthType + } + qAuthType := qrAuthType + if qAuthType != "" { + + if err := r.SetQueryParam("auth_type", qAuthType); err != nil { + return err + } + } + } + + if o.AuthTypen != nil { + + // query param auth_type__n + var qrAuthTypen string + + if o.AuthTypen != nil { + qrAuthTypen = *o.AuthTypen + } + qAuthTypen := qrAuthTypen + if qAuthTypen != "" { + + if err := r.SetQueryParam("auth_type__n", qAuthTypen); err != nil { + return err + } + } + } + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + } + + if o.GroupIDGt != nil { + + // query param group_id__gt + var qrGroupIDGt string + + if o.GroupIDGt != nil { + qrGroupIDGt = *o.GroupIDGt + } + qGroupIDGt := qrGroupIDGt + if qGroupIDGt != "" { + + if err := r.SetQueryParam("group_id__gt", qGroupIDGt); err != nil { + return err + } + } + } + + if o.GroupIDGte != nil { + + // query param group_id__gte + var qrGroupIDGte string + + if o.GroupIDGte != nil { + qrGroupIDGte = *o.GroupIDGte + } + qGroupIDGte := qrGroupIDGte + if qGroupIDGte != "" { + + if err := r.SetQueryParam("group_id__gte", qGroupIDGte); err != nil { + return err + } + } + } + + if o.GroupIDLt != nil { + + // query param group_id__lt + var qrGroupIDLt string + + if o.GroupIDLt != nil { + qrGroupIDLt = *o.GroupIDLt + } + qGroupIDLt := qrGroupIDLt + if qGroupIDLt != "" { + + if err := r.SetQueryParam("group_id__lt", qGroupIDLt); err != nil { + return err + } + } + } + + if o.GroupIDLte != nil { + + // query param group_id__lte + var qrGroupIDLte string + + if o.GroupIDLte != nil { + qrGroupIDLte = *o.GroupIDLte + } + qGroupIDLte := qrGroupIDLte + if qGroupIDLte != "" { + + if err := r.SetQueryParam("group_id__lte", qGroupIDLte); err != nil { + return err + } + } + } + + if o.GroupIDn != nil { + + // query param group_id__n + var qrGroupIDn string + + if o.GroupIDn != nil { + qrGroupIDn = *o.GroupIDn + } + qGroupIDn := qrGroupIDn + if qGroupIDn != "" { + + if err := r.SetQueryParam("group_id__n", qGroupIDn); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Protocol != nil { + + // query param protocol + var qrProtocol string + + if o.Protocol != nil { + qrProtocol = *o.Protocol + } + qProtocol := qrProtocol + if qProtocol != "" { + + if err := r.SetQueryParam("protocol", qProtocol); err != nil { + return err + } + } + } + + if o.Protocoln != nil { + + // query param protocol__n + var qrProtocoln string + + if o.Protocoln != nil { + qrProtocoln = *o.Protocoln + } + qProtocoln := qrProtocoln + if qProtocoln != "" { + + if err := r.SetQueryParam("protocol__n", qProtocoln); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.RelatedIP != nil { + + // query param related_ip + var qrRelatedIP string + + if o.RelatedIP != nil { + qrRelatedIP = *o.RelatedIP + } + qRelatedIP := qrRelatedIP + if qRelatedIP != "" { + + if err := r.SetQueryParam("related_ip", qRelatedIP); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_responses.go new file mode 100644 index 000000000..8761a5968 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupsListReader is a Reader for the IpamFhrpGroupsList structure. +type IpamFhrpGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsListOK creates a IpamFhrpGroupsListOK with default headers values +func NewIpamFhrpGroupsListOK() *IpamFhrpGroupsListOK { + return &IpamFhrpGroupsListOK{} +} + +/* IpamFhrpGroupsListOK describes a response with status code 200, with default header values. + +IpamFhrpGroupsListOK ipam fhrp groups list o k +*/ +type IpamFhrpGroupsListOK struct { + Payload *IpamFhrpGroupsListOKBody +} + +func (o *IpamFhrpGroupsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/fhrp-groups/][%d] ipamFhrpGroupsListOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupsListOK) GetPayload() *IpamFhrpGroupsListOKBody { + return o.Payload +} + +func (o *IpamFhrpGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IpamFhrpGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IpamFhrpGroupsListOKBody ipam fhrp groups list o k body +swagger:model IpamFhrpGroupsListOKBody +*/ +type IpamFhrpGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.FHRPGroup `json:"results"` +} + +// Validate validates this ipam fhrp groups list o k body +func (o *IpamFhrpGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IpamFhrpGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamFhrpGroupsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IpamFhrpGroupsListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamFhrpGroupsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IpamFhrpGroupsListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamFhrpGroupsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IpamFhrpGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamFhrpGroupsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamFhrpGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipamFhrpGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this ipam fhrp groups list o k body based on the context it is used +func (o *IpamFhrpGroupsListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IpamFhrpGroupsListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamFhrpGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ipamFhrpGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IpamFhrpGroupsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IpamFhrpGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res IpamFhrpGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_parameters.go new file mode 100644 index 000000000..4544078c6 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupsPartialUpdateParams creates a new IpamFhrpGroupsPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsPartialUpdateParams() *IpamFhrpGroupsPartialUpdateParams { + return &IpamFhrpGroupsPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsPartialUpdateParamsWithTimeout creates a new IpamFhrpGroupsPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsPartialUpdateParams { + return &IpamFhrpGroupsPartialUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsPartialUpdateParamsWithContext creates a new IpamFhrpGroupsPartialUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsPartialUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupsPartialUpdateParams { + return &IpamFhrpGroupsPartialUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsPartialUpdateParamsWithHTTPClient creates a new IpamFhrpGroupsPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsPartialUpdateParams { + return &IpamFhrpGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsPartialUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups partial update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsPartialUpdateParams struct { + + // Data. + Data *models.FHRPGroup + + /* ID. + + A unique integer value identifying this FHRP group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsPartialUpdateParams) WithDefaults() *IpamFhrpGroupsPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) WithData(data *models.FHRPGroup) *IpamFhrpGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) SetData(data *models.FHRPGroup) { + o.Data = data +} + +// WithID adds the id to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) WithID(id int64) *IpamFhrpGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp groups partial update params +func (o *IpamFhrpGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_responses.go new file mode 100644 index 000000000..a4b843d2d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupsPartialUpdateReader is a Reader for the IpamFhrpGroupsPartialUpdate structure. +type IpamFhrpGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsPartialUpdateOK creates a IpamFhrpGroupsPartialUpdateOK with default headers values +func NewIpamFhrpGroupsPartialUpdateOK() *IpamFhrpGroupsPartialUpdateOK { + return &IpamFhrpGroupsPartialUpdateOK{} +} + +/* IpamFhrpGroupsPartialUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupsPartialUpdateOK ipam fhrp groups partial update o k +*/ +type IpamFhrpGroupsPartialUpdateOK struct { + Payload *models.FHRPGroup +} + +func (o *IpamFhrpGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/fhrp-groups/{id}/][%d] ipamFhrpGroupsPartialUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupsPartialUpdateOK) GetPayload() *models.FHRPGroup { + return o.Payload +} + +func (o *IpamFhrpGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_parameters.go new file mode 100644 index 000000000..af8aa3a27 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIpamFhrpGroupsReadParams creates a new IpamFhrpGroupsReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsReadParams() *IpamFhrpGroupsReadParams { + return &IpamFhrpGroupsReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsReadParamsWithTimeout creates a new IpamFhrpGroupsReadParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsReadParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsReadParams { + return &IpamFhrpGroupsReadParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsReadParamsWithContext creates a new IpamFhrpGroupsReadParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsReadParamsWithContext(ctx context.Context) *IpamFhrpGroupsReadParams { + return &IpamFhrpGroupsReadParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsReadParamsWithHTTPClient creates a new IpamFhrpGroupsReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsReadParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsReadParams { + return &IpamFhrpGroupsReadParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsReadParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups read operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsReadParams struct { + + /* ID. + + A unique integer value identifying this FHRP group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsReadParams) WithDefaults() *IpamFhrpGroupsReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) WithContext(ctx context.Context) *IpamFhrpGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) WithID(id int64) *IpamFhrpGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp groups read params +func (o *IpamFhrpGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_responses.go new file mode 100644 index 000000000..402f70c7d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupsReadReader is a Reader for the IpamFhrpGroupsRead structure. +type IpamFhrpGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsReadOK creates a IpamFhrpGroupsReadOK with default headers values +func NewIpamFhrpGroupsReadOK() *IpamFhrpGroupsReadOK { + return &IpamFhrpGroupsReadOK{} +} + +/* IpamFhrpGroupsReadOK describes a response with status code 200, with default header values. + +IpamFhrpGroupsReadOK ipam fhrp groups read o k +*/ +type IpamFhrpGroupsReadOK struct { + Payload *models.FHRPGroup +} + +func (o *IpamFhrpGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/fhrp-groups/{id}/][%d] ipamFhrpGroupsReadOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupsReadOK) GetPayload() *models.FHRPGroup { + return o.Payload +} + +func (o *IpamFhrpGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_parameters.go new file mode 100644 index 000000000..12c01178d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewIpamFhrpGroupsUpdateParams creates a new IpamFhrpGroupsUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewIpamFhrpGroupsUpdateParams() *IpamFhrpGroupsUpdateParams { + return &IpamFhrpGroupsUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewIpamFhrpGroupsUpdateParamsWithTimeout creates a new IpamFhrpGroupsUpdateParams object +// with the ability to set a timeout on a request. +func NewIpamFhrpGroupsUpdateParamsWithTimeout(timeout time.Duration) *IpamFhrpGroupsUpdateParams { + return &IpamFhrpGroupsUpdateParams{ + timeout: timeout, + } +} + +// NewIpamFhrpGroupsUpdateParamsWithContext creates a new IpamFhrpGroupsUpdateParams object +// with the ability to set a context for a request. +func NewIpamFhrpGroupsUpdateParamsWithContext(ctx context.Context) *IpamFhrpGroupsUpdateParams { + return &IpamFhrpGroupsUpdateParams{ + Context: ctx, + } +} + +// NewIpamFhrpGroupsUpdateParamsWithHTTPClient creates a new IpamFhrpGroupsUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewIpamFhrpGroupsUpdateParamsWithHTTPClient(client *http.Client) *IpamFhrpGroupsUpdateParams { + return &IpamFhrpGroupsUpdateParams{ + HTTPClient: client, + } +} + +/* IpamFhrpGroupsUpdateParams contains all the parameters to send to the API endpoint + for the ipam fhrp groups update operation. + + Typically these are written to a http.Request. +*/ +type IpamFhrpGroupsUpdateParams struct { + + // Data. + Data *models.FHRPGroup + + /* ID. + + A unique integer value identifying this FHRP group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the ipam fhrp groups update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsUpdateParams) WithDefaults() *IpamFhrpGroupsUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the ipam fhrp groups update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *IpamFhrpGroupsUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) WithTimeout(timeout time.Duration) *IpamFhrpGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) WithContext(ctx context.Context) *IpamFhrpGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) WithHTTPClient(client *http.Client) *IpamFhrpGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) WithData(data *models.FHRPGroup) *IpamFhrpGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) SetData(data *models.FHRPGroup) { + o.Data = data +} + +// WithID adds the id to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) WithID(id int64) *IpamFhrpGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam fhrp groups update params +func (o *IpamFhrpGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IpamFhrpGroupsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_responses.go new file mode 100644 index 000000000..5c068ca50 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_fhrp_groups_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// IpamFhrpGroupsUpdateReader is a Reader for the IpamFhrpGroupsUpdate structure. +type IpamFhrpGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IpamFhrpGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewIpamFhrpGroupsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewIpamFhrpGroupsUpdateOK creates a IpamFhrpGroupsUpdateOK with default headers values +func NewIpamFhrpGroupsUpdateOK() *IpamFhrpGroupsUpdateOK { + return &IpamFhrpGroupsUpdateOK{} +} + +/* IpamFhrpGroupsUpdateOK describes a response with status code 200, with default header values. + +IpamFhrpGroupsUpdateOK ipam fhrp groups update o k +*/ +type IpamFhrpGroupsUpdateOK struct { + Payload *models.FHRPGroup +} + +func (o *IpamFhrpGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/fhrp-groups/{id}/][%d] ipamFhrpGroupsUpdateOK %+v", 200, o.Payload) +} +func (o *IpamFhrpGroupsUpdateOK) GetPayload() *models.FHRPGroup { + return o.Payload +} + +func (o *IpamFhrpGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FHRPGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_parameters.go index 8a7e3a329..8befe3e2d 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_parameters.go @@ -78,11 +78,11 @@ func NewIpamIPRangesAvailableIpsCreateParamsWithHTTPClient(client *http.Client) type IpamIPRangesAvailableIpsCreateParams struct { // Data. - Data []*models.AvailableIP + Data *models.WritableAvailableIP /* ID. - A unique integer value identifying this IP range. + A unique integer value identifying this IP address. */ ID int64 @@ -140,13 +140,13 @@ func (o *IpamIPRangesAvailableIpsCreateParams) SetHTTPClient(client *http.Client } // WithData adds the data to the ipam ip ranges available ips create params -func (o *IpamIPRangesAvailableIpsCreateParams) WithData(data []*models.AvailableIP) *IpamIPRangesAvailableIpsCreateParams { +func (o *IpamIPRangesAvailableIpsCreateParams) WithData(data *models.WritableAvailableIP) *IpamIPRangesAvailableIpsCreateParams { o.SetData(data) return o } // SetData adds the data to the ipam ip ranges available ips create params -func (o *IpamIPRangesAvailableIpsCreateParams) SetData(data []*models.AvailableIP) { +func (o *IpamIPRangesAvailableIpsCreateParams) SetData(data *models.WritableAvailableIP) { o.Data = data } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_responses.go index 9c39252c4..479e61ab8 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_responses.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_create_responses.go @@ -59,13 +59,13 @@ func NewIpamIPRangesAvailableIpsCreateCreated() *IpamIPRangesAvailableIpsCreateC IpamIPRangesAvailableIpsCreateCreated ipam Ip ranges available ips create created */ type IpamIPRangesAvailableIpsCreateCreated struct { - Payload []*models.AvailableIP + Payload []*models.IPAddress } func (o *IpamIPRangesAvailableIpsCreateCreated) Error() string { return fmt.Sprintf("[POST /ipam/ip-ranges/{id}/available-ips/][%d] ipamIpRangesAvailableIpsCreateCreated %+v", 201, o.Payload) } -func (o *IpamIPRangesAvailableIpsCreateCreated) GetPayload() []*models.AvailableIP { +func (o *IpamIPRangesAvailableIpsCreateCreated) GetPayload() []*models.IPAddress { return o.Payload } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_list_parameters.go similarity index 56% rename from vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_read_parameters.go rename to vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_list_parameters.go index 499945cf4..0a8c4f091 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_read_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_list_parameters.go @@ -32,52 +32,52 @@ import ( "github.com/go-openapi/swag" ) -// NewIpamIPRangesAvailableIpsReadParams creates a new IpamIPRangesAvailableIpsReadParams object, +// NewIpamIPRangesAvailableIpsListParams creates a new IpamIPRangesAvailableIpsListParams object, // with the default timeout for this client. // // Default values are not hydrated, since defaults are normally applied by the API server side. // // To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewIpamIPRangesAvailableIpsReadParams() *IpamIPRangesAvailableIpsReadParams { - return &IpamIPRangesAvailableIpsReadParams{ +func NewIpamIPRangesAvailableIpsListParams() *IpamIPRangesAvailableIpsListParams { + return &IpamIPRangesAvailableIpsListParams{ timeout: cr.DefaultTimeout, } } -// NewIpamIPRangesAvailableIpsReadParamsWithTimeout creates a new IpamIPRangesAvailableIpsReadParams object +// NewIpamIPRangesAvailableIpsListParamsWithTimeout creates a new IpamIPRangesAvailableIpsListParams object // with the ability to set a timeout on a request. -func NewIpamIPRangesAvailableIpsReadParamsWithTimeout(timeout time.Duration) *IpamIPRangesAvailableIpsReadParams { - return &IpamIPRangesAvailableIpsReadParams{ +func NewIpamIPRangesAvailableIpsListParamsWithTimeout(timeout time.Duration) *IpamIPRangesAvailableIpsListParams { + return &IpamIPRangesAvailableIpsListParams{ timeout: timeout, } } -// NewIpamIPRangesAvailableIpsReadParamsWithContext creates a new IpamIPRangesAvailableIpsReadParams object +// NewIpamIPRangesAvailableIpsListParamsWithContext creates a new IpamIPRangesAvailableIpsListParams object // with the ability to set a context for a request. -func NewIpamIPRangesAvailableIpsReadParamsWithContext(ctx context.Context) *IpamIPRangesAvailableIpsReadParams { - return &IpamIPRangesAvailableIpsReadParams{ +func NewIpamIPRangesAvailableIpsListParamsWithContext(ctx context.Context) *IpamIPRangesAvailableIpsListParams { + return &IpamIPRangesAvailableIpsListParams{ Context: ctx, } } -// NewIpamIPRangesAvailableIpsReadParamsWithHTTPClient creates a new IpamIPRangesAvailableIpsReadParams object +// NewIpamIPRangesAvailableIpsListParamsWithHTTPClient creates a new IpamIPRangesAvailableIpsListParams object // with the ability to set a custom HTTPClient for a request. -func NewIpamIPRangesAvailableIpsReadParamsWithHTTPClient(client *http.Client) *IpamIPRangesAvailableIpsReadParams { - return &IpamIPRangesAvailableIpsReadParams{ +func NewIpamIPRangesAvailableIpsListParamsWithHTTPClient(client *http.Client) *IpamIPRangesAvailableIpsListParams { + return &IpamIPRangesAvailableIpsListParams{ HTTPClient: client, } } -/* IpamIPRangesAvailableIpsReadParams contains all the parameters to send to the API endpoint - for the ipam ip ranges available ips read operation. +/* IpamIPRangesAvailableIpsListParams contains all the parameters to send to the API endpoint + for the ipam ip ranges available ips list operation. Typically these are written to a http.Request. */ -type IpamIPRangesAvailableIpsReadParams struct { +type IpamIPRangesAvailableIpsListParams struct { /* ID. - A unique integer value identifying this IP range. + A unique integer value identifying this IP address. */ ID int64 @@ -86,67 +86,67 @@ type IpamIPRangesAvailableIpsReadParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the ipam ip ranges available ips read params (not the query body). +// WithDefaults hydrates default values in the ipam ip ranges available ips list params (not the query body). // // All values with no default are reset to their zero value. -func (o *IpamIPRangesAvailableIpsReadParams) WithDefaults() *IpamIPRangesAvailableIpsReadParams { +func (o *IpamIPRangesAvailableIpsListParams) WithDefaults() *IpamIPRangesAvailableIpsListParams { o.SetDefaults() return o } -// SetDefaults hydrates default values in the ipam ip ranges available ips read params (not the query body). +// SetDefaults hydrates default values in the ipam ip ranges available ips list params (not the query body). // // All values with no default are reset to their zero value. -func (o *IpamIPRangesAvailableIpsReadParams) SetDefaults() { +func (o *IpamIPRangesAvailableIpsListParams) SetDefaults() { // no default values defined for this parameter } -// WithTimeout adds the timeout to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) WithTimeout(timeout time.Duration) *IpamIPRangesAvailableIpsReadParams { +// WithTimeout adds the timeout to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) WithTimeout(timeout time.Duration) *IpamIPRangesAvailableIpsListParams { o.SetTimeout(timeout) return o } -// SetTimeout adds the timeout to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) SetTimeout(timeout time.Duration) { +// SetTimeout adds the timeout to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } -// WithContext adds the context to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) WithContext(ctx context.Context) *IpamIPRangesAvailableIpsReadParams { +// WithContext adds the context to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) WithContext(ctx context.Context) *IpamIPRangesAvailableIpsListParams { o.SetContext(ctx) return o } -// SetContext adds the context to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) SetContext(ctx context.Context) { +// SetContext adds the context to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) SetContext(ctx context.Context) { o.Context = ctx } -// WithHTTPClient adds the HTTPClient to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) WithHTTPClient(client *http.Client) *IpamIPRangesAvailableIpsReadParams { +// WithHTTPClient adds the HTTPClient to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) WithHTTPClient(client *http.Client) *IpamIPRangesAvailableIpsListParams { o.SetHTTPClient(client) return o } -// SetHTTPClient adds the HTTPClient to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) SetHTTPClient(client *http.Client) { +// SetHTTPClient adds the HTTPClient to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithID adds the id to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) WithID(id int64) *IpamIPRangesAvailableIpsReadParams { +// WithID adds the id to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) WithID(id int64) *IpamIPRangesAvailableIpsListParams { o.SetID(id) return o } -// SetID adds the id to the ipam ip ranges available ips read params -func (o *IpamIPRangesAvailableIpsReadParams) SetID(id int64) { +// SetID adds the id to the ipam ip ranges available ips list params +func (o *IpamIPRangesAvailableIpsListParams) SetID(id int64) { o.ID = id } // WriteToRequest writes these params to a swagger request -func (o *IpamIPRangesAvailableIpsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { +func (o *IpamIPRangesAvailableIpsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_list_responses.go similarity index 69% rename from vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_read_responses.go rename to vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_list_responses.go index b2d1bd541..b06905d3a 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_read_responses.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_available_ips_list_responses.go @@ -30,16 +30,16 @@ import ( "github.com/smutel/go-netbox/netbox/models" ) -// IpamIPRangesAvailableIpsReadReader is a Reader for the IpamIPRangesAvailableIpsRead structure. -type IpamIPRangesAvailableIpsReadReader struct { +// IpamIPRangesAvailableIpsListReader is a Reader for the IpamIPRangesAvailableIpsList structure. +type IpamIPRangesAvailableIpsListReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IpamIPRangesAvailableIpsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *IpamIPRangesAvailableIpsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIpamIPRangesAvailableIpsReadOK() + result := NewIpamIPRangesAvailableIpsListOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -49,27 +49,27 @@ func (o *IpamIPRangesAvailableIpsReadReader) ReadResponse(response runtime.Clien } } -// NewIpamIPRangesAvailableIpsReadOK creates a IpamIPRangesAvailableIpsReadOK with default headers values -func NewIpamIPRangesAvailableIpsReadOK() *IpamIPRangesAvailableIpsReadOK { - return &IpamIPRangesAvailableIpsReadOK{} +// NewIpamIPRangesAvailableIpsListOK creates a IpamIPRangesAvailableIpsListOK with default headers values +func NewIpamIPRangesAvailableIpsListOK() *IpamIPRangesAvailableIpsListOK { + return &IpamIPRangesAvailableIpsListOK{} } -/* IpamIPRangesAvailableIpsReadOK describes a response with status code 200, with default header values. +/* IpamIPRangesAvailableIpsListOK describes a response with status code 200, with default header values. -IpamIPRangesAvailableIpsReadOK ipam Ip ranges available ips read o k +IpamIPRangesAvailableIpsListOK ipam Ip ranges available ips list o k */ -type IpamIPRangesAvailableIpsReadOK struct { +type IpamIPRangesAvailableIpsListOK struct { Payload []*models.AvailableIP } -func (o *IpamIPRangesAvailableIpsReadOK) Error() string { - return fmt.Sprintf("[GET /ipam/ip-ranges/{id}/available-ips/][%d] ipamIpRangesAvailableIpsReadOK %+v", 200, o.Payload) +func (o *IpamIPRangesAvailableIpsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/ip-ranges/{id}/available-ips/][%d] ipamIpRangesAvailableIpsListOK %+v", 200, o.Payload) } -func (o *IpamIPRangesAvailableIpsReadOK) GetPayload() []*models.AvailableIP { +func (o *IpamIPRangesAvailableIpsListOK) GetPayload() []*models.AvailableIP { return o.Payload } -func (o *IpamIPRangesAvailableIpsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *IpamIPRangesAvailableIpsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_list_parameters.go index a9da48a4d..acfba48f1 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_ip_ranges_list_parameters.go @@ -87,6 +87,39 @@ type IpamIPRangesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Family. Family *float64 @@ -289,6 +322,127 @@ func (o *IpamIPRangesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescription(description *string) *IpamIPRangesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamIPRangesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionIc(descriptionIc *string) *IpamIPRangesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionIe(descriptionIe *string) *IpamIPRangesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionIew(descriptionIew *string) *IpamIPRangesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionIsw(descriptionIsw *string) *IpamIPRangesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionn(descriptionn *string) *IpamIPRangesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionNic(descriptionNic *string) *IpamIPRangesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionNie(descriptionNie *string) *IpamIPRangesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionNiew(descriptionNiew *string) *IpamIPRangesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam ip ranges list params +func (o *IpamIPRangesListParams) WithDescriptionNisw(descriptionNisw *string) *IpamIPRangesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam ip ranges list params +func (o *IpamIPRangesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithFamily adds the family to the ipam ip ranges list params func (o *IpamIPRangesListParams) WithFamily(family *float64) *IpamIPRangesListParams { o.SetFamily(family) @@ -728,6 +882,193 @@ func (o *IpamIPRangesListParams) WriteToRequest(r runtime.ClientRequest, reg str } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Family != nil { // query param family diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_parameters.go index 98d437684..feb155ffa 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_parameters.go @@ -78,11 +78,11 @@ func NewIpamPrefixesAvailableIpsCreateParamsWithHTTPClient(client *http.Client) type IpamPrefixesAvailableIpsCreateParams struct { // Data. - Data []*models.AvailableIP + Data *models.WritableAvailableIP /* ID. - A unique integer value identifying this prefix. + A unique integer value identifying this IP address. */ ID int64 @@ -140,13 +140,13 @@ func (o *IpamPrefixesAvailableIpsCreateParams) SetHTTPClient(client *http.Client } // WithData adds the data to the ipam prefixes available ips create params -func (o *IpamPrefixesAvailableIpsCreateParams) WithData(data []*models.AvailableIP) *IpamPrefixesAvailableIpsCreateParams { +func (o *IpamPrefixesAvailableIpsCreateParams) WithData(data *models.WritableAvailableIP) *IpamPrefixesAvailableIpsCreateParams { o.SetData(data) return o } // SetData adds the data to the ipam prefixes available ips create params -func (o *IpamPrefixesAvailableIpsCreateParams) SetData(data []*models.AvailableIP) { +func (o *IpamPrefixesAvailableIpsCreateParams) SetData(data *models.WritableAvailableIP) { o.Data = data } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_responses.go index ed23adaa8..0c696fba6 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_responses.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_create_responses.go @@ -59,13 +59,13 @@ func NewIpamPrefixesAvailableIpsCreateCreated() *IpamPrefixesAvailableIpsCreateC IpamPrefixesAvailableIpsCreateCreated ipam prefixes available ips create created */ type IpamPrefixesAvailableIpsCreateCreated struct { - Payload []*models.AvailableIP + Payload []*models.IPAddress } func (o *IpamPrefixesAvailableIpsCreateCreated) Error() string { return fmt.Sprintf("[POST /ipam/prefixes/{id}/available-ips/][%d] ipamPrefixesAvailableIpsCreateCreated %+v", 201, o.Payload) } -func (o *IpamPrefixesAvailableIpsCreateCreated) GetPayload() []*models.AvailableIP { +func (o *IpamPrefixesAvailableIpsCreateCreated) GetPayload() []*models.IPAddress { return o.Payload } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_list_parameters.go similarity index 56% rename from vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_read_parameters.go rename to vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_list_parameters.go index 71228c85b..c9fa4a46b 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_read_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_list_parameters.go @@ -32,52 +32,52 @@ import ( "github.com/go-openapi/swag" ) -// NewIpamPrefixesAvailableIpsReadParams creates a new IpamPrefixesAvailableIpsReadParams object, +// NewIpamPrefixesAvailableIpsListParams creates a new IpamPrefixesAvailableIpsListParams object, // with the default timeout for this client. // // Default values are not hydrated, since defaults are normally applied by the API server side. // // To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewIpamPrefixesAvailableIpsReadParams() *IpamPrefixesAvailableIpsReadParams { - return &IpamPrefixesAvailableIpsReadParams{ +func NewIpamPrefixesAvailableIpsListParams() *IpamPrefixesAvailableIpsListParams { + return &IpamPrefixesAvailableIpsListParams{ timeout: cr.DefaultTimeout, } } -// NewIpamPrefixesAvailableIpsReadParamsWithTimeout creates a new IpamPrefixesAvailableIpsReadParams object +// NewIpamPrefixesAvailableIpsListParamsWithTimeout creates a new IpamPrefixesAvailableIpsListParams object // with the ability to set a timeout on a request. -func NewIpamPrefixesAvailableIpsReadParamsWithTimeout(timeout time.Duration) *IpamPrefixesAvailableIpsReadParams { - return &IpamPrefixesAvailableIpsReadParams{ +func NewIpamPrefixesAvailableIpsListParamsWithTimeout(timeout time.Duration) *IpamPrefixesAvailableIpsListParams { + return &IpamPrefixesAvailableIpsListParams{ timeout: timeout, } } -// NewIpamPrefixesAvailableIpsReadParamsWithContext creates a new IpamPrefixesAvailableIpsReadParams object +// NewIpamPrefixesAvailableIpsListParamsWithContext creates a new IpamPrefixesAvailableIpsListParams object // with the ability to set a context for a request. -func NewIpamPrefixesAvailableIpsReadParamsWithContext(ctx context.Context) *IpamPrefixesAvailableIpsReadParams { - return &IpamPrefixesAvailableIpsReadParams{ +func NewIpamPrefixesAvailableIpsListParamsWithContext(ctx context.Context) *IpamPrefixesAvailableIpsListParams { + return &IpamPrefixesAvailableIpsListParams{ Context: ctx, } } -// NewIpamPrefixesAvailableIpsReadParamsWithHTTPClient creates a new IpamPrefixesAvailableIpsReadParams object +// NewIpamPrefixesAvailableIpsListParamsWithHTTPClient creates a new IpamPrefixesAvailableIpsListParams object // with the ability to set a custom HTTPClient for a request. -func NewIpamPrefixesAvailableIpsReadParamsWithHTTPClient(client *http.Client) *IpamPrefixesAvailableIpsReadParams { - return &IpamPrefixesAvailableIpsReadParams{ +func NewIpamPrefixesAvailableIpsListParamsWithHTTPClient(client *http.Client) *IpamPrefixesAvailableIpsListParams { + return &IpamPrefixesAvailableIpsListParams{ HTTPClient: client, } } -/* IpamPrefixesAvailableIpsReadParams contains all the parameters to send to the API endpoint - for the ipam prefixes available ips read operation. +/* IpamPrefixesAvailableIpsListParams contains all the parameters to send to the API endpoint + for the ipam prefixes available ips list operation. Typically these are written to a http.Request. */ -type IpamPrefixesAvailableIpsReadParams struct { +type IpamPrefixesAvailableIpsListParams struct { /* ID. - A unique integer value identifying this prefix. + A unique integer value identifying this IP address. */ ID int64 @@ -86,67 +86,67 @@ type IpamPrefixesAvailableIpsReadParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the ipam prefixes available ips read params (not the query body). +// WithDefaults hydrates default values in the ipam prefixes available ips list params (not the query body). // // All values with no default are reset to their zero value. -func (o *IpamPrefixesAvailableIpsReadParams) WithDefaults() *IpamPrefixesAvailableIpsReadParams { +func (o *IpamPrefixesAvailableIpsListParams) WithDefaults() *IpamPrefixesAvailableIpsListParams { o.SetDefaults() return o } -// SetDefaults hydrates default values in the ipam prefixes available ips read params (not the query body). +// SetDefaults hydrates default values in the ipam prefixes available ips list params (not the query body). // // All values with no default are reset to their zero value. -func (o *IpamPrefixesAvailableIpsReadParams) SetDefaults() { +func (o *IpamPrefixesAvailableIpsListParams) SetDefaults() { // no default values defined for this parameter } -// WithTimeout adds the timeout to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) WithTimeout(timeout time.Duration) *IpamPrefixesAvailableIpsReadParams { +// WithTimeout adds the timeout to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) WithTimeout(timeout time.Duration) *IpamPrefixesAvailableIpsListParams { o.SetTimeout(timeout) return o } -// SetTimeout adds the timeout to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) SetTimeout(timeout time.Duration) { +// SetTimeout adds the timeout to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } -// WithContext adds the context to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) WithContext(ctx context.Context) *IpamPrefixesAvailableIpsReadParams { +// WithContext adds the context to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) WithContext(ctx context.Context) *IpamPrefixesAvailableIpsListParams { o.SetContext(ctx) return o } -// SetContext adds the context to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) SetContext(ctx context.Context) { +// SetContext adds the context to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) SetContext(ctx context.Context) { o.Context = ctx } -// WithHTTPClient adds the HTTPClient to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) WithHTTPClient(client *http.Client) *IpamPrefixesAvailableIpsReadParams { +// WithHTTPClient adds the HTTPClient to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) WithHTTPClient(client *http.Client) *IpamPrefixesAvailableIpsListParams { o.SetHTTPClient(client) return o } -// SetHTTPClient adds the HTTPClient to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) SetHTTPClient(client *http.Client) { +// SetHTTPClient adds the HTTPClient to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithID adds the id to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) WithID(id int64) *IpamPrefixesAvailableIpsReadParams { +// WithID adds the id to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) WithID(id int64) *IpamPrefixesAvailableIpsListParams { o.SetID(id) return o } -// SetID adds the id to the ipam prefixes available ips read params -func (o *IpamPrefixesAvailableIpsReadParams) SetID(id int64) { +// SetID adds the id to the ipam prefixes available ips list params +func (o *IpamPrefixesAvailableIpsListParams) SetID(id int64) { o.ID = id } // WriteToRequest writes these params to a swagger request -func (o *IpamPrefixesAvailableIpsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { +func (o *IpamPrefixesAvailableIpsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_list_responses.go similarity index 69% rename from vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_read_responses.go rename to vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_list_responses.go index 489202879..50354a452 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_read_responses.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_ips_list_responses.go @@ -30,16 +30,16 @@ import ( "github.com/smutel/go-netbox/netbox/models" ) -// IpamPrefixesAvailableIpsReadReader is a Reader for the IpamPrefixesAvailableIpsRead structure. -type IpamPrefixesAvailableIpsReadReader struct { +// IpamPrefixesAvailableIpsListReader is a Reader for the IpamPrefixesAvailableIpsList structure. +type IpamPrefixesAvailableIpsListReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IpamPrefixesAvailableIpsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *IpamPrefixesAvailableIpsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIpamPrefixesAvailableIpsReadOK() + result := NewIpamPrefixesAvailableIpsListOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -49,27 +49,27 @@ func (o *IpamPrefixesAvailableIpsReadReader) ReadResponse(response runtime.Clien } } -// NewIpamPrefixesAvailableIpsReadOK creates a IpamPrefixesAvailableIpsReadOK with default headers values -func NewIpamPrefixesAvailableIpsReadOK() *IpamPrefixesAvailableIpsReadOK { - return &IpamPrefixesAvailableIpsReadOK{} +// NewIpamPrefixesAvailableIpsListOK creates a IpamPrefixesAvailableIpsListOK with default headers values +func NewIpamPrefixesAvailableIpsListOK() *IpamPrefixesAvailableIpsListOK { + return &IpamPrefixesAvailableIpsListOK{} } -/* IpamPrefixesAvailableIpsReadOK describes a response with status code 200, with default header values. +/* IpamPrefixesAvailableIpsListOK describes a response with status code 200, with default header values. -IpamPrefixesAvailableIpsReadOK ipam prefixes available ips read o k +IpamPrefixesAvailableIpsListOK ipam prefixes available ips list o k */ -type IpamPrefixesAvailableIpsReadOK struct { +type IpamPrefixesAvailableIpsListOK struct { Payload []*models.AvailableIP } -func (o *IpamPrefixesAvailableIpsReadOK) Error() string { - return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-ips/][%d] ipamPrefixesAvailableIpsReadOK %+v", 200, o.Payload) +func (o *IpamPrefixesAvailableIpsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-ips/][%d] ipamPrefixesAvailableIpsListOK %+v", 200, o.Payload) } -func (o *IpamPrefixesAvailableIpsReadOK) GetPayload() []*models.AvailableIP { +func (o *IpamPrefixesAvailableIpsListOK) GetPayload() []*models.AvailableIP { return o.Payload } -func (o *IpamPrefixesAvailableIpsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *IpamPrefixesAvailableIpsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_create_responses.go index 2fbf7ba17..299b63fb7 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_create_responses.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_create_responses.go @@ -59,22 +59,20 @@ func NewIpamPrefixesAvailablePrefixesCreateCreated() *IpamPrefixesAvailablePrefi IpamPrefixesAvailablePrefixesCreateCreated ipam prefixes available prefixes create created */ type IpamPrefixesAvailablePrefixesCreateCreated struct { - Payload *models.Prefix + Payload []*models.Prefix } func (o *IpamPrefixesAvailablePrefixesCreateCreated) Error() string { return fmt.Sprintf("[POST /ipam/prefixes/{id}/available-prefixes/][%d] ipamPrefixesAvailablePrefixesCreateCreated %+v", 201, o.Payload) } -func (o *IpamPrefixesAvailablePrefixesCreateCreated) GetPayload() *models.Prefix { +func (o *IpamPrefixesAvailablePrefixesCreateCreated) GetPayload() []*models.Prefix { return o.Payload } func (o *IpamPrefixesAvailablePrefixesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Prefix) - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_list_parameters.go similarity index 55% rename from vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_read_parameters.go rename to vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_list_parameters.go index 0771213ec..1d13c281f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_read_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_list_parameters.go @@ -32,48 +32,48 @@ import ( "github.com/go-openapi/swag" ) -// NewIpamPrefixesAvailablePrefixesReadParams creates a new IpamPrefixesAvailablePrefixesReadParams object, +// NewIpamPrefixesAvailablePrefixesListParams creates a new IpamPrefixesAvailablePrefixesListParams object, // with the default timeout for this client. // // Default values are not hydrated, since defaults are normally applied by the API server side. // // To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewIpamPrefixesAvailablePrefixesReadParams() *IpamPrefixesAvailablePrefixesReadParams { - return &IpamPrefixesAvailablePrefixesReadParams{ +func NewIpamPrefixesAvailablePrefixesListParams() *IpamPrefixesAvailablePrefixesListParams { + return &IpamPrefixesAvailablePrefixesListParams{ timeout: cr.DefaultTimeout, } } -// NewIpamPrefixesAvailablePrefixesReadParamsWithTimeout creates a new IpamPrefixesAvailablePrefixesReadParams object +// NewIpamPrefixesAvailablePrefixesListParamsWithTimeout creates a new IpamPrefixesAvailablePrefixesListParams object // with the ability to set a timeout on a request. -func NewIpamPrefixesAvailablePrefixesReadParamsWithTimeout(timeout time.Duration) *IpamPrefixesAvailablePrefixesReadParams { - return &IpamPrefixesAvailablePrefixesReadParams{ +func NewIpamPrefixesAvailablePrefixesListParamsWithTimeout(timeout time.Duration) *IpamPrefixesAvailablePrefixesListParams { + return &IpamPrefixesAvailablePrefixesListParams{ timeout: timeout, } } -// NewIpamPrefixesAvailablePrefixesReadParamsWithContext creates a new IpamPrefixesAvailablePrefixesReadParams object +// NewIpamPrefixesAvailablePrefixesListParamsWithContext creates a new IpamPrefixesAvailablePrefixesListParams object // with the ability to set a context for a request. -func NewIpamPrefixesAvailablePrefixesReadParamsWithContext(ctx context.Context) *IpamPrefixesAvailablePrefixesReadParams { - return &IpamPrefixesAvailablePrefixesReadParams{ +func NewIpamPrefixesAvailablePrefixesListParamsWithContext(ctx context.Context) *IpamPrefixesAvailablePrefixesListParams { + return &IpamPrefixesAvailablePrefixesListParams{ Context: ctx, } } -// NewIpamPrefixesAvailablePrefixesReadParamsWithHTTPClient creates a new IpamPrefixesAvailablePrefixesReadParams object +// NewIpamPrefixesAvailablePrefixesListParamsWithHTTPClient creates a new IpamPrefixesAvailablePrefixesListParams object // with the ability to set a custom HTTPClient for a request. -func NewIpamPrefixesAvailablePrefixesReadParamsWithHTTPClient(client *http.Client) *IpamPrefixesAvailablePrefixesReadParams { - return &IpamPrefixesAvailablePrefixesReadParams{ +func NewIpamPrefixesAvailablePrefixesListParamsWithHTTPClient(client *http.Client) *IpamPrefixesAvailablePrefixesListParams { + return &IpamPrefixesAvailablePrefixesListParams{ HTTPClient: client, } } -/* IpamPrefixesAvailablePrefixesReadParams contains all the parameters to send to the API endpoint - for the ipam prefixes available prefixes read operation. +/* IpamPrefixesAvailablePrefixesListParams contains all the parameters to send to the API endpoint + for the ipam prefixes available prefixes list operation. Typically these are written to a http.Request. */ -type IpamPrefixesAvailablePrefixesReadParams struct { +type IpamPrefixesAvailablePrefixesListParams struct { /* ID. @@ -86,67 +86,67 @@ type IpamPrefixesAvailablePrefixesReadParams struct { HTTPClient *http.Client } -// WithDefaults hydrates default values in the ipam prefixes available prefixes read params (not the query body). +// WithDefaults hydrates default values in the ipam prefixes available prefixes list params (not the query body). // // All values with no default are reset to their zero value. -func (o *IpamPrefixesAvailablePrefixesReadParams) WithDefaults() *IpamPrefixesAvailablePrefixesReadParams { +func (o *IpamPrefixesAvailablePrefixesListParams) WithDefaults() *IpamPrefixesAvailablePrefixesListParams { o.SetDefaults() return o } -// SetDefaults hydrates default values in the ipam prefixes available prefixes read params (not the query body). +// SetDefaults hydrates default values in the ipam prefixes available prefixes list params (not the query body). // // All values with no default are reset to their zero value. -func (o *IpamPrefixesAvailablePrefixesReadParams) SetDefaults() { +func (o *IpamPrefixesAvailablePrefixesListParams) SetDefaults() { // no default values defined for this parameter } -// WithTimeout adds the timeout to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) WithTimeout(timeout time.Duration) *IpamPrefixesAvailablePrefixesReadParams { +// WithTimeout adds the timeout to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) WithTimeout(timeout time.Duration) *IpamPrefixesAvailablePrefixesListParams { o.SetTimeout(timeout) return o } -// SetTimeout adds the timeout to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) SetTimeout(timeout time.Duration) { +// SetTimeout adds the timeout to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } -// WithContext adds the context to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) WithContext(ctx context.Context) *IpamPrefixesAvailablePrefixesReadParams { +// WithContext adds the context to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) WithContext(ctx context.Context) *IpamPrefixesAvailablePrefixesListParams { o.SetContext(ctx) return o } -// SetContext adds the context to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) SetContext(ctx context.Context) { +// SetContext adds the context to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) SetContext(ctx context.Context) { o.Context = ctx } -// WithHTTPClient adds the HTTPClient to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) WithHTTPClient(client *http.Client) *IpamPrefixesAvailablePrefixesReadParams { +// WithHTTPClient adds the HTTPClient to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) WithHTTPClient(client *http.Client) *IpamPrefixesAvailablePrefixesListParams { o.SetHTTPClient(client) return o } -// SetHTTPClient adds the HTTPClient to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) SetHTTPClient(client *http.Client) { +// SetHTTPClient adds the HTTPClient to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } -// WithID adds the id to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) WithID(id int64) *IpamPrefixesAvailablePrefixesReadParams { +// WithID adds the id to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) WithID(id int64) *IpamPrefixesAvailablePrefixesListParams { o.SetID(id) return o } -// SetID adds the id to the ipam prefixes available prefixes read params -func (o *IpamPrefixesAvailablePrefixesReadParams) SetID(id int64) { +// SetID adds the id to the ipam prefixes available prefixes list params +func (o *IpamPrefixesAvailablePrefixesListParams) SetID(id int64) { o.ID = id } // WriteToRequest writes these params to a swagger request -func (o *IpamPrefixesAvailablePrefixesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { +func (o *IpamPrefixesAvailablePrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_list_responses.go similarity index 68% rename from vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_read_responses.go rename to vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_list_responses.go index 8028d1689..239e71a4c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_read_responses.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_available_prefixes_list_responses.go @@ -30,16 +30,16 @@ import ( "github.com/smutel/go-netbox/netbox/models" ) -// IpamPrefixesAvailablePrefixesReadReader is a Reader for the IpamPrefixesAvailablePrefixesRead structure. -type IpamPrefixesAvailablePrefixesReadReader struct { +// IpamPrefixesAvailablePrefixesListReader is a Reader for the IpamPrefixesAvailablePrefixesList structure. +type IpamPrefixesAvailablePrefixesListReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IpamPrefixesAvailablePrefixesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *IpamPrefixesAvailablePrefixesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIpamPrefixesAvailablePrefixesReadOK() + result := NewIpamPrefixesAvailablePrefixesListOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -49,27 +49,27 @@ func (o *IpamPrefixesAvailablePrefixesReadReader) ReadResponse(response runtime. } } -// NewIpamPrefixesAvailablePrefixesReadOK creates a IpamPrefixesAvailablePrefixesReadOK with default headers values -func NewIpamPrefixesAvailablePrefixesReadOK() *IpamPrefixesAvailablePrefixesReadOK { - return &IpamPrefixesAvailablePrefixesReadOK{} +// NewIpamPrefixesAvailablePrefixesListOK creates a IpamPrefixesAvailablePrefixesListOK with default headers values +func NewIpamPrefixesAvailablePrefixesListOK() *IpamPrefixesAvailablePrefixesListOK { + return &IpamPrefixesAvailablePrefixesListOK{} } -/* IpamPrefixesAvailablePrefixesReadOK describes a response with status code 200, with default header values. +/* IpamPrefixesAvailablePrefixesListOK describes a response with status code 200, with default header values. -IpamPrefixesAvailablePrefixesReadOK ipam prefixes available prefixes read o k +IpamPrefixesAvailablePrefixesListOK ipam prefixes available prefixes list o k */ -type IpamPrefixesAvailablePrefixesReadOK struct { +type IpamPrefixesAvailablePrefixesListOK struct { Payload []*models.AvailablePrefix } -func (o *IpamPrefixesAvailablePrefixesReadOK) Error() string { - return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-prefixes/][%d] ipamPrefixesAvailablePrefixesReadOK %+v", 200, o.Payload) +func (o *IpamPrefixesAvailablePrefixesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-prefixes/][%d] ipamPrefixesAvailablePrefixesListOK %+v", 200, o.Payload) } -func (o *IpamPrefixesAvailablePrefixesReadOK) GetPayload() []*models.AvailablePrefix { +func (o *IpamPrefixesAvailablePrefixesListOK) GetPayload() []*models.AvailablePrefix { return o.Payload } -func (o *IpamPrefixesAvailablePrefixesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *IpamPrefixesAvailablePrefixesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_list_parameters.go index 9b5c16b1b..1f04e8415 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_prefixes_list_parameters.go @@ -123,6 +123,39 @@ type IpamPrefixesListParams struct { // Depthn. Depthn *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Family. Family *float64 @@ -285,6 +318,21 @@ type IpamPrefixesListParams struct { // VlanVid. VlanVid *float64 + // VlanVidGt. + VlanVidGt *float64 + + // VlanVidGte. + VlanVidGte *float64 + + // VlanVidLt. + VlanVidLt *float64 + + // VlanVidLte. + VlanVidLte *float64 + + // VlanVidn. + VlanVidn *float64 + // Vrf. Vrf *string @@ -532,6 +580,127 @@ func (o *IpamPrefixesListParams) SetDepthn(depthn *string) { o.Depthn = depthn } +// WithDescription adds the description to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescription(description *string) *IpamPrefixesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamPrefixesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionIc(descriptionIc *string) *IpamPrefixesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionIe(descriptionIe *string) *IpamPrefixesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionIew(descriptionIew *string) *IpamPrefixesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionIsw(descriptionIsw *string) *IpamPrefixesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionn(descriptionn *string) *IpamPrefixesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionNic(descriptionNic *string) *IpamPrefixesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionNie(descriptionNie *string) *IpamPrefixesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionNiew(descriptionNiew *string) *IpamPrefixesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithDescriptionNisw(descriptionNisw *string) *IpamPrefixesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithFamily adds the family to the ipam prefixes list params func (o *IpamPrefixesListParams) WithFamily(family *float64) *IpamPrefixesListParams { o.SetFamily(family) @@ -1104,6 +1273,61 @@ func (o *IpamPrefixesListParams) SetVlanVid(vlanVid *float64) { o.VlanVid = vlanVid } +// WithVlanVidGt adds the vlanVidGt to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithVlanVidGt(vlanVidGt *float64) *IpamPrefixesListParams { + o.SetVlanVidGt(vlanVidGt) + return o +} + +// SetVlanVidGt adds the vlanVidGt to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetVlanVidGt(vlanVidGt *float64) { + o.VlanVidGt = vlanVidGt +} + +// WithVlanVidGte adds the vlanVidGte to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithVlanVidGte(vlanVidGte *float64) *IpamPrefixesListParams { + o.SetVlanVidGte(vlanVidGte) + return o +} + +// SetVlanVidGte adds the vlanVidGte to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetVlanVidGte(vlanVidGte *float64) { + o.VlanVidGte = vlanVidGte +} + +// WithVlanVidLt adds the vlanVidLt to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithVlanVidLt(vlanVidLt *float64) *IpamPrefixesListParams { + o.SetVlanVidLt(vlanVidLt) + return o +} + +// SetVlanVidLt adds the vlanVidLt to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetVlanVidLt(vlanVidLt *float64) { + o.VlanVidLt = vlanVidLt +} + +// WithVlanVidLte adds the vlanVidLte to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithVlanVidLte(vlanVidLte *float64) *IpamPrefixesListParams { + o.SetVlanVidLte(vlanVidLte) + return o +} + +// SetVlanVidLte adds the vlanVidLte to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetVlanVidLte(vlanVidLte *float64) { + o.VlanVidLte = vlanVidLte +} + +// WithVlanVidn adds the vlanVidn to the ipam prefixes list params +func (o *IpamPrefixesListParams) WithVlanVidn(vlanVidn *float64) *IpamPrefixesListParams { + o.SetVlanVidn(vlanVidn) + return o +} + +// SetVlanVidn adds the vlanVidN to the ipam prefixes list params +func (o *IpamPrefixesListParams) SetVlanVidn(vlanVidn *float64) { + o.VlanVidn = vlanVidn +} + // WithVrf adds the vrf to the ipam prefixes list params func (o *IpamPrefixesListParams) WithVrf(vrf *string) *IpamPrefixesListParams { o.SetVrf(vrf) @@ -1450,6 +1674,193 @@ func (o *IpamPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg str } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Family != nil { // query param family @@ -2334,6 +2745,91 @@ func (o *IpamPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg str } } + if o.VlanVidGt != nil { + + // query param vlan_vid__gt + var qrVlanVidGt float64 + + if o.VlanVidGt != nil { + qrVlanVidGt = *o.VlanVidGt + } + qVlanVidGt := swag.FormatFloat64(qrVlanVidGt) + if qVlanVidGt != "" { + + if err := r.SetQueryParam("vlan_vid__gt", qVlanVidGt); err != nil { + return err + } + } + } + + if o.VlanVidGte != nil { + + // query param vlan_vid__gte + var qrVlanVidGte float64 + + if o.VlanVidGte != nil { + qrVlanVidGte = *o.VlanVidGte + } + qVlanVidGte := swag.FormatFloat64(qrVlanVidGte) + if qVlanVidGte != "" { + + if err := r.SetQueryParam("vlan_vid__gte", qVlanVidGte); err != nil { + return err + } + } + } + + if o.VlanVidLt != nil { + + // query param vlan_vid__lt + var qrVlanVidLt float64 + + if o.VlanVidLt != nil { + qrVlanVidLt = *o.VlanVidLt + } + qVlanVidLt := swag.FormatFloat64(qrVlanVidLt) + if qVlanVidLt != "" { + + if err := r.SetQueryParam("vlan_vid__lt", qVlanVidLt); err != nil { + return err + } + } + } + + if o.VlanVidLte != nil { + + // query param vlan_vid__lte + var qrVlanVidLte float64 + + if o.VlanVidLte != nil { + qrVlanVidLte = *o.VlanVidLte + } + qVlanVidLte := swag.FormatFloat64(qrVlanVidLte) + if qVlanVidLte != "" { + + if err := r.SetQueryParam("vlan_vid__lte", qVlanVidLte); err != nil { + return err + } + } + } + + if o.VlanVidn != nil { + + // query param vlan_vid__n + var qrVlanVidn float64 + + if o.VlanVidn != nil { + qrVlanVidn = *o.VlanVidn + } + qVlanVidn := swag.FormatFloat64(qrVlanVidn) + if qVlanVidn != "" { + + if err := r.SetQueryParam("vlan_vid__n", qVlanVidn); err != nil { + return err + } + } + } + if o.Vrf != nil { // query param vrf diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_rirs_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_rirs_list_parameters.go index 62ebb49c1..184677dc6 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_rirs_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_rirs_list_parameters.go @@ -228,6 +228,12 @@ type IpamRirsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -820,6 +826,28 @@ func (o *IpamRirsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the ipam rirs list params +func (o *IpamRirsListParams) WithTag(tag *string) *IpamRirsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam rirs list params +func (o *IpamRirsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the ipam rirs list params +func (o *IpamRirsListParams) WithTagn(tagn *string) *IpamRirsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the ipam rirs list params +func (o *IpamRirsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *IpamRirsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -1661,6 +1689,40 @@ func (o *IpamRirsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_roles_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_roles_list_parameters.go index 91a0b2607..8558c90c0 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_roles_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_roles_list_parameters.go @@ -84,6 +84,39 @@ type IpamRolesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ID. ID *string @@ -192,6 +225,12 @@ type IpamRolesListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -278,6 +317,127 @@ func (o *IpamRolesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the ipam roles list params +func (o *IpamRolesListParams) WithDescription(description *string) *IpamRolesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam roles list params +func (o *IpamRolesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamRolesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionIc(descriptionIc *string) *IpamRolesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionIe(descriptionIe *string) *IpamRolesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionIew(descriptionIew *string) *IpamRolesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionIsw(descriptionIsw *string) *IpamRolesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionn(descriptionn *string) *IpamRolesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionNic(descriptionNic *string) *IpamRolesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionNie(descriptionNie *string) *IpamRolesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionNiew(descriptionNiew *string) *IpamRolesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam roles list params +func (o *IpamRolesListParams) WithDescriptionNisw(descriptionNisw *string) *IpamRolesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam roles list params +func (o *IpamRolesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithID adds the id to the ipam roles list params func (o *IpamRolesListParams) WithID(id *string) *IpamRolesListParams { o.SetID(id) @@ -652,6 +812,28 @@ func (o *IpamRolesListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the ipam roles list params +func (o *IpamRolesListParams) WithTag(tag *string) *IpamRolesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam roles list params +func (o *IpamRolesListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the ipam roles list params +func (o *IpamRolesListParams) WithTagn(tagn *string) *IpamRolesListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the ipam roles list params +func (o *IpamRolesListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *IpamRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -711,6 +893,193 @@ func (o *IpamRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ID != nil { // query param id @@ -1289,6 +1658,40 @@ func (o *IpamRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_route_targets_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_route_targets_list_parameters.go index 08efd7134..5776aa8d0 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_route_targets_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_route_targets_list_parameters.go @@ -84,6 +84,39 @@ type IpamRouteTargetsListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // ExportingVrf. ExportingVrf *string @@ -299,6 +332,127 @@ func (o *IpamRouteTargetsListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescription(description *string) *IpamRouteTargetsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamRouteTargetsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionIc(descriptionIc *string) *IpamRouteTargetsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionIe(descriptionIe *string) *IpamRouteTargetsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionIew(descriptionIew *string) *IpamRouteTargetsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionIsw(descriptionIsw *string) *IpamRouteTargetsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionn(descriptionn *string) *IpamRouteTargetsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionNic(descriptionNic *string) *IpamRouteTargetsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionNie(descriptionNie *string) *IpamRouteTargetsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionNiew(descriptionNiew *string) *IpamRouteTargetsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam route targets list params +func (o *IpamRouteTargetsListParams) WithDescriptionNisw(descriptionNisw *string) *IpamRouteTargetsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam route targets list params +func (o *IpamRouteTargetsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithExportingVrf adds the exportingVrf to the ipam route targets list params func (o *IpamRouteTargetsListParams) WithExportingVrf(exportingVrf *string) *IpamRouteTargetsListParams { o.SetExportingVrf(exportingVrf) @@ -809,6 +963,193 @@ func (o *IpamRouteTargetsListParams) WriteToRequest(r runtime.ClientRequest, reg } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.ExportingVrf != nil { // query param exporting_vrf diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_services_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_services_list_parameters.go index 42348e071..fd9c98909 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_services_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_services_list_parameters.go @@ -84,6 +84,39 @@ type IpamServicesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Device. Device *string @@ -284,6 +317,127 @@ func (o *IpamServicesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the ipam services list params +func (o *IpamServicesListParams) WithDescription(description *string) *IpamServicesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam services list params +func (o *IpamServicesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamServicesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionIc(descriptionIc *string) *IpamServicesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionIe(descriptionIe *string) *IpamServicesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionIew(descriptionIew *string) *IpamServicesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionIsw(descriptionIsw *string) *IpamServicesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionn(descriptionn *string) *IpamServicesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionNic(descriptionNic *string) *IpamServicesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionNie(descriptionNie *string) *IpamServicesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionNiew(descriptionNiew *string) *IpamServicesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam services list params +func (o *IpamServicesListParams) WithDescriptionNisw(descriptionNisw *string) *IpamServicesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam services list params +func (o *IpamServicesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithDevice adds the device to the ipam services list params func (o *IpamServicesListParams) WithDevice(device *string) *IpamServicesListParams { o.SetDevice(device) @@ -739,6 +893,193 @@ func (o *IpamServicesListParams) WriteToRequest(r runtime.ClientRequest, reg str } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Device != nil { // query param device diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlan_groups_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlan_groups_list_parameters.go index 8d83c2aa9..f0fbc51f4 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlan_groups_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlan_groups_list_parameters.go @@ -270,6 +270,12 @@ type IpamVlanGroupsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -1016,6 +1022,28 @@ func (o *IpamVlanGroupsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the ipam vlan groups list params +func (o *IpamVlanGroupsListParams) WithTag(tag *string) *IpamVlanGroupsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam vlan groups list params +func (o *IpamVlanGroupsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the ipam vlan groups list params +func (o *IpamVlanGroupsListParams) WithTagn(tagn *string) *IpamVlanGroupsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the ipam vlan groups list params +func (o *IpamVlanGroupsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *IpamVlanGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -2095,6 +2123,40 @@ func (o *IpamVlanGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg s } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlans_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlans_list_parameters.go index c2ef62594..29d70f75c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlans_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vlans_list_parameters.go @@ -90,6 +90,39 @@ type IpamVlansListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Group. Group *string @@ -387,6 +420,127 @@ func (o *IpamVlansListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the ipam vlans list params +func (o *IpamVlansListParams) WithDescription(description *string) *IpamVlansListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam vlans list params +func (o *IpamVlansListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamVlansListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionIc(descriptionIc *string) *IpamVlansListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionIe(descriptionIe *string) *IpamVlansListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionIew(descriptionIew *string) *IpamVlansListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionIsw(descriptionIsw *string) *IpamVlansListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionn(descriptionn *string) *IpamVlansListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionNic(descriptionNic *string) *IpamVlansListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionNie(descriptionNie *string) *IpamVlansListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionNiew(descriptionNiew *string) *IpamVlansListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam vlans list params +func (o *IpamVlansListParams) WithDescriptionNisw(descriptionNisw *string) *IpamVlansListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam vlans list params +func (o *IpamVlansListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithGroup adds the group to the ipam vlans list params func (o *IpamVlansListParams) WithGroup(group *string) *IpamVlansListParams { o.SetGroup(group) @@ -1151,6 +1305,193 @@ func (o *IpamVlansListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Group != nil { // query param group diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vrfs_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vrfs_list_parameters.go index a7a801bee..d9861488f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vrfs_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/ipam/ipam_vrfs_list_parameters.go @@ -84,6 +84,39 @@ type IpamVrfsListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // EnforceUnique. EnforceUnique *string @@ -335,6 +368,127 @@ func (o *IpamVrfsListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescription(description *string) *IpamVrfsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionEmpty(descriptionEmpty *string) *IpamVrfsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionIc(descriptionIc *string) *IpamVrfsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionIe(descriptionIe *string) *IpamVrfsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionIew(descriptionIew *string) *IpamVrfsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionIsw(descriptionIsw *string) *IpamVrfsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionn(descriptionn *string) *IpamVrfsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionNic(descriptionNic *string) *IpamVrfsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionNie(descriptionNie *string) *IpamVrfsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionNiew(descriptionNiew *string) *IpamVrfsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the ipam vrfs list params +func (o *IpamVrfsListParams) WithDescriptionNisw(descriptionNisw *string) *IpamVrfsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the ipam vrfs list params +func (o *IpamVrfsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithEnforceUnique adds the enforceUnique to the ipam vrfs list params func (o *IpamVrfsListParams) WithEnforceUnique(enforceUnique *string) *IpamVrfsListParams { o.SetEnforceUnique(enforceUnique) @@ -977,6 +1131,193 @@ func (o *IpamVrfsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.EnforceUnique != nil { // query param enforce_unique diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/net_box_api_client.go b/vendor/github.com/smutel/go-netbox/netbox/client/net_box_api_client.go index e8ee65e26..651009837 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/net_box_api_client.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/net_box_api_client.go @@ -33,6 +33,7 @@ import ( "github.com/smutel/go-netbox/netbox/client/tenancy" "github.com/smutel/go-netbox/netbox/client/users" "github.com/smutel/go-netbox/netbox/client/virtualization" + "github.com/smutel/go-netbox/netbox/client/wireless" ) // Default net box API HTTP client. @@ -85,6 +86,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *NetBoxAPI cli.Tenancy = tenancy.New(transport, formats) cli.Users = users.New(transport, formats) cli.Virtualization = virtualization.New(transport, formats) + cli.Wireless = wireless.New(transport, formats) return cli } @@ -145,6 +147,8 @@ type NetBoxAPI struct { Virtualization virtualization.ClientService + Wireless wireless.ClientService + Transport runtime.ClientTransport } @@ -159,4 +163,5 @@ func (c *NetBoxAPI) SetTransport(transport runtime.ClientTransport) { c.Tenancy.SetTransport(transport) c.Users.SetTransport(transport) c.Virtualization.SetTransport(transport) + c.Wireless.SetTransport(transport) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_client.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_client.go index e4e39e8ee..2330a867f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_client.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_client.go @@ -45,6 +45,78 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { + TenancyContactAssignmentsBulkDelete(params *TenancyContactAssignmentsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsBulkDeleteNoContent, error) + + TenancyContactAssignmentsBulkPartialUpdate(params *TenancyContactAssignmentsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsBulkPartialUpdateOK, error) + + TenancyContactAssignmentsBulkUpdate(params *TenancyContactAssignmentsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsBulkUpdateOK, error) + + TenancyContactAssignmentsCreate(params *TenancyContactAssignmentsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsCreateCreated, error) + + TenancyContactAssignmentsDelete(params *TenancyContactAssignmentsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsDeleteNoContent, error) + + TenancyContactAssignmentsList(params *TenancyContactAssignmentsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsListOK, error) + + TenancyContactAssignmentsPartialUpdate(params *TenancyContactAssignmentsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsPartialUpdateOK, error) + + TenancyContactAssignmentsRead(params *TenancyContactAssignmentsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsReadOK, error) + + TenancyContactAssignmentsUpdate(params *TenancyContactAssignmentsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsUpdateOK, error) + + TenancyContactGroupsBulkDelete(params *TenancyContactGroupsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsBulkDeleteNoContent, error) + + TenancyContactGroupsBulkPartialUpdate(params *TenancyContactGroupsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsBulkPartialUpdateOK, error) + + TenancyContactGroupsBulkUpdate(params *TenancyContactGroupsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsBulkUpdateOK, error) + + TenancyContactGroupsCreate(params *TenancyContactGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsCreateCreated, error) + + TenancyContactGroupsDelete(params *TenancyContactGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsDeleteNoContent, error) + + TenancyContactGroupsList(params *TenancyContactGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsListOK, error) + + TenancyContactGroupsPartialUpdate(params *TenancyContactGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsPartialUpdateOK, error) + + TenancyContactGroupsRead(params *TenancyContactGroupsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsReadOK, error) + + TenancyContactGroupsUpdate(params *TenancyContactGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsUpdateOK, error) + + TenancyContactRolesBulkDelete(params *TenancyContactRolesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesBulkDeleteNoContent, error) + + TenancyContactRolesBulkPartialUpdate(params *TenancyContactRolesBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesBulkPartialUpdateOK, error) + + TenancyContactRolesBulkUpdate(params *TenancyContactRolesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesBulkUpdateOK, error) + + TenancyContactRolesCreate(params *TenancyContactRolesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesCreateCreated, error) + + TenancyContactRolesDelete(params *TenancyContactRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesDeleteNoContent, error) + + TenancyContactRolesList(params *TenancyContactRolesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesListOK, error) + + TenancyContactRolesPartialUpdate(params *TenancyContactRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesPartialUpdateOK, error) + + TenancyContactRolesRead(params *TenancyContactRolesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesReadOK, error) + + TenancyContactRolesUpdate(params *TenancyContactRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesUpdateOK, error) + + TenancyContactsBulkDelete(params *TenancyContactsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsBulkDeleteNoContent, error) + + TenancyContactsBulkPartialUpdate(params *TenancyContactsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsBulkPartialUpdateOK, error) + + TenancyContactsBulkUpdate(params *TenancyContactsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsBulkUpdateOK, error) + + TenancyContactsCreate(params *TenancyContactsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsCreateCreated, error) + + TenancyContactsDelete(params *TenancyContactsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsDeleteNoContent, error) + + TenancyContactsList(params *TenancyContactsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsListOK, error) + + TenancyContactsPartialUpdate(params *TenancyContactsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsPartialUpdateOK, error) + + TenancyContactsRead(params *TenancyContactsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsReadOK, error) + + TenancyContactsUpdate(params *TenancyContactsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsUpdateOK, error) + TenancyTenantGroupsBulkDelete(params *TenancyTenantGroupsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyTenantGroupsBulkDeleteNoContent, error) TenancyTenantGroupsBulkPartialUpdate(params *TenancyTenantGroupsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyTenantGroupsBulkPartialUpdateOK, error) @@ -84,6 +156,1410 @@ type ClientService interface { SetTransport(transport runtime.ClientTransport) } +/* + TenancyContactAssignmentsBulkDelete tenancy contact assignments bulk delete API +*/ +func (a *Client) TenancyContactAssignmentsBulkDelete(params *TenancyContactAssignmentsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_bulk_delete", + Method: "DELETE", + PathPattern: "/tenancy/contact-assignments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsBulkPartialUpdate tenancy contact assignments bulk partial update API +*/ +func (a *Client) TenancyContactAssignmentsBulkPartialUpdate(params *TenancyContactAssignmentsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_bulk_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contact-assignments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsBulkUpdate tenancy contact assignments bulk update API +*/ +func (a *Client) TenancyContactAssignmentsBulkUpdate(params *TenancyContactAssignmentsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_bulk_update", + Method: "PUT", + PathPattern: "/tenancy/contact-assignments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsCreate tenancy contact assignments create API +*/ +func (a *Client) TenancyContactAssignmentsCreate(params *TenancyContactAssignmentsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsCreateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_create", + Method: "POST", + PathPattern: "/tenancy/contact-assignments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsDelete tenancy contact assignments delete API +*/ +func (a *Client) TenancyContactAssignmentsDelete(params *TenancyContactAssignmentsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_delete", + Method: "DELETE", + PathPattern: "/tenancy/contact-assignments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) TenancyContactAssignmentsList(params *TenancyContactAssignmentsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsListParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_list", + Method: "GET", + PathPattern: "/tenancy/contact-assignments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsPartialUpdate tenancy contact assignments partial update API +*/ +func (a *Client) TenancyContactAssignmentsPartialUpdate(params *TenancyContactAssignmentsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contact-assignments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsRead tenancy contact assignments read API +*/ +func (a *Client) TenancyContactAssignmentsRead(params *TenancyContactAssignmentsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsReadParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_read", + Method: "GET", + PathPattern: "/tenancy/contact-assignments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactAssignmentsUpdate tenancy contact assignments update API +*/ +func (a *Client) TenancyContactAssignmentsUpdate(params *TenancyContactAssignmentsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactAssignmentsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactAssignmentsUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-assignments_update", + Method: "PUT", + PathPattern: "/tenancy/contact-assignments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactAssignmentsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactAssignmentsUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-assignments_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsBulkDelete tenancy contact groups bulk delete API +*/ +func (a *Client) TenancyContactGroupsBulkDelete(params *TenancyContactGroupsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_bulk_delete", + Method: "DELETE", + PathPattern: "/tenancy/contact-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsBulkPartialUpdate tenancy contact groups bulk partial update API +*/ +func (a *Client) TenancyContactGroupsBulkPartialUpdate(params *TenancyContactGroupsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_bulk_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contact-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsBulkUpdate tenancy contact groups bulk update API +*/ +func (a *Client) TenancyContactGroupsBulkUpdate(params *TenancyContactGroupsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_bulk_update", + Method: "PUT", + PathPattern: "/tenancy/contact-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsCreate tenancy contact groups create API +*/ +func (a *Client) TenancyContactGroupsCreate(params *TenancyContactGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsCreateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_create", + Method: "POST", + PathPattern: "/tenancy/contact-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsDelete tenancy contact groups delete API +*/ +func (a *Client) TenancyContactGroupsDelete(params *TenancyContactGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_delete", + Method: "DELETE", + PathPattern: "/tenancy/contact-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) TenancyContactGroupsList(params *TenancyContactGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsListParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_list", + Method: "GET", + PathPattern: "/tenancy/contact-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsPartialUpdate tenancy contact groups partial update API +*/ +func (a *Client) TenancyContactGroupsPartialUpdate(params *TenancyContactGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contact-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsRead tenancy contact groups read API +*/ +func (a *Client) TenancyContactGroupsRead(params *TenancyContactGroupsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsReadParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_read", + Method: "GET", + PathPattern: "/tenancy/contact-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactGroupsUpdate tenancy contact groups update API +*/ +func (a *Client) TenancyContactGroupsUpdate(params *TenancyContactGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactGroupsUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-groups_update", + Method: "PUT", + PathPattern: "/tenancy/contact-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactGroupsUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-groups_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesBulkDelete tenancy contact roles bulk delete API +*/ +func (a *Client) TenancyContactRolesBulkDelete(params *TenancyContactRolesBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_bulk_delete", + Method: "DELETE", + PathPattern: "/tenancy/contact-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesBulkPartialUpdate tenancy contact roles bulk partial update API +*/ +func (a *Client) TenancyContactRolesBulkPartialUpdate(params *TenancyContactRolesBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_bulk_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contact-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesBulkUpdate tenancy contact roles bulk update API +*/ +func (a *Client) TenancyContactRolesBulkUpdate(params *TenancyContactRolesBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_bulk_update", + Method: "PUT", + PathPattern: "/tenancy/contact-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesCreate tenancy contact roles create API +*/ +func (a *Client) TenancyContactRolesCreate(params *TenancyContactRolesCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesCreateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_create", + Method: "POST", + PathPattern: "/tenancy/contact-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesDelete tenancy contact roles delete API +*/ +func (a *Client) TenancyContactRolesDelete(params *TenancyContactRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_delete", + Method: "DELETE", + PathPattern: "/tenancy/contact-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) TenancyContactRolesList(params *TenancyContactRolesListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesListParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_list", + Method: "GET", + PathPattern: "/tenancy/contact-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesPartialUpdate tenancy contact roles partial update API +*/ +func (a *Client) TenancyContactRolesPartialUpdate(params *TenancyContactRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contact-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesRead tenancy contact roles read API +*/ +func (a *Client) TenancyContactRolesRead(params *TenancyContactRolesReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesReadParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_read", + Method: "GET", + PathPattern: "/tenancy/contact-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactRolesUpdate tenancy contact roles update API +*/ +func (a *Client) TenancyContactRolesUpdate(params *TenancyContactRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactRolesUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contact-roles_update", + Method: "PUT", + PathPattern: "/tenancy/contact-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactRolesUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contact-roles_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsBulkDelete tenancy contacts bulk delete API +*/ +func (a *Client) TenancyContactsBulkDelete(params *TenancyContactsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_bulk_delete", + Method: "DELETE", + PathPattern: "/tenancy/contacts/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsBulkPartialUpdate tenancy contacts bulk partial update API +*/ +func (a *Client) TenancyContactsBulkPartialUpdate(params *TenancyContactsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_bulk_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contacts/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsBulkUpdate tenancy contacts bulk update API +*/ +func (a *Client) TenancyContactsBulkUpdate(params *TenancyContactsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_bulk_update", + Method: "PUT", + PathPattern: "/tenancy/contacts/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsCreate tenancy contacts create API +*/ +func (a *Client) TenancyContactsCreate(params *TenancyContactsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsCreateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_create", + Method: "POST", + PathPattern: "/tenancy/contacts/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsDelete tenancy contacts delete API +*/ +func (a *Client) TenancyContactsDelete(params *TenancyContactsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_delete", + Method: "DELETE", + PathPattern: "/tenancy/contacts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) TenancyContactsList(params *TenancyContactsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsListParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_list", + Method: "GET", + PathPattern: "/tenancy/contacts/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsPartialUpdate tenancy contacts partial update API +*/ +func (a *Client) TenancyContactsPartialUpdate(params *TenancyContactsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/contacts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsRead tenancy contacts read API +*/ +func (a *Client) TenancyContactsRead(params *TenancyContactsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsReadParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_read", + Method: "GET", + PathPattern: "/tenancy/contacts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + TenancyContactsUpdate tenancy contacts update API +*/ +func (a *Client) TenancyContactsUpdate(params *TenancyContactsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*TenancyContactsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyContactsUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "tenancy_contacts_update", + Method: "PUT", + PathPattern: "/tenancy/contacts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyContactsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*TenancyContactsUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for tenancy_contacts_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* TenancyTenantGroupsBulkDelete tenancy tenant groups bulk delete API */ diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_parameters.go new file mode 100644 index 000000000..c554b0ad6 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewTenancyContactAssignmentsBulkDeleteParams creates a new TenancyContactAssignmentsBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsBulkDeleteParams() *TenancyContactAssignmentsBulkDeleteParams { + return &TenancyContactAssignmentsBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsBulkDeleteParamsWithTimeout creates a new TenancyContactAssignmentsBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsBulkDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsBulkDeleteParams { + return &TenancyContactAssignmentsBulkDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsBulkDeleteParamsWithContext creates a new TenancyContactAssignmentsBulkDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsBulkDeleteParamsWithContext(ctx context.Context) *TenancyContactAssignmentsBulkDeleteParams { + return &TenancyContactAssignmentsBulkDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsBulkDeleteParamsWithHTTPClient creates a new TenancyContactAssignmentsBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsBulkDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsBulkDeleteParams { + return &TenancyContactAssignmentsBulkDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsBulkDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments bulk delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsBulkDeleteParams) WithDefaults() *TenancyContactAssignmentsBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments bulk delete params +func (o *TenancyContactAssignmentsBulkDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments bulk delete params +func (o *TenancyContactAssignmentsBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments bulk delete params +func (o *TenancyContactAssignmentsBulkDeleteParams) WithContext(ctx context.Context) *TenancyContactAssignmentsBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments bulk delete params +func (o *TenancyContactAssignmentsBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments bulk delete params +func (o *TenancyContactAssignmentsBulkDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments bulk delete params +func (o *TenancyContactAssignmentsBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_responses.go new file mode 100644 index 000000000..15f5d9850 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactAssignmentsBulkDeleteReader is a Reader for the TenancyContactAssignmentsBulkDelete structure. +type TenancyContactAssignmentsBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactAssignmentsBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsBulkDeleteNoContent creates a TenancyContactAssignmentsBulkDeleteNoContent with default headers values +func NewTenancyContactAssignmentsBulkDeleteNoContent() *TenancyContactAssignmentsBulkDeleteNoContent { + return &TenancyContactAssignmentsBulkDeleteNoContent{} +} + +/* TenancyContactAssignmentsBulkDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactAssignmentsBulkDeleteNoContent tenancy contact assignments bulk delete no content +*/ +type TenancyContactAssignmentsBulkDeleteNoContent struct { +} + +func (o *TenancyContactAssignmentsBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contact-assignments/][%d] tenancyContactAssignmentsBulkDeleteNoContent ", 204) +} + +func (o *TenancyContactAssignmentsBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_parameters.go new file mode 100644 index 000000000..804670285 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactAssignmentsBulkPartialUpdateParams creates a new TenancyContactAssignmentsBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsBulkPartialUpdateParams() *TenancyContactAssignmentsBulkPartialUpdateParams { + return &TenancyContactAssignmentsBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsBulkPartialUpdateParamsWithTimeout creates a new TenancyContactAssignmentsBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsBulkPartialUpdateParams { + return &TenancyContactAssignmentsBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsBulkPartialUpdateParamsWithContext creates a new TenancyContactAssignmentsBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsBulkPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactAssignmentsBulkPartialUpdateParams { + return &TenancyContactAssignmentsBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsBulkPartialUpdateParamsWithHTTPClient creates a new TenancyContactAssignmentsBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsBulkPartialUpdateParams { + return &TenancyContactAssignmentsBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableContactAssignment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) WithDefaults() *TenancyContactAssignmentsBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactAssignmentsBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) WithData(data *models.WritableContactAssignment) *TenancyContactAssignmentsBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact assignments bulk partial update params +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) SetData(data *models.WritableContactAssignment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_responses.go new file mode 100644 index 000000000..c89ada5dd --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactAssignmentsBulkPartialUpdateReader is a Reader for the TenancyContactAssignmentsBulkPartialUpdate structure. +type TenancyContactAssignmentsBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactAssignmentsBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsBulkPartialUpdateOK creates a TenancyContactAssignmentsBulkPartialUpdateOK with default headers values +func NewTenancyContactAssignmentsBulkPartialUpdateOK() *TenancyContactAssignmentsBulkPartialUpdateOK { + return &TenancyContactAssignmentsBulkPartialUpdateOK{} +} + +/* TenancyContactAssignmentsBulkPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactAssignmentsBulkPartialUpdateOK tenancy contact assignments bulk partial update o k +*/ +type TenancyContactAssignmentsBulkPartialUpdateOK struct { + Payload *models.ContactAssignment +} + +func (o *TenancyContactAssignmentsBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contact-assignments/][%d] tenancyContactAssignmentsBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactAssignmentsBulkPartialUpdateOK) GetPayload() *models.ContactAssignment { + return o.Payload +} + +func (o *TenancyContactAssignmentsBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_parameters.go new file mode 100644 index 000000000..40d0cf890 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactAssignmentsBulkUpdateParams creates a new TenancyContactAssignmentsBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsBulkUpdateParams() *TenancyContactAssignmentsBulkUpdateParams { + return &TenancyContactAssignmentsBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsBulkUpdateParamsWithTimeout creates a new TenancyContactAssignmentsBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsBulkUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsBulkUpdateParams { + return &TenancyContactAssignmentsBulkUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsBulkUpdateParamsWithContext creates a new TenancyContactAssignmentsBulkUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsBulkUpdateParamsWithContext(ctx context.Context) *TenancyContactAssignmentsBulkUpdateParams { + return &TenancyContactAssignmentsBulkUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsBulkUpdateParamsWithHTTPClient creates a new TenancyContactAssignmentsBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsBulkUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsBulkUpdateParams { + return &TenancyContactAssignmentsBulkUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsBulkUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments bulk update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsBulkUpdateParams struct { + + // Data. + Data *models.WritableContactAssignment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsBulkUpdateParams) WithDefaults() *TenancyContactAssignmentsBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) WithContext(ctx context.Context) *TenancyContactAssignmentsBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) WithData(data *models.WritableContactAssignment) *TenancyContactAssignmentsBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact assignments bulk update params +func (o *TenancyContactAssignmentsBulkUpdateParams) SetData(data *models.WritableContactAssignment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_responses.go new file mode 100644 index 000000000..b68e11daa --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactAssignmentsBulkUpdateReader is a Reader for the TenancyContactAssignmentsBulkUpdate structure. +type TenancyContactAssignmentsBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactAssignmentsBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsBulkUpdateOK creates a TenancyContactAssignmentsBulkUpdateOK with default headers values +func NewTenancyContactAssignmentsBulkUpdateOK() *TenancyContactAssignmentsBulkUpdateOK { + return &TenancyContactAssignmentsBulkUpdateOK{} +} + +/* TenancyContactAssignmentsBulkUpdateOK describes a response with status code 200, with default header values. + +TenancyContactAssignmentsBulkUpdateOK tenancy contact assignments bulk update o k +*/ +type TenancyContactAssignmentsBulkUpdateOK struct { + Payload *models.ContactAssignment +} + +func (o *TenancyContactAssignmentsBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contact-assignments/][%d] tenancyContactAssignmentsBulkUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactAssignmentsBulkUpdateOK) GetPayload() *models.ContactAssignment { + return o.Payload +} + +func (o *TenancyContactAssignmentsBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_parameters.go new file mode 100644 index 000000000..b9bab7970 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactAssignmentsCreateParams creates a new TenancyContactAssignmentsCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsCreateParams() *TenancyContactAssignmentsCreateParams { + return &TenancyContactAssignmentsCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsCreateParamsWithTimeout creates a new TenancyContactAssignmentsCreateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsCreateParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsCreateParams { + return &TenancyContactAssignmentsCreateParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsCreateParamsWithContext creates a new TenancyContactAssignmentsCreateParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsCreateParamsWithContext(ctx context.Context) *TenancyContactAssignmentsCreateParams { + return &TenancyContactAssignmentsCreateParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsCreateParamsWithHTTPClient creates a new TenancyContactAssignmentsCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsCreateParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsCreateParams { + return &TenancyContactAssignmentsCreateParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsCreateParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments create operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsCreateParams struct { + + // Data. + Data *models.WritableContactAssignment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsCreateParams) WithDefaults() *TenancyContactAssignmentsCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) WithContext(ctx context.Context) *TenancyContactAssignmentsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) WithData(data *models.WritableContactAssignment) *TenancyContactAssignmentsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact assignments create params +func (o *TenancyContactAssignmentsCreateParams) SetData(data *models.WritableContactAssignment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_responses.go new file mode 100644 index 000000000..0e12c1af4 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactAssignmentsCreateReader is a Reader for the TenancyContactAssignmentsCreate structure. +type TenancyContactAssignmentsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewTenancyContactAssignmentsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsCreateCreated creates a TenancyContactAssignmentsCreateCreated with default headers values +func NewTenancyContactAssignmentsCreateCreated() *TenancyContactAssignmentsCreateCreated { + return &TenancyContactAssignmentsCreateCreated{} +} + +/* TenancyContactAssignmentsCreateCreated describes a response with status code 201, with default header values. + +TenancyContactAssignmentsCreateCreated tenancy contact assignments create created +*/ +type TenancyContactAssignmentsCreateCreated struct { + Payload *models.ContactAssignment +} + +func (o *TenancyContactAssignmentsCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/contact-assignments/][%d] tenancyContactAssignmentsCreateCreated %+v", 201, o.Payload) +} +func (o *TenancyContactAssignmentsCreateCreated) GetPayload() *models.ContactAssignment { + return o.Payload +} + +func (o *TenancyContactAssignmentsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_parameters.go new file mode 100644 index 000000000..628b092cf --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactAssignmentsDeleteParams creates a new TenancyContactAssignmentsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsDeleteParams() *TenancyContactAssignmentsDeleteParams { + return &TenancyContactAssignmentsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsDeleteParamsWithTimeout creates a new TenancyContactAssignmentsDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsDeleteParams { + return &TenancyContactAssignmentsDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsDeleteParamsWithContext creates a new TenancyContactAssignmentsDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsDeleteParamsWithContext(ctx context.Context) *TenancyContactAssignmentsDeleteParams { + return &TenancyContactAssignmentsDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsDeleteParamsWithHTTPClient creates a new TenancyContactAssignmentsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsDeleteParams { + return &TenancyContactAssignmentsDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsDeleteParams struct { + + /* ID. + + A unique integer value identifying this contact assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsDeleteParams) WithDefaults() *TenancyContactAssignmentsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) WithContext(ctx context.Context) *TenancyContactAssignmentsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) WithID(id int64) *TenancyContactAssignmentsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact assignments delete params +func (o *TenancyContactAssignmentsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_responses.go new file mode 100644 index 000000000..dd3dc7d49 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactAssignmentsDeleteReader is a Reader for the TenancyContactAssignmentsDelete structure. +type TenancyContactAssignmentsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactAssignmentsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsDeleteNoContent creates a TenancyContactAssignmentsDeleteNoContent with default headers values +func NewTenancyContactAssignmentsDeleteNoContent() *TenancyContactAssignmentsDeleteNoContent { + return &TenancyContactAssignmentsDeleteNoContent{} +} + +/* TenancyContactAssignmentsDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactAssignmentsDeleteNoContent tenancy contact assignments delete no content +*/ +type TenancyContactAssignmentsDeleteNoContent struct { +} + +func (o *TenancyContactAssignmentsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contact-assignments/{id}/][%d] tenancyContactAssignmentsDeleteNoContent ", 204) +} + +func (o *TenancyContactAssignmentsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_parameters.go new file mode 100644 index 000000000..56204582e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_parameters.go @@ -0,0 +1,1141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactAssignmentsListParams creates a new TenancyContactAssignmentsListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsListParams() *TenancyContactAssignmentsListParams { + return &TenancyContactAssignmentsListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsListParamsWithTimeout creates a new TenancyContactAssignmentsListParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsListParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsListParams { + return &TenancyContactAssignmentsListParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsListParamsWithContext creates a new TenancyContactAssignmentsListParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsListParamsWithContext(ctx context.Context) *TenancyContactAssignmentsListParams { + return &TenancyContactAssignmentsListParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsListParamsWithHTTPClient creates a new TenancyContactAssignmentsListParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsListParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsListParams { + return &TenancyContactAssignmentsListParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsListParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments list operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsListParams struct { + + // ContactID. + ContactID *string + + // ContactIDn. + ContactIDn *string + + // ContentType. + ContentType *string + + // ContentTypen. + ContentTypen *string + + // ContentTypeID. + ContentTypeID *string + + // ContentTypeIDn. + ContentTypeIDn *string + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + // ObjectID. + ObjectID *string + + // ObjectIDGt. + ObjectIDGt *string + + // ObjectIDGte. + ObjectIDGte *string + + // ObjectIDLt. + ObjectIDLt *string + + // ObjectIDLte. + ObjectIDLte *string + + // ObjectIDn. + ObjectIDn *string + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Priority. + Priority *string + + // Priorityn. + Priorityn *string + + // Role. + Role *string + + // Rolen. + Rolen *string + + // RoleID. + RoleID *string + + // RoleIDn. + RoleIDn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsListParams) WithDefaults() *TenancyContactAssignmentsListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithContext(ctx context.Context) *TenancyContactAssignmentsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContactID adds the contactID to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithContactID(contactID *string) *TenancyContactAssignmentsListParams { + o.SetContactID(contactID) + return o +} + +// SetContactID adds the contactId to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetContactID(contactID *string) { + o.ContactID = contactID +} + +// WithContactIDn adds the contactIDn to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithContactIDn(contactIDn *string) *TenancyContactAssignmentsListParams { + o.SetContactIDn(contactIDn) + return o +} + +// SetContactIDn adds the contactIdN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetContactIDn(contactIDn *string) { + o.ContactIDn = contactIDn +} + +// WithContentType adds the contentType to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithContentType(contentType *string) *TenancyContactAssignmentsListParams { + o.SetContentType(contentType) + return o +} + +// SetContentType adds the contentType to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetContentType(contentType *string) { + o.ContentType = contentType +} + +// WithContentTypen adds the contentTypen to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithContentTypen(contentTypen *string) *TenancyContactAssignmentsListParams { + o.SetContentTypen(contentTypen) + return o +} + +// SetContentTypen adds the contentTypeN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetContentTypen(contentTypen *string) { + o.ContentTypen = contentTypen +} + +// WithContentTypeID adds the contentTypeID to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithContentTypeID(contentTypeID *string) *TenancyContactAssignmentsListParams { + o.SetContentTypeID(contentTypeID) + return o +} + +// SetContentTypeID adds the contentTypeId to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetContentTypeID(contentTypeID *string) { + o.ContentTypeID = contentTypeID +} + +// WithContentTypeIDn adds the contentTypeIDn to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithContentTypeIDn(contentTypeIDn *string) *TenancyContactAssignmentsListParams { + o.SetContentTypeIDn(contentTypeIDn) + return o +} + +// SetContentTypeIDn adds the contentTypeIdN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetContentTypeIDn(contentTypeIDn *string) { + o.ContentTypeIDn = contentTypeIDn +} + +// WithCreated adds the created to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithCreated(created *string) *TenancyContactAssignmentsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithCreatedGte(createdGte *string) *TenancyContactAssignmentsListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithCreatedLte(createdLte *string) *TenancyContactAssignmentsListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithID adds the id to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithID(id *string) *TenancyContactAssignmentsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithIDGt(iDGt *string) *TenancyContactAssignmentsListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithIDGte(iDGte *string) *TenancyContactAssignmentsListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithIDLt(iDLt *string) *TenancyContactAssignmentsListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithIDLte(iDLte *string) *TenancyContactAssignmentsListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithIDn(iDn *string) *TenancyContactAssignmentsListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithLastUpdated(lastUpdated *string) *TenancyContactAssignmentsListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithLastUpdatedGte(lastUpdatedGte *string) *TenancyContactAssignmentsListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithLastUpdatedLte(lastUpdatedLte *string) *TenancyContactAssignmentsListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithLimit(limit *int64) *TenancyContactAssignmentsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithObjectID adds the objectID to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithObjectID(objectID *string) *TenancyContactAssignmentsListParams { + o.SetObjectID(objectID) + return o +} + +// SetObjectID adds the objectId to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetObjectID(objectID *string) { + o.ObjectID = objectID +} + +// WithObjectIDGt adds the objectIDGt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithObjectIDGt(objectIDGt *string) *TenancyContactAssignmentsListParams { + o.SetObjectIDGt(objectIDGt) + return o +} + +// SetObjectIDGt adds the objectIdGt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetObjectIDGt(objectIDGt *string) { + o.ObjectIDGt = objectIDGt +} + +// WithObjectIDGte adds the objectIDGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithObjectIDGte(objectIDGte *string) *TenancyContactAssignmentsListParams { + o.SetObjectIDGte(objectIDGte) + return o +} + +// SetObjectIDGte adds the objectIdGte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetObjectIDGte(objectIDGte *string) { + o.ObjectIDGte = objectIDGte +} + +// WithObjectIDLt adds the objectIDLt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithObjectIDLt(objectIDLt *string) *TenancyContactAssignmentsListParams { + o.SetObjectIDLt(objectIDLt) + return o +} + +// SetObjectIDLt adds the objectIdLt to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetObjectIDLt(objectIDLt *string) { + o.ObjectIDLt = objectIDLt +} + +// WithObjectIDLte adds the objectIDLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithObjectIDLte(objectIDLte *string) *TenancyContactAssignmentsListParams { + o.SetObjectIDLte(objectIDLte) + return o +} + +// SetObjectIDLte adds the objectIdLte to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetObjectIDLte(objectIDLte *string) { + o.ObjectIDLte = objectIDLte +} + +// WithObjectIDn adds the objectIDn to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithObjectIDn(objectIDn *string) *TenancyContactAssignmentsListParams { + o.SetObjectIDn(objectIDn) + return o +} + +// SetObjectIDn adds the objectIdN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetObjectIDn(objectIDn *string) { + o.ObjectIDn = objectIDn +} + +// WithOffset adds the offset to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithOffset(offset *int64) *TenancyContactAssignmentsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPriority adds the priority to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithPriority(priority *string) *TenancyContactAssignmentsListParams { + o.SetPriority(priority) + return o +} + +// SetPriority adds the priority to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetPriority(priority *string) { + o.Priority = priority +} + +// WithPriorityn adds the priorityn to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithPriorityn(priorityn *string) *TenancyContactAssignmentsListParams { + o.SetPriorityn(priorityn) + return o +} + +// SetPriorityn adds the priorityN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetPriorityn(priorityn *string) { + o.Priorityn = priorityn +} + +// WithRole adds the role to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithRole(role *string) *TenancyContactAssignmentsListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetRole(role *string) { + o.Role = role +} + +// WithRolen adds the rolen to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithRolen(rolen *string) *TenancyContactAssignmentsListParams { + o.SetRolen(rolen) + return o +} + +// SetRolen adds the roleN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetRolen(rolen *string) { + o.Rolen = rolen +} + +// WithRoleID adds the roleID to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithRoleID(roleID *string) *TenancyContactAssignmentsListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithRoleIDn adds the roleIDn to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) WithRoleIDn(roleIDn *string) *TenancyContactAssignmentsListParams { + o.SetRoleIDn(roleIDn) + return o +} + +// SetRoleIDn adds the roleIdN to the tenancy contact assignments list params +func (o *TenancyContactAssignmentsListParams) SetRoleIDn(roleIDn *string) { + o.RoleIDn = roleIDn +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ContactID != nil { + + // query param contact_id + var qrContactID string + + if o.ContactID != nil { + qrContactID = *o.ContactID + } + qContactID := qrContactID + if qContactID != "" { + + if err := r.SetQueryParam("contact_id", qContactID); err != nil { + return err + } + } + } + + if o.ContactIDn != nil { + + // query param contact_id__n + var qrContactIDn string + + if o.ContactIDn != nil { + qrContactIDn = *o.ContactIDn + } + qContactIDn := qrContactIDn + if qContactIDn != "" { + + if err := r.SetQueryParam("contact_id__n", qContactIDn); err != nil { + return err + } + } + } + + if o.ContentType != nil { + + // query param content_type + var qrContentType string + + if o.ContentType != nil { + qrContentType = *o.ContentType + } + qContentType := qrContentType + if qContentType != "" { + + if err := r.SetQueryParam("content_type", qContentType); err != nil { + return err + } + } + } + + if o.ContentTypen != nil { + + // query param content_type__n + var qrContentTypen string + + if o.ContentTypen != nil { + qrContentTypen = *o.ContentTypen + } + qContentTypen := qrContentTypen + if qContentTypen != "" { + + if err := r.SetQueryParam("content_type__n", qContentTypen); err != nil { + return err + } + } + } + + if o.ContentTypeID != nil { + + // query param content_type_id + var qrContentTypeID string + + if o.ContentTypeID != nil { + qrContentTypeID = *o.ContentTypeID + } + qContentTypeID := qrContentTypeID + if qContentTypeID != "" { + + if err := r.SetQueryParam("content_type_id", qContentTypeID); err != nil { + return err + } + } + } + + if o.ContentTypeIDn != nil { + + // query param content_type_id__n + var qrContentTypeIDn string + + if o.ContentTypeIDn != nil { + qrContentTypeIDn = *o.ContentTypeIDn + } + qContentTypeIDn := qrContentTypeIDn + if qContentTypeIDn != "" { + + if err := r.SetQueryParam("content_type_id__n", qContentTypeIDn); err != nil { + return err + } + } + } + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.ObjectID != nil { + + // query param object_id + var qrObjectID string + + if o.ObjectID != nil { + qrObjectID = *o.ObjectID + } + qObjectID := qrObjectID + if qObjectID != "" { + + if err := r.SetQueryParam("object_id", qObjectID); err != nil { + return err + } + } + } + + if o.ObjectIDGt != nil { + + // query param object_id__gt + var qrObjectIDGt string + + if o.ObjectIDGt != nil { + qrObjectIDGt = *o.ObjectIDGt + } + qObjectIDGt := qrObjectIDGt + if qObjectIDGt != "" { + + if err := r.SetQueryParam("object_id__gt", qObjectIDGt); err != nil { + return err + } + } + } + + if o.ObjectIDGte != nil { + + // query param object_id__gte + var qrObjectIDGte string + + if o.ObjectIDGte != nil { + qrObjectIDGte = *o.ObjectIDGte + } + qObjectIDGte := qrObjectIDGte + if qObjectIDGte != "" { + + if err := r.SetQueryParam("object_id__gte", qObjectIDGte); err != nil { + return err + } + } + } + + if o.ObjectIDLt != nil { + + // query param object_id__lt + var qrObjectIDLt string + + if o.ObjectIDLt != nil { + qrObjectIDLt = *o.ObjectIDLt + } + qObjectIDLt := qrObjectIDLt + if qObjectIDLt != "" { + + if err := r.SetQueryParam("object_id__lt", qObjectIDLt); err != nil { + return err + } + } + } + + if o.ObjectIDLte != nil { + + // query param object_id__lte + var qrObjectIDLte string + + if o.ObjectIDLte != nil { + qrObjectIDLte = *o.ObjectIDLte + } + qObjectIDLte := qrObjectIDLte + if qObjectIDLte != "" { + + if err := r.SetQueryParam("object_id__lte", qObjectIDLte); err != nil { + return err + } + } + } + + if o.ObjectIDn != nil { + + // query param object_id__n + var qrObjectIDn string + + if o.ObjectIDn != nil { + qrObjectIDn = *o.ObjectIDn + } + qObjectIDn := qrObjectIDn + if qObjectIDn != "" { + + if err := r.SetQueryParam("object_id__n", qObjectIDn); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Priority != nil { + + // query param priority + var qrPriority string + + if o.Priority != nil { + qrPriority = *o.Priority + } + qPriority := qrPriority + if qPriority != "" { + + if err := r.SetQueryParam("priority", qPriority); err != nil { + return err + } + } + } + + if o.Priorityn != nil { + + // query param priority__n + var qrPriorityn string + + if o.Priorityn != nil { + qrPriorityn = *o.Priorityn + } + qPriorityn := qrPriorityn + if qPriorityn != "" { + + if err := r.SetQueryParam("priority__n", qPriorityn); err != nil { + return err + } + } + } + + if o.Role != nil { + + // query param role + var qrRole string + + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + } + + if o.Rolen != nil { + + // query param role__n + var qrRolen string + + if o.Rolen != nil { + qrRolen = *o.Rolen + } + qRolen := qrRolen + if qRolen != "" { + + if err := r.SetQueryParam("role__n", qRolen); err != nil { + return err + } + } + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + } + + if o.RoleIDn != nil { + + // query param role_id__n + var qrRoleIDn string + + if o.RoleIDn != nil { + qrRoleIDn = *o.RoleIDn + } + qRoleIDn := qrRoleIDn + if qRoleIDn != "" { + + if err := r.SetQueryParam("role_id__n", qRoleIDn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_responses.go new file mode 100644 index 000000000..613257816 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactAssignmentsListReader is a Reader for the TenancyContactAssignmentsList structure. +type TenancyContactAssignmentsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactAssignmentsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsListOK creates a TenancyContactAssignmentsListOK with default headers values +func NewTenancyContactAssignmentsListOK() *TenancyContactAssignmentsListOK { + return &TenancyContactAssignmentsListOK{} +} + +/* TenancyContactAssignmentsListOK describes a response with status code 200, with default header values. + +TenancyContactAssignmentsListOK tenancy contact assignments list o k +*/ +type TenancyContactAssignmentsListOK struct { + Payload *TenancyContactAssignmentsListOKBody +} + +func (o *TenancyContactAssignmentsListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contact-assignments/][%d] tenancyContactAssignmentsListOK %+v", 200, o.Payload) +} +func (o *TenancyContactAssignmentsListOK) GetPayload() *TenancyContactAssignmentsListOKBody { + return o.Payload +} + +func (o *TenancyContactAssignmentsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(TenancyContactAssignmentsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*TenancyContactAssignmentsListOKBody tenancy contact assignments list o k body +swagger:model TenancyContactAssignmentsListOKBody +*/ +type TenancyContactAssignmentsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ContactAssignment `json:"results"` +} + +// Validate validates this tenancy contact assignments list o k body +func (o *TenancyContactAssignmentsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactAssignmentsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactAssignmentsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactAssignmentsListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactAssignmentsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactAssignmentsListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactAssignmentsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactAssignmentsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactAssignmentsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this tenancy contact assignments list o k body based on the context it is used +func (o *TenancyContactAssignmentsListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactAssignmentsListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactAssignmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *TenancyContactAssignmentsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *TenancyContactAssignmentsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyContactAssignmentsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_parameters.go new file mode 100644 index 000000000..8be80381d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactAssignmentsPartialUpdateParams creates a new TenancyContactAssignmentsPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsPartialUpdateParams() *TenancyContactAssignmentsPartialUpdateParams { + return &TenancyContactAssignmentsPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsPartialUpdateParamsWithTimeout creates a new TenancyContactAssignmentsPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsPartialUpdateParams { + return &TenancyContactAssignmentsPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsPartialUpdateParamsWithContext creates a new TenancyContactAssignmentsPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactAssignmentsPartialUpdateParams { + return &TenancyContactAssignmentsPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsPartialUpdateParamsWithHTTPClient creates a new TenancyContactAssignmentsPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsPartialUpdateParams { + return &TenancyContactAssignmentsPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsPartialUpdateParams struct { + + // Data. + Data *models.WritableContactAssignment + + /* ID. + + A unique integer value identifying this contact assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsPartialUpdateParams) WithDefaults() *TenancyContactAssignmentsPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactAssignmentsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) WithData(data *models.WritableContactAssignment) *TenancyContactAssignmentsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) SetData(data *models.WritableContactAssignment) { + o.Data = data +} + +// WithID adds the id to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) WithID(id int64) *TenancyContactAssignmentsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact assignments partial update params +func (o *TenancyContactAssignmentsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_responses.go new file mode 100644 index 000000000..7b5d38670 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactAssignmentsPartialUpdateReader is a Reader for the TenancyContactAssignmentsPartialUpdate structure. +type TenancyContactAssignmentsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactAssignmentsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsPartialUpdateOK creates a TenancyContactAssignmentsPartialUpdateOK with default headers values +func NewTenancyContactAssignmentsPartialUpdateOK() *TenancyContactAssignmentsPartialUpdateOK { + return &TenancyContactAssignmentsPartialUpdateOK{} +} + +/* TenancyContactAssignmentsPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactAssignmentsPartialUpdateOK tenancy contact assignments partial update o k +*/ +type TenancyContactAssignmentsPartialUpdateOK struct { + Payload *models.ContactAssignment +} + +func (o *TenancyContactAssignmentsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contact-assignments/{id}/][%d] tenancyContactAssignmentsPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactAssignmentsPartialUpdateOK) GetPayload() *models.ContactAssignment { + return o.Payload +} + +func (o *TenancyContactAssignmentsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_parameters.go new file mode 100644 index 000000000..7436ff844 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactAssignmentsReadParams creates a new TenancyContactAssignmentsReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsReadParams() *TenancyContactAssignmentsReadParams { + return &TenancyContactAssignmentsReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsReadParamsWithTimeout creates a new TenancyContactAssignmentsReadParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsReadParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsReadParams { + return &TenancyContactAssignmentsReadParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsReadParamsWithContext creates a new TenancyContactAssignmentsReadParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsReadParamsWithContext(ctx context.Context) *TenancyContactAssignmentsReadParams { + return &TenancyContactAssignmentsReadParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsReadParamsWithHTTPClient creates a new TenancyContactAssignmentsReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsReadParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsReadParams { + return &TenancyContactAssignmentsReadParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsReadParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments read operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsReadParams struct { + + /* ID. + + A unique integer value identifying this contact assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsReadParams) WithDefaults() *TenancyContactAssignmentsReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) WithContext(ctx context.Context) *TenancyContactAssignmentsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) WithID(id int64) *TenancyContactAssignmentsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact assignments read params +func (o *TenancyContactAssignmentsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_responses.go new file mode 100644 index 000000000..4b723f076 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactAssignmentsReadReader is a Reader for the TenancyContactAssignmentsRead structure. +type TenancyContactAssignmentsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactAssignmentsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsReadOK creates a TenancyContactAssignmentsReadOK with default headers values +func NewTenancyContactAssignmentsReadOK() *TenancyContactAssignmentsReadOK { + return &TenancyContactAssignmentsReadOK{} +} + +/* TenancyContactAssignmentsReadOK describes a response with status code 200, with default header values. + +TenancyContactAssignmentsReadOK tenancy contact assignments read o k +*/ +type TenancyContactAssignmentsReadOK struct { + Payload *models.ContactAssignment +} + +func (o *TenancyContactAssignmentsReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contact-assignments/{id}/][%d] tenancyContactAssignmentsReadOK %+v", 200, o.Payload) +} +func (o *TenancyContactAssignmentsReadOK) GetPayload() *models.ContactAssignment { + return o.Payload +} + +func (o *TenancyContactAssignmentsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_parameters.go new file mode 100644 index 000000000..0a5a76fc9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactAssignmentsUpdateParams creates a new TenancyContactAssignmentsUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactAssignmentsUpdateParams() *TenancyContactAssignmentsUpdateParams { + return &TenancyContactAssignmentsUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactAssignmentsUpdateParamsWithTimeout creates a new TenancyContactAssignmentsUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactAssignmentsUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactAssignmentsUpdateParams { + return &TenancyContactAssignmentsUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactAssignmentsUpdateParamsWithContext creates a new TenancyContactAssignmentsUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactAssignmentsUpdateParamsWithContext(ctx context.Context) *TenancyContactAssignmentsUpdateParams { + return &TenancyContactAssignmentsUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactAssignmentsUpdateParamsWithHTTPClient creates a new TenancyContactAssignmentsUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactAssignmentsUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactAssignmentsUpdateParams { + return &TenancyContactAssignmentsUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactAssignmentsUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact assignments update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactAssignmentsUpdateParams struct { + + // Data. + Data *models.WritableContactAssignment + + /* ID. + + A unique integer value identifying this contact assignment. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact assignments update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsUpdateParams) WithDefaults() *TenancyContactAssignmentsUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact assignments update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactAssignmentsUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactAssignmentsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) WithContext(ctx context.Context) *TenancyContactAssignmentsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactAssignmentsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) WithData(data *models.WritableContactAssignment) *TenancyContactAssignmentsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) SetData(data *models.WritableContactAssignment) { + o.Data = data +} + +// WithID adds the id to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) WithID(id int64) *TenancyContactAssignmentsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact assignments update params +func (o *TenancyContactAssignmentsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactAssignmentsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_responses.go new file mode 100644 index 000000000..44a457ce8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_assignments_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactAssignmentsUpdateReader is a Reader for the TenancyContactAssignmentsUpdate structure. +type TenancyContactAssignmentsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactAssignmentsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactAssignmentsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactAssignmentsUpdateOK creates a TenancyContactAssignmentsUpdateOK with default headers values +func NewTenancyContactAssignmentsUpdateOK() *TenancyContactAssignmentsUpdateOK { + return &TenancyContactAssignmentsUpdateOK{} +} + +/* TenancyContactAssignmentsUpdateOK describes a response with status code 200, with default header values. + +TenancyContactAssignmentsUpdateOK tenancy contact assignments update o k +*/ +type TenancyContactAssignmentsUpdateOK struct { + Payload *models.ContactAssignment +} + +func (o *TenancyContactAssignmentsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contact-assignments/{id}/][%d] tenancyContactAssignmentsUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactAssignmentsUpdateOK) GetPayload() *models.ContactAssignment { + return o.Payload +} + +func (o *TenancyContactAssignmentsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactAssignment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_parameters.go new file mode 100644 index 000000000..5afde20e7 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewTenancyContactGroupsBulkDeleteParams creates a new TenancyContactGroupsBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsBulkDeleteParams() *TenancyContactGroupsBulkDeleteParams { + return &TenancyContactGroupsBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsBulkDeleteParamsWithTimeout creates a new TenancyContactGroupsBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsBulkDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsBulkDeleteParams { + return &TenancyContactGroupsBulkDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsBulkDeleteParamsWithContext creates a new TenancyContactGroupsBulkDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsBulkDeleteParamsWithContext(ctx context.Context) *TenancyContactGroupsBulkDeleteParams { + return &TenancyContactGroupsBulkDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsBulkDeleteParamsWithHTTPClient creates a new TenancyContactGroupsBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsBulkDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsBulkDeleteParams { + return &TenancyContactGroupsBulkDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsBulkDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contact groups bulk delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsBulkDeleteParams) WithDefaults() *TenancyContactGroupsBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups bulk delete params +func (o *TenancyContactGroupsBulkDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups bulk delete params +func (o *TenancyContactGroupsBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups bulk delete params +func (o *TenancyContactGroupsBulkDeleteParams) WithContext(ctx context.Context) *TenancyContactGroupsBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups bulk delete params +func (o *TenancyContactGroupsBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups bulk delete params +func (o *TenancyContactGroupsBulkDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups bulk delete params +func (o *TenancyContactGroupsBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_responses.go new file mode 100644 index 000000000..0f7056fbd --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactGroupsBulkDeleteReader is a Reader for the TenancyContactGroupsBulkDelete structure. +type TenancyContactGroupsBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactGroupsBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsBulkDeleteNoContent creates a TenancyContactGroupsBulkDeleteNoContent with default headers values +func NewTenancyContactGroupsBulkDeleteNoContent() *TenancyContactGroupsBulkDeleteNoContent { + return &TenancyContactGroupsBulkDeleteNoContent{} +} + +/* TenancyContactGroupsBulkDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactGroupsBulkDeleteNoContent tenancy contact groups bulk delete no content +*/ +type TenancyContactGroupsBulkDeleteNoContent struct { +} + +func (o *TenancyContactGroupsBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contact-groups/][%d] tenancyContactGroupsBulkDeleteNoContent ", 204) +} + +func (o *TenancyContactGroupsBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_parameters.go new file mode 100644 index 000000000..6e3b4919e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactGroupsBulkPartialUpdateParams creates a new TenancyContactGroupsBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsBulkPartialUpdateParams() *TenancyContactGroupsBulkPartialUpdateParams { + return &TenancyContactGroupsBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsBulkPartialUpdateParamsWithTimeout creates a new TenancyContactGroupsBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsBulkPartialUpdateParams { + return &TenancyContactGroupsBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsBulkPartialUpdateParamsWithContext creates a new TenancyContactGroupsBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsBulkPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactGroupsBulkPartialUpdateParams { + return &TenancyContactGroupsBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsBulkPartialUpdateParamsWithHTTPClient creates a new TenancyContactGroupsBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsBulkPartialUpdateParams { + return &TenancyContactGroupsBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact groups bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableContactGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsBulkPartialUpdateParams) WithDefaults() *TenancyContactGroupsBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactGroupsBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) WithData(data *models.WritableContactGroup) *TenancyContactGroupsBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact groups bulk partial update params +func (o *TenancyContactGroupsBulkPartialUpdateParams) SetData(data *models.WritableContactGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_responses.go new file mode 100644 index 000000000..c3bbc42f8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactGroupsBulkPartialUpdateReader is a Reader for the TenancyContactGroupsBulkPartialUpdate structure. +type TenancyContactGroupsBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactGroupsBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsBulkPartialUpdateOK creates a TenancyContactGroupsBulkPartialUpdateOK with default headers values +func NewTenancyContactGroupsBulkPartialUpdateOK() *TenancyContactGroupsBulkPartialUpdateOK { + return &TenancyContactGroupsBulkPartialUpdateOK{} +} + +/* TenancyContactGroupsBulkPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactGroupsBulkPartialUpdateOK tenancy contact groups bulk partial update o k +*/ +type TenancyContactGroupsBulkPartialUpdateOK struct { + Payload *models.ContactGroup +} + +func (o *TenancyContactGroupsBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contact-groups/][%d] tenancyContactGroupsBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactGroupsBulkPartialUpdateOK) GetPayload() *models.ContactGroup { + return o.Payload +} + +func (o *TenancyContactGroupsBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_parameters.go new file mode 100644 index 000000000..d9fb943e4 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactGroupsBulkUpdateParams creates a new TenancyContactGroupsBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsBulkUpdateParams() *TenancyContactGroupsBulkUpdateParams { + return &TenancyContactGroupsBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsBulkUpdateParamsWithTimeout creates a new TenancyContactGroupsBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsBulkUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsBulkUpdateParams { + return &TenancyContactGroupsBulkUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsBulkUpdateParamsWithContext creates a new TenancyContactGroupsBulkUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsBulkUpdateParamsWithContext(ctx context.Context) *TenancyContactGroupsBulkUpdateParams { + return &TenancyContactGroupsBulkUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsBulkUpdateParamsWithHTTPClient creates a new TenancyContactGroupsBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsBulkUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsBulkUpdateParams { + return &TenancyContactGroupsBulkUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsBulkUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact groups bulk update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsBulkUpdateParams struct { + + // Data. + Data *models.WritableContactGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsBulkUpdateParams) WithDefaults() *TenancyContactGroupsBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) WithContext(ctx context.Context) *TenancyContactGroupsBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) WithData(data *models.WritableContactGroup) *TenancyContactGroupsBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact groups bulk update params +func (o *TenancyContactGroupsBulkUpdateParams) SetData(data *models.WritableContactGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_responses.go new file mode 100644 index 000000000..314157bbf --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactGroupsBulkUpdateReader is a Reader for the TenancyContactGroupsBulkUpdate structure. +type TenancyContactGroupsBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactGroupsBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsBulkUpdateOK creates a TenancyContactGroupsBulkUpdateOK with default headers values +func NewTenancyContactGroupsBulkUpdateOK() *TenancyContactGroupsBulkUpdateOK { + return &TenancyContactGroupsBulkUpdateOK{} +} + +/* TenancyContactGroupsBulkUpdateOK describes a response with status code 200, with default header values. + +TenancyContactGroupsBulkUpdateOK tenancy contact groups bulk update o k +*/ +type TenancyContactGroupsBulkUpdateOK struct { + Payload *models.ContactGroup +} + +func (o *TenancyContactGroupsBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contact-groups/][%d] tenancyContactGroupsBulkUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactGroupsBulkUpdateOK) GetPayload() *models.ContactGroup { + return o.Payload +} + +func (o *TenancyContactGroupsBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_parameters.go new file mode 100644 index 000000000..0f3fc3331 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactGroupsCreateParams creates a new TenancyContactGroupsCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsCreateParams() *TenancyContactGroupsCreateParams { + return &TenancyContactGroupsCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsCreateParamsWithTimeout creates a new TenancyContactGroupsCreateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsCreateParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsCreateParams { + return &TenancyContactGroupsCreateParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsCreateParamsWithContext creates a new TenancyContactGroupsCreateParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsCreateParamsWithContext(ctx context.Context) *TenancyContactGroupsCreateParams { + return &TenancyContactGroupsCreateParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsCreateParamsWithHTTPClient creates a new TenancyContactGroupsCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsCreateParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsCreateParams { + return &TenancyContactGroupsCreateParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsCreateParams contains all the parameters to send to the API endpoint + for the tenancy contact groups create operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsCreateParams struct { + + // Data. + Data *models.WritableContactGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsCreateParams) WithDefaults() *TenancyContactGroupsCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) WithContext(ctx context.Context) *TenancyContactGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) WithData(data *models.WritableContactGroup) *TenancyContactGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact groups create params +func (o *TenancyContactGroupsCreateParams) SetData(data *models.WritableContactGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_responses.go new file mode 100644 index 000000000..5a09ae212 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactGroupsCreateReader is a Reader for the TenancyContactGroupsCreate structure. +type TenancyContactGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewTenancyContactGroupsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsCreateCreated creates a TenancyContactGroupsCreateCreated with default headers values +func NewTenancyContactGroupsCreateCreated() *TenancyContactGroupsCreateCreated { + return &TenancyContactGroupsCreateCreated{} +} + +/* TenancyContactGroupsCreateCreated describes a response with status code 201, with default header values. + +TenancyContactGroupsCreateCreated tenancy contact groups create created +*/ +type TenancyContactGroupsCreateCreated struct { + Payload *models.ContactGroup +} + +func (o *TenancyContactGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/contact-groups/][%d] tenancyContactGroupsCreateCreated %+v", 201, o.Payload) +} +func (o *TenancyContactGroupsCreateCreated) GetPayload() *models.ContactGroup { + return o.Payload +} + +func (o *TenancyContactGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_parameters.go new file mode 100644 index 000000000..7dd4ba692 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactGroupsDeleteParams creates a new TenancyContactGroupsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsDeleteParams() *TenancyContactGroupsDeleteParams { + return &TenancyContactGroupsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsDeleteParamsWithTimeout creates a new TenancyContactGroupsDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsDeleteParams { + return &TenancyContactGroupsDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsDeleteParamsWithContext creates a new TenancyContactGroupsDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsDeleteParamsWithContext(ctx context.Context) *TenancyContactGroupsDeleteParams { + return &TenancyContactGroupsDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsDeleteParamsWithHTTPClient creates a new TenancyContactGroupsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsDeleteParams { + return &TenancyContactGroupsDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contact groups delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsDeleteParams struct { + + /* ID. + + A unique integer value identifying this contact group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsDeleteParams) WithDefaults() *TenancyContactGroupsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) WithContext(ctx context.Context) *TenancyContactGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) WithID(id int64) *TenancyContactGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact groups delete params +func (o *TenancyContactGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_responses.go new file mode 100644 index 000000000..7fce0cb14 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactGroupsDeleteReader is a Reader for the TenancyContactGroupsDelete structure. +type TenancyContactGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactGroupsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsDeleteNoContent creates a TenancyContactGroupsDeleteNoContent with default headers values +func NewTenancyContactGroupsDeleteNoContent() *TenancyContactGroupsDeleteNoContent { + return &TenancyContactGroupsDeleteNoContent{} +} + +/* TenancyContactGroupsDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactGroupsDeleteNoContent tenancy contact groups delete no content +*/ +type TenancyContactGroupsDeleteNoContent struct { +} + +func (o *TenancyContactGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contact-groups/{id}/][%d] tenancyContactGroupsDeleteNoContent ", 204) +} + +func (o *TenancyContactGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_parameters.go new file mode 100644 index 000000000..4c4bb945e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_parameters.go @@ -0,0 +1,1823 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactGroupsListParams creates a new TenancyContactGroupsListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsListParams() *TenancyContactGroupsListParams { + return &TenancyContactGroupsListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsListParamsWithTimeout creates a new TenancyContactGroupsListParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsListParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsListParams { + return &TenancyContactGroupsListParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsListParamsWithContext creates a new TenancyContactGroupsListParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsListParamsWithContext(ctx context.Context) *TenancyContactGroupsListParams { + return &TenancyContactGroupsListParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsListParamsWithHTTPClient creates a new TenancyContactGroupsListParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsListParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsListParams { + return &TenancyContactGroupsListParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsListParams contains all the parameters to send to the API endpoint + for the tenancy contact groups list operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsListParams struct { + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + // Name. + Name *string + + // NameEmpty. + NameEmpty *string + + // NameIc. + NameIc *string + + // NameIe. + NameIe *string + + // NameIew. + NameIew *string + + // NameIsw. + NameIsw *string + + // Namen. + Namen *string + + // NameNic. + NameNic *string + + // NameNie. + NameNie *string + + // NameNiew. + NameNiew *string + + // NameNisw. + NameNisw *string + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Parent. + Parent *string + + // Parentn. + Parentn *string + + // ParentID. + ParentID *string + + // ParentIDn. + ParentIDn *string + + // Q. + Q *string + + // Slug. + Slug *string + + // SlugEmpty. + SlugEmpty *string + + // SlugIc. + SlugIc *string + + // SlugIe. + SlugIe *string + + // SlugIew. + SlugIew *string + + // SlugIsw. + SlugIsw *string + + // Slugn. + Slugn *string + + // SlugNic. + SlugNic *string + + // SlugNie. + SlugNie *string + + // SlugNiew. + SlugNiew *string + + // SlugNisw. + SlugNisw *string + + // Tag. + Tag *string + + // Tagn. + Tagn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsListParams) WithDefaults() *TenancyContactGroupsListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithContext(ctx context.Context) *TenancyContactGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreated adds the created to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithCreated(created *string) *TenancyContactGroupsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithCreatedGte(createdGte *string) *TenancyContactGroupsListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithCreatedLte(createdLte *string) *TenancyContactGroupsListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithDescription adds the description to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescription(description *string) *TenancyContactGroupsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionEmpty(descriptionEmpty *string) *TenancyContactGroupsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionIc(descriptionIc *string) *TenancyContactGroupsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionIe(descriptionIe *string) *TenancyContactGroupsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionIew(descriptionIew *string) *TenancyContactGroupsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionIsw(descriptionIsw *string) *TenancyContactGroupsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionn(descriptionn *string) *TenancyContactGroupsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionNic(descriptionNic *string) *TenancyContactGroupsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionNie(descriptionNie *string) *TenancyContactGroupsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionNiew(descriptionNiew *string) *TenancyContactGroupsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithDescriptionNisw(descriptionNisw *string) *TenancyContactGroupsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + +// WithID adds the id to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithID(id *string) *TenancyContactGroupsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithIDGt(iDGt *string) *TenancyContactGroupsListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithIDGte(iDGte *string) *TenancyContactGroupsListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithIDLt(iDLt *string) *TenancyContactGroupsListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithIDLte(iDLte *string) *TenancyContactGroupsListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithIDn(iDn *string) *TenancyContactGroupsListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithLastUpdated(lastUpdated *string) *TenancyContactGroupsListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithLastUpdatedGte(lastUpdatedGte *string) *TenancyContactGroupsListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithLastUpdatedLte(lastUpdatedLte *string) *TenancyContactGroupsListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithLimit(limit *int64) *TenancyContactGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithName(name *string) *TenancyContactGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithNameEmpty adds the nameEmpty to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameEmpty(nameEmpty *string) *TenancyContactGroupsListParams { + o.SetNameEmpty(nameEmpty) + return o +} + +// SetNameEmpty adds the nameEmpty to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameEmpty(nameEmpty *string) { + o.NameEmpty = nameEmpty +} + +// WithNameIc adds the nameIc to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameIc(nameIc *string) *TenancyContactGroupsListParams { + o.SetNameIc(nameIc) + return o +} + +// SetNameIc adds the nameIc to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameIc(nameIc *string) { + o.NameIc = nameIc +} + +// WithNameIe adds the nameIe to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameIe(nameIe *string) *TenancyContactGroupsListParams { + o.SetNameIe(nameIe) + return o +} + +// SetNameIe adds the nameIe to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameIe(nameIe *string) { + o.NameIe = nameIe +} + +// WithNameIew adds the nameIew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameIew(nameIew *string) *TenancyContactGroupsListParams { + o.SetNameIew(nameIew) + return o +} + +// SetNameIew adds the nameIew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameIew(nameIew *string) { + o.NameIew = nameIew +} + +// WithNameIsw adds the nameIsw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameIsw(nameIsw *string) *TenancyContactGroupsListParams { + o.SetNameIsw(nameIsw) + return o +} + +// SetNameIsw adds the nameIsw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameIsw(nameIsw *string) { + o.NameIsw = nameIsw +} + +// WithNamen adds the namen to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNamen(namen *string) *TenancyContactGroupsListParams { + o.SetNamen(namen) + return o +} + +// SetNamen adds the nameN to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNamen(namen *string) { + o.Namen = namen +} + +// WithNameNic adds the nameNic to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameNic(nameNic *string) *TenancyContactGroupsListParams { + o.SetNameNic(nameNic) + return o +} + +// SetNameNic adds the nameNic to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameNic(nameNic *string) { + o.NameNic = nameNic +} + +// WithNameNie adds the nameNie to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameNie(nameNie *string) *TenancyContactGroupsListParams { + o.SetNameNie(nameNie) + return o +} + +// SetNameNie adds the nameNie to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameNie(nameNie *string) { + o.NameNie = nameNie +} + +// WithNameNiew adds the nameNiew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameNiew(nameNiew *string) *TenancyContactGroupsListParams { + o.SetNameNiew(nameNiew) + return o +} + +// SetNameNiew adds the nameNiew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameNiew(nameNiew *string) { + o.NameNiew = nameNiew +} + +// WithNameNisw adds the nameNisw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithNameNisw(nameNisw *string) *TenancyContactGroupsListParams { + o.SetNameNisw(nameNisw) + return o +} + +// SetNameNisw adds the nameNisw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetNameNisw(nameNisw *string) { + o.NameNisw = nameNisw +} + +// WithOffset adds the offset to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithOffset(offset *int64) *TenancyContactGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParent adds the parent to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithParent(parent *string) *TenancyContactGroupsListParams { + o.SetParent(parent) + return o +} + +// SetParent adds the parent to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetParent(parent *string) { + o.Parent = parent +} + +// WithParentn adds the parentn to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithParentn(parentn *string) *TenancyContactGroupsListParams { + o.SetParentn(parentn) + return o +} + +// SetParentn adds the parentN to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetParentn(parentn *string) { + o.Parentn = parentn +} + +// WithParentID adds the parentID to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithParentID(parentID *string) *TenancyContactGroupsListParams { + o.SetParentID(parentID) + return o +} + +// SetParentID adds the parentId to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetParentID(parentID *string) { + o.ParentID = parentID +} + +// WithParentIDn adds the parentIDn to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithParentIDn(parentIDn *string) *TenancyContactGroupsListParams { + o.SetParentIDn(parentIDn) + return o +} + +// SetParentIDn adds the parentIdN to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetParentIDn(parentIDn *string) { + o.ParentIDn = parentIDn +} + +// WithQ adds the q to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithQ(q *string) *TenancyContactGroupsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlug(slug *string) *TenancyContactGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithSlugEmpty adds the slugEmpty to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugEmpty(slugEmpty *string) *TenancyContactGroupsListParams { + o.SetSlugEmpty(slugEmpty) + return o +} + +// SetSlugEmpty adds the slugEmpty to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugEmpty(slugEmpty *string) { + o.SlugEmpty = slugEmpty +} + +// WithSlugIc adds the slugIc to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugIc(slugIc *string) *TenancyContactGroupsListParams { + o.SetSlugIc(slugIc) + return o +} + +// SetSlugIc adds the slugIc to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugIc(slugIc *string) { + o.SlugIc = slugIc +} + +// WithSlugIe adds the slugIe to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugIe(slugIe *string) *TenancyContactGroupsListParams { + o.SetSlugIe(slugIe) + return o +} + +// SetSlugIe adds the slugIe to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugIe(slugIe *string) { + o.SlugIe = slugIe +} + +// WithSlugIew adds the slugIew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugIew(slugIew *string) *TenancyContactGroupsListParams { + o.SetSlugIew(slugIew) + return o +} + +// SetSlugIew adds the slugIew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugIew(slugIew *string) { + o.SlugIew = slugIew +} + +// WithSlugIsw adds the slugIsw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugIsw(slugIsw *string) *TenancyContactGroupsListParams { + o.SetSlugIsw(slugIsw) + return o +} + +// SetSlugIsw adds the slugIsw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugIsw(slugIsw *string) { + o.SlugIsw = slugIsw +} + +// WithSlugn adds the slugn to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugn(slugn *string) *TenancyContactGroupsListParams { + o.SetSlugn(slugn) + return o +} + +// SetSlugn adds the slugN to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugn(slugn *string) { + o.Slugn = slugn +} + +// WithSlugNic adds the slugNic to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugNic(slugNic *string) *TenancyContactGroupsListParams { + o.SetSlugNic(slugNic) + return o +} + +// SetSlugNic adds the slugNic to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugNic(slugNic *string) { + o.SlugNic = slugNic +} + +// WithSlugNie adds the slugNie to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugNie(slugNie *string) *TenancyContactGroupsListParams { + o.SetSlugNie(slugNie) + return o +} + +// SetSlugNie adds the slugNie to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugNie(slugNie *string) { + o.SlugNie = slugNie +} + +// WithSlugNiew adds the slugNiew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugNiew(slugNiew *string) *TenancyContactGroupsListParams { + o.SetSlugNiew(slugNiew) + return o +} + +// SetSlugNiew adds the slugNiew to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugNiew(slugNiew *string) { + o.SlugNiew = slugNiew +} + +// WithSlugNisw adds the slugNisw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithSlugNisw(slugNisw *string) *TenancyContactGroupsListParams { + o.SetSlugNisw(slugNisw) + return o +} + +// SetSlugNisw adds the slugNisw to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetSlugNisw(slugNisw *string) { + o.SlugNisw = slugNisw +} + +// WithTag adds the tag to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithTag(tag *string) *TenancyContactGroupsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) WithTagn(tagn *string) *TenancyContactGroupsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the tenancy contact groups list params +func (o *TenancyContactGroupsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.NameEmpty != nil { + + // query param name__empty + var qrNameEmpty string + + if o.NameEmpty != nil { + qrNameEmpty = *o.NameEmpty + } + qNameEmpty := qrNameEmpty + if qNameEmpty != "" { + + if err := r.SetQueryParam("name__empty", qNameEmpty); err != nil { + return err + } + } + } + + if o.NameIc != nil { + + // query param name__ic + var qrNameIc string + + if o.NameIc != nil { + qrNameIc = *o.NameIc + } + qNameIc := qrNameIc + if qNameIc != "" { + + if err := r.SetQueryParam("name__ic", qNameIc); err != nil { + return err + } + } + } + + if o.NameIe != nil { + + // query param name__ie + var qrNameIe string + + if o.NameIe != nil { + qrNameIe = *o.NameIe + } + qNameIe := qrNameIe + if qNameIe != "" { + + if err := r.SetQueryParam("name__ie", qNameIe); err != nil { + return err + } + } + } + + if o.NameIew != nil { + + // query param name__iew + var qrNameIew string + + if o.NameIew != nil { + qrNameIew = *o.NameIew + } + qNameIew := qrNameIew + if qNameIew != "" { + + if err := r.SetQueryParam("name__iew", qNameIew); err != nil { + return err + } + } + } + + if o.NameIsw != nil { + + // query param name__isw + var qrNameIsw string + + if o.NameIsw != nil { + qrNameIsw = *o.NameIsw + } + qNameIsw := qrNameIsw + if qNameIsw != "" { + + if err := r.SetQueryParam("name__isw", qNameIsw); err != nil { + return err + } + } + } + + if o.Namen != nil { + + // query param name__n + var qrNamen string + + if o.Namen != nil { + qrNamen = *o.Namen + } + qNamen := qrNamen + if qNamen != "" { + + if err := r.SetQueryParam("name__n", qNamen); err != nil { + return err + } + } + } + + if o.NameNic != nil { + + // query param name__nic + var qrNameNic string + + if o.NameNic != nil { + qrNameNic = *o.NameNic + } + qNameNic := qrNameNic + if qNameNic != "" { + + if err := r.SetQueryParam("name__nic", qNameNic); err != nil { + return err + } + } + } + + if o.NameNie != nil { + + // query param name__nie + var qrNameNie string + + if o.NameNie != nil { + qrNameNie = *o.NameNie + } + qNameNie := qrNameNie + if qNameNie != "" { + + if err := r.SetQueryParam("name__nie", qNameNie); err != nil { + return err + } + } + } + + if o.NameNiew != nil { + + // query param name__niew + var qrNameNiew string + + if o.NameNiew != nil { + qrNameNiew = *o.NameNiew + } + qNameNiew := qrNameNiew + if qNameNiew != "" { + + if err := r.SetQueryParam("name__niew", qNameNiew); err != nil { + return err + } + } + } + + if o.NameNisw != nil { + + // query param name__nisw + var qrNameNisw string + + if o.NameNisw != nil { + qrNameNisw = *o.NameNisw + } + qNameNisw := qrNameNisw + if qNameNisw != "" { + + if err := r.SetQueryParam("name__nisw", qNameNisw); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Parent != nil { + + // query param parent + var qrParent string + + if o.Parent != nil { + qrParent = *o.Parent + } + qParent := qrParent + if qParent != "" { + + if err := r.SetQueryParam("parent", qParent); err != nil { + return err + } + } + } + + if o.Parentn != nil { + + // query param parent__n + var qrParentn string + + if o.Parentn != nil { + qrParentn = *o.Parentn + } + qParentn := qrParentn + if qParentn != "" { + + if err := r.SetQueryParam("parent__n", qParentn); err != nil { + return err + } + } + } + + if o.ParentID != nil { + + // query param parent_id + var qrParentID string + + if o.ParentID != nil { + qrParentID = *o.ParentID + } + qParentID := qrParentID + if qParentID != "" { + + if err := r.SetQueryParam("parent_id", qParentID); err != nil { + return err + } + } + } + + if o.ParentIDn != nil { + + // query param parent_id__n + var qrParentIDn string + + if o.ParentIDn != nil { + qrParentIDn = *o.ParentIDn + } + qParentIDn := qrParentIDn + if qParentIDn != "" { + + if err := r.SetQueryParam("parent_id__n", qParentIDn); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + } + + if o.SlugEmpty != nil { + + // query param slug__empty + var qrSlugEmpty string + + if o.SlugEmpty != nil { + qrSlugEmpty = *o.SlugEmpty + } + qSlugEmpty := qrSlugEmpty + if qSlugEmpty != "" { + + if err := r.SetQueryParam("slug__empty", qSlugEmpty); err != nil { + return err + } + } + } + + if o.SlugIc != nil { + + // query param slug__ic + var qrSlugIc string + + if o.SlugIc != nil { + qrSlugIc = *o.SlugIc + } + qSlugIc := qrSlugIc + if qSlugIc != "" { + + if err := r.SetQueryParam("slug__ic", qSlugIc); err != nil { + return err + } + } + } + + if o.SlugIe != nil { + + // query param slug__ie + var qrSlugIe string + + if o.SlugIe != nil { + qrSlugIe = *o.SlugIe + } + qSlugIe := qrSlugIe + if qSlugIe != "" { + + if err := r.SetQueryParam("slug__ie", qSlugIe); err != nil { + return err + } + } + } + + if o.SlugIew != nil { + + // query param slug__iew + var qrSlugIew string + + if o.SlugIew != nil { + qrSlugIew = *o.SlugIew + } + qSlugIew := qrSlugIew + if qSlugIew != "" { + + if err := r.SetQueryParam("slug__iew", qSlugIew); err != nil { + return err + } + } + } + + if o.SlugIsw != nil { + + // query param slug__isw + var qrSlugIsw string + + if o.SlugIsw != nil { + qrSlugIsw = *o.SlugIsw + } + qSlugIsw := qrSlugIsw + if qSlugIsw != "" { + + if err := r.SetQueryParam("slug__isw", qSlugIsw); err != nil { + return err + } + } + } + + if o.Slugn != nil { + + // query param slug__n + var qrSlugn string + + if o.Slugn != nil { + qrSlugn = *o.Slugn + } + qSlugn := qrSlugn + if qSlugn != "" { + + if err := r.SetQueryParam("slug__n", qSlugn); err != nil { + return err + } + } + } + + if o.SlugNic != nil { + + // query param slug__nic + var qrSlugNic string + + if o.SlugNic != nil { + qrSlugNic = *o.SlugNic + } + qSlugNic := qrSlugNic + if qSlugNic != "" { + + if err := r.SetQueryParam("slug__nic", qSlugNic); err != nil { + return err + } + } + } + + if o.SlugNie != nil { + + // query param slug__nie + var qrSlugNie string + + if o.SlugNie != nil { + qrSlugNie = *o.SlugNie + } + qSlugNie := qrSlugNie + if qSlugNie != "" { + + if err := r.SetQueryParam("slug__nie", qSlugNie); err != nil { + return err + } + } + } + + if o.SlugNiew != nil { + + // query param slug__niew + var qrSlugNiew string + + if o.SlugNiew != nil { + qrSlugNiew = *o.SlugNiew + } + qSlugNiew := qrSlugNiew + if qSlugNiew != "" { + + if err := r.SetQueryParam("slug__niew", qSlugNiew); err != nil { + return err + } + } + } + + if o.SlugNisw != nil { + + // query param slug__nisw + var qrSlugNisw string + + if o.SlugNisw != nil { + qrSlugNisw = *o.SlugNisw + } + qSlugNisw := qrSlugNisw + if qSlugNisw != "" { + + if err := r.SetQueryParam("slug__nisw", qSlugNisw); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_responses.go new file mode 100644 index 000000000..7169c60a6 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactGroupsListReader is a Reader for the TenancyContactGroupsList structure. +type TenancyContactGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsListOK creates a TenancyContactGroupsListOK with default headers values +func NewTenancyContactGroupsListOK() *TenancyContactGroupsListOK { + return &TenancyContactGroupsListOK{} +} + +/* TenancyContactGroupsListOK describes a response with status code 200, with default header values. + +TenancyContactGroupsListOK tenancy contact groups list o k +*/ +type TenancyContactGroupsListOK struct { + Payload *TenancyContactGroupsListOKBody +} + +func (o *TenancyContactGroupsListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contact-groups/][%d] tenancyContactGroupsListOK %+v", 200, o.Payload) +} +func (o *TenancyContactGroupsListOK) GetPayload() *TenancyContactGroupsListOKBody { + return o.Payload +} + +func (o *TenancyContactGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(TenancyContactGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*TenancyContactGroupsListOKBody tenancy contact groups list o k body +swagger:model TenancyContactGroupsListOKBody +*/ +type TenancyContactGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ContactGroup `json:"results"` +} + +// Validate validates this tenancy contact groups list o k body +func (o *TenancyContactGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactGroupsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactGroupsListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactGroupsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactGroupsListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactGroupsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactGroupsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this tenancy contact groups list o k body based on the context it is used +func (o *TenancyContactGroupsListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactGroupsListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *TenancyContactGroupsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *TenancyContactGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyContactGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_parameters.go new file mode 100644 index 000000000..e2004ae03 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactGroupsPartialUpdateParams creates a new TenancyContactGroupsPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsPartialUpdateParams() *TenancyContactGroupsPartialUpdateParams { + return &TenancyContactGroupsPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsPartialUpdateParamsWithTimeout creates a new TenancyContactGroupsPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsPartialUpdateParams { + return &TenancyContactGroupsPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsPartialUpdateParamsWithContext creates a new TenancyContactGroupsPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactGroupsPartialUpdateParams { + return &TenancyContactGroupsPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsPartialUpdateParamsWithHTTPClient creates a new TenancyContactGroupsPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsPartialUpdateParams { + return &TenancyContactGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact groups partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsPartialUpdateParams struct { + + // Data. + Data *models.WritableContactGroup + + /* ID. + + A unique integer value identifying this contact group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsPartialUpdateParams) WithDefaults() *TenancyContactGroupsPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) WithData(data *models.WritableContactGroup) *TenancyContactGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) SetData(data *models.WritableContactGroup) { + o.Data = data +} + +// WithID adds the id to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) WithID(id int64) *TenancyContactGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact groups partial update params +func (o *TenancyContactGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_responses.go new file mode 100644 index 000000000..44526b4c5 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactGroupsPartialUpdateReader is a Reader for the TenancyContactGroupsPartialUpdate structure. +type TenancyContactGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactGroupsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsPartialUpdateOK creates a TenancyContactGroupsPartialUpdateOK with default headers values +func NewTenancyContactGroupsPartialUpdateOK() *TenancyContactGroupsPartialUpdateOK { + return &TenancyContactGroupsPartialUpdateOK{} +} + +/* TenancyContactGroupsPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactGroupsPartialUpdateOK tenancy contact groups partial update o k +*/ +type TenancyContactGroupsPartialUpdateOK struct { + Payload *models.ContactGroup +} + +func (o *TenancyContactGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contact-groups/{id}/][%d] tenancyContactGroupsPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactGroupsPartialUpdateOK) GetPayload() *models.ContactGroup { + return o.Payload +} + +func (o *TenancyContactGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_parameters.go new file mode 100644 index 000000000..2a4f0d386 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactGroupsReadParams creates a new TenancyContactGroupsReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsReadParams() *TenancyContactGroupsReadParams { + return &TenancyContactGroupsReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsReadParamsWithTimeout creates a new TenancyContactGroupsReadParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsReadParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsReadParams { + return &TenancyContactGroupsReadParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsReadParamsWithContext creates a new TenancyContactGroupsReadParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsReadParamsWithContext(ctx context.Context) *TenancyContactGroupsReadParams { + return &TenancyContactGroupsReadParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsReadParamsWithHTTPClient creates a new TenancyContactGroupsReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsReadParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsReadParams { + return &TenancyContactGroupsReadParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsReadParams contains all the parameters to send to the API endpoint + for the tenancy contact groups read operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsReadParams struct { + + /* ID. + + A unique integer value identifying this contact group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsReadParams) WithDefaults() *TenancyContactGroupsReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) WithContext(ctx context.Context) *TenancyContactGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) WithID(id int64) *TenancyContactGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact groups read params +func (o *TenancyContactGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_responses.go new file mode 100644 index 000000000..b6382e336 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactGroupsReadReader is a Reader for the TenancyContactGroupsRead structure. +type TenancyContactGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactGroupsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsReadOK creates a TenancyContactGroupsReadOK with default headers values +func NewTenancyContactGroupsReadOK() *TenancyContactGroupsReadOK { + return &TenancyContactGroupsReadOK{} +} + +/* TenancyContactGroupsReadOK describes a response with status code 200, with default header values. + +TenancyContactGroupsReadOK tenancy contact groups read o k +*/ +type TenancyContactGroupsReadOK struct { + Payload *models.ContactGroup +} + +func (o *TenancyContactGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contact-groups/{id}/][%d] tenancyContactGroupsReadOK %+v", 200, o.Payload) +} +func (o *TenancyContactGroupsReadOK) GetPayload() *models.ContactGroup { + return o.Payload +} + +func (o *TenancyContactGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_parameters.go new file mode 100644 index 000000000..cec515217 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactGroupsUpdateParams creates a new TenancyContactGroupsUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactGroupsUpdateParams() *TenancyContactGroupsUpdateParams { + return &TenancyContactGroupsUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactGroupsUpdateParamsWithTimeout creates a new TenancyContactGroupsUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactGroupsUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactGroupsUpdateParams { + return &TenancyContactGroupsUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactGroupsUpdateParamsWithContext creates a new TenancyContactGroupsUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactGroupsUpdateParamsWithContext(ctx context.Context) *TenancyContactGroupsUpdateParams { + return &TenancyContactGroupsUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactGroupsUpdateParamsWithHTTPClient creates a new TenancyContactGroupsUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactGroupsUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactGroupsUpdateParams { + return &TenancyContactGroupsUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactGroupsUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact groups update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactGroupsUpdateParams struct { + + // Data. + Data *models.WritableContactGroup + + /* ID. + + A unique integer value identifying this contact group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact groups update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsUpdateParams) WithDefaults() *TenancyContactGroupsUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact groups update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactGroupsUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) WithContext(ctx context.Context) *TenancyContactGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) WithData(data *models.WritableContactGroup) *TenancyContactGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) SetData(data *models.WritableContactGroup) { + o.Data = data +} + +// WithID adds the id to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) WithID(id int64) *TenancyContactGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact groups update params +func (o *TenancyContactGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactGroupsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_responses.go new file mode 100644 index 000000000..024899ad8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_groups_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactGroupsUpdateReader is a Reader for the TenancyContactGroupsUpdate structure. +type TenancyContactGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactGroupsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactGroupsUpdateOK creates a TenancyContactGroupsUpdateOK with default headers values +func NewTenancyContactGroupsUpdateOK() *TenancyContactGroupsUpdateOK { + return &TenancyContactGroupsUpdateOK{} +} + +/* TenancyContactGroupsUpdateOK describes a response with status code 200, with default header values. + +TenancyContactGroupsUpdateOK tenancy contact groups update o k +*/ +type TenancyContactGroupsUpdateOK struct { + Payload *models.ContactGroup +} + +func (o *TenancyContactGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contact-groups/{id}/][%d] tenancyContactGroupsUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactGroupsUpdateOK) GetPayload() *models.ContactGroup { + return o.Payload +} + +func (o *TenancyContactGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_parameters.go new file mode 100644 index 000000000..5814561dd --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewTenancyContactRolesBulkDeleteParams creates a new TenancyContactRolesBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesBulkDeleteParams() *TenancyContactRolesBulkDeleteParams { + return &TenancyContactRolesBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesBulkDeleteParamsWithTimeout creates a new TenancyContactRolesBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesBulkDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactRolesBulkDeleteParams { + return &TenancyContactRolesBulkDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesBulkDeleteParamsWithContext creates a new TenancyContactRolesBulkDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesBulkDeleteParamsWithContext(ctx context.Context) *TenancyContactRolesBulkDeleteParams { + return &TenancyContactRolesBulkDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesBulkDeleteParamsWithHTTPClient creates a new TenancyContactRolesBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesBulkDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactRolesBulkDeleteParams { + return &TenancyContactRolesBulkDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesBulkDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contact roles bulk delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesBulkDeleteParams) WithDefaults() *TenancyContactRolesBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles bulk delete params +func (o *TenancyContactRolesBulkDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactRolesBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles bulk delete params +func (o *TenancyContactRolesBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles bulk delete params +func (o *TenancyContactRolesBulkDeleteParams) WithContext(ctx context.Context) *TenancyContactRolesBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles bulk delete params +func (o *TenancyContactRolesBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles bulk delete params +func (o *TenancyContactRolesBulkDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactRolesBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles bulk delete params +func (o *TenancyContactRolesBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_responses.go new file mode 100644 index 000000000..1c4afd20f --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactRolesBulkDeleteReader is a Reader for the TenancyContactRolesBulkDelete structure. +type TenancyContactRolesBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactRolesBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesBulkDeleteNoContent creates a TenancyContactRolesBulkDeleteNoContent with default headers values +func NewTenancyContactRolesBulkDeleteNoContent() *TenancyContactRolesBulkDeleteNoContent { + return &TenancyContactRolesBulkDeleteNoContent{} +} + +/* TenancyContactRolesBulkDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactRolesBulkDeleteNoContent tenancy contact roles bulk delete no content +*/ +type TenancyContactRolesBulkDeleteNoContent struct { +} + +func (o *TenancyContactRolesBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contact-roles/][%d] tenancyContactRolesBulkDeleteNoContent ", 204) +} + +func (o *TenancyContactRolesBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_parameters.go new file mode 100644 index 000000000..f5bb00ef8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactRolesBulkPartialUpdateParams creates a new TenancyContactRolesBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesBulkPartialUpdateParams() *TenancyContactRolesBulkPartialUpdateParams { + return &TenancyContactRolesBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesBulkPartialUpdateParamsWithTimeout creates a new TenancyContactRolesBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactRolesBulkPartialUpdateParams { + return &TenancyContactRolesBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesBulkPartialUpdateParamsWithContext creates a new TenancyContactRolesBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesBulkPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactRolesBulkPartialUpdateParams { + return &TenancyContactRolesBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesBulkPartialUpdateParamsWithHTTPClient creates a new TenancyContactRolesBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactRolesBulkPartialUpdateParams { + return &TenancyContactRolesBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact roles bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesBulkPartialUpdateParams struct { + + // Data. + Data *models.ContactRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesBulkPartialUpdateParams) WithDefaults() *TenancyContactRolesBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactRolesBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactRolesBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactRolesBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) WithData(data *models.ContactRole) *TenancyContactRolesBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact roles bulk partial update params +func (o *TenancyContactRolesBulkPartialUpdateParams) SetData(data *models.ContactRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_responses.go new file mode 100644 index 000000000..276d07c92 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactRolesBulkPartialUpdateReader is a Reader for the TenancyContactRolesBulkPartialUpdate structure. +type TenancyContactRolesBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactRolesBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesBulkPartialUpdateOK creates a TenancyContactRolesBulkPartialUpdateOK with default headers values +func NewTenancyContactRolesBulkPartialUpdateOK() *TenancyContactRolesBulkPartialUpdateOK { + return &TenancyContactRolesBulkPartialUpdateOK{} +} + +/* TenancyContactRolesBulkPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactRolesBulkPartialUpdateOK tenancy contact roles bulk partial update o k +*/ +type TenancyContactRolesBulkPartialUpdateOK struct { + Payload *models.ContactRole +} + +func (o *TenancyContactRolesBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contact-roles/][%d] tenancyContactRolesBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactRolesBulkPartialUpdateOK) GetPayload() *models.ContactRole { + return o.Payload +} + +func (o *TenancyContactRolesBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_parameters.go new file mode 100644 index 000000000..04fbb53e9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactRolesBulkUpdateParams creates a new TenancyContactRolesBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesBulkUpdateParams() *TenancyContactRolesBulkUpdateParams { + return &TenancyContactRolesBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesBulkUpdateParamsWithTimeout creates a new TenancyContactRolesBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesBulkUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactRolesBulkUpdateParams { + return &TenancyContactRolesBulkUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesBulkUpdateParamsWithContext creates a new TenancyContactRolesBulkUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesBulkUpdateParamsWithContext(ctx context.Context) *TenancyContactRolesBulkUpdateParams { + return &TenancyContactRolesBulkUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesBulkUpdateParamsWithHTTPClient creates a new TenancyContactRolesBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesBulkUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactRolesBulkUpdateParams { + return &TenancyContactRolesBulkUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesBulkUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact roles bulk update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesBulkUpdateParams struct { + + // Data. + Data *models.ContactRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesBulkUpdateParams) WithDefaults() *TenancyContactRolesBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactRolesBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) WithContext(ctx context.Context) *TenancyContactRolesBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactRolesBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) WithData(data *models.ContactRole) *TenancyContactRolesBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact roles bulk update params +func (o *TenancyContactRolesBulkUpdateParams) SetData(data *models.ContactRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_responses.go new file mode 100644 index 000000000..69332b68d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactRolesBulkUpdateReader is a Reader for the TenancyContactRolesBulkUpdate structure. +type TenancyContactRolesBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactRolesBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesBulkUpdateOK creates a TenancyContactRolesBulkUpdateOK with default headers values +func NewTenancyContactRolesBulkUpdateOK() *TenancyContactRolesBulkUpdateOK { + return &TenancyContactRolesBulkUpdateOK{} +} + +/* TenancyContactRolesBulkUpdateOK describes a response with status code 200, with default header values. + +TenancyContactRolesBulkUpdateOK tenancy contact roles bulk update o k +*/ +type TenancyContactRolesBulkUpdateOK struct { + Payload *models.ContactRole +} + +func (o *TenancyContactRolesBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contact-roles/][%d] tenancyContactRolesBulkUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactRolesBulkUpdateOK) GetPayload() *models.ContactRole { + return o.Payload +} + +func (o *TenancyContactRolesBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_parameters.go new file mode 100644 index 000000000..47012beba --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactRolesCreateParams creates a new TenancyContactRolesCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesCreateParams() *TenancyContactRolesCreateParams { + return &TenancyContactRolesCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesCreateParamsWithTimeout creates a new TenancyContactRolesCreateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesCreateParamsWithTimeout(timeout time.Duration) *TenancyContactRolesCreateParams { + return &TenancyContactRolesCreateParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesCreateParamsWithContext creates a new TenancyContactRolesCreateParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesCreateParamsWithContext(ctx context.Context) *TenancyContactRolesCreateParams { + return &TenancyContactRolesCreateParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesCreateParamsWithHTTPClient creates a new TenancyContactRolesCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesCreateParamsWithHTTPClient(client *http.Client) *TenancyContactRolesCreateParams { + return &TenancyContactRolesCreateParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesCreateParams contains all the parameters to send to the API endpoint + for the tenancy contact roles create operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesCreateParams struct { + + // Data. + Data *models.ContactRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesCreateParams) WithDefaults() *TenancyContactRolesCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) WithTimeout(timeout time.Duration) *TenancyContactRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) WithContext(ctx context.Context) *TenancyContactRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) WithHTTPClient(client *http.Client) *TenancyContactRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) WithData(data *models.ContactRole) *TenancyContactRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact roles create params +func (o *TenancyContactRolesCreateParams) SetData(data *models.ContactRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_responses.go new file mode 100644 index 000000000..c0ae724aa --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactRolesCreateReader is a Reader for the TenancyContactRolesCreate structure. +type TenancyContactRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewTenancyContactRolesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesCreateCreated creates a TenancyContactRolesCreateCreated with default headers values +func NewTenancyContactRolesCreateCreated() *TenancyContactRolesCreateCreated { + return &TenancyContactRolesCreateCreated{} +} + +/* TenancyContactRolesCreateCreated describes a response with status code 201, with default header values. + +TenancyContactRolesCreateCreated tenancy contact roles create created +*/ +type TenancyContactRolesCreateCreated struct { + Payload *models.ContactRole +} + +func (o *TenancyContactRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/contact-roles/][%d] tenancyContactRolesCreateCreated %+v", 201, o.Payload) +} +func (o *TenancyContactRolesCreateCreated) GetPayload() *models.ContactRole { + return o.Payload +} + +func (o *TenancyContactRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_parameters.go new file mode 100644 index 000000000..37b05f462 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactRolesDeleteParams creates a new TenancyContactRolesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesDeleteParams() *TenancyContactRolesDeleteParams { + return &TenancyContactRolesDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesDeleteParamsWithTimeout creates a new TenancyContactRolesDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactRolesDeleteParams { + return &TenancyContactRolesDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesDeleteParamsWithContext creates a new TenancyContactRolesDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesDeleteParamsWithContext(ctx context.Context) *TenancyContactRolesDeleteParams { + return &TenancyContactRolesDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesDeleteParamsWithHTTPClient creates a new TenancyContactRolesDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactRolesDeleteParams { + return &TenancyContactRolesDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contact roles delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesDeleteParams struct { + + /* ID. + + A unique integer value identifying this contact role. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesDeleteParams) WithDefaults() *TenancyContactRolesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) WithContext(ctx context.Context) *TenancyContactRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) WithID(id int64) *TenancyContactRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact roles delete params +func (o *TenancyContactRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_responses.go new file mode 100644 index 000000000..c2c3b6f22 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactRolesDeleteReader is a Reader for the TenancyContactRolesDelete structure. +type TenancyContactRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactRolesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesDeleteNoContent creates a TenancyContactRolesDeleteNoContent with default headers values +func NewTenancyContactRolesDeleteNoContent() *TenancyContactRolesDeleteNoContent { + return &TenancyContactRolesDeleteNoContent{} +} + +/* TenancyContactRolesDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactRolesDeleteNoContent tenancy contact roles delete no content +*/ +type TenancyContactRolesDeleteNoContent struct { +} + +func (o *TenancyContactRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contact-roles/{id}/][%d] tenancyContactRolesDeleteNoContent ", 204) +} + +func (o *TenancyContactRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_parameters.go new file mode 100644 index 000000000..dd4fd6da0 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_parameters.go @@ -0,0 +1,1699 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactRolesListParams creates a new TenancyContactRolesListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesListParams() *TenancyContactRolesListParams { + return &TenancyContactRolesListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesListParamsWithTimeout creates a new TenancyContactRolesListParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesListParamsWithTimeout(timeout time.Duration) *TenancyContactRolesListParams { + return &TenancyContactRolesListParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesListParamsWithContext creates a new TenancyContactRolesListParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesListParamsWithContext(ctx context.Context) *TenancyContactRolesListParams { + return &TenancyContactRolesListParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesListParamsWithHTTPClient creates a new TenancyContactRolesListParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesListParamsWithHTTPClient(client *http.Client) *TenancyContactRolesListParams { + return &TenancyContactRolesListParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesListParams contains all the parameters to send to the API endpoint + for the tenancy contact roles list operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesListParams struct { + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + // Name. + Name *string + + // NameEmpty. + NameEmpty *string + + // NameIc. + NameIc *string + + // NameIe. + NameIe *string + + // NameIew. + NameIew *string + + // NameIsw. + NameIsw *string + + // Namen. + Namen *string + + // NameNic. + NameNic *string + + // NameNie. + NameNie *string + + // NameNiew. + NameNiew *string + + // NameNisw. + NameNisw *string + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Q. + Q *string + + // Slug. + Slug *string + + // SlugEmpty. + SlugEmpty *string + + // SlugIc. + SlugIc *string + + // SlugIe. + SlugIe *string + + // SlugIew. + SlugIew *string + + // SlugIsw. + SlugIsw *string + + // Slugn. + Slugn *string + + // SlugNic. + SlugNic *string + + // SlugNie. + SlugNie *string + + // SlugNiew. + SlugNiew *string + + // SlugNisw. + SlugNisw *string + + // Tag. + Tag *string + + // Tagn. + Tagn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesListParams) WithDefaults() *TenancyContactRolesListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithTimeout(timeout time.Duration) *TenancyContactRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithContext(ctx context.Context) *TenancyContactRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithHTTPClient(client *http.Client) *TenancyContactRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreated adds the created to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithCreated(created *string) *TenancyContactRolesListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithCreatedGte(createdGte *string) *TenancyContactRolesListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithCreatedLte(createdLte *string) *TenancyContactRolesListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithDescription adds the description to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescription(description *string) *TenancyContactRolesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionEmpty(descriptionEmpty *string) *TenancyContactRolesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionIc(descriptionIc *string) *TenancyContactRolesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionIe(descriptionIe *string) *TenancyContactRolesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionIew(descriptionIew *string) *TenancyContactRolesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionIsw(descriptionIsw *string) *TenancyContactRolesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionn(descriptionn *string) *TenancyContactRolesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionNic(descriptionNic *string) *TenancyContactRolesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionNie(descriptionNie *string) *TenancyContactRolesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionNiew(descriptionNiew *string) *TenancyContactRolesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithDescriptionNisw(descriptionNisw *string) *TenancyContactRolesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + +// WithID adds the id to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithID(id *string) *TenancyContactRolesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithIDGt(iDGt *string) *TenancyContactRolesListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithIDGte(iDGte *string) *TenancyContactRolesListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithIDLt(iDLt *string) *TenancyContactRolesListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithIDLte(iDLte *string) *TenancyContactRolesListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithIDn(iDn *string) *TenancyContactRolesListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithLastUpdated(lastUpdated *string) *TenancyContactRolesListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithLastUpdatedGte(lastUpdatedGte *string) *TenancyContactRolesListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithLastUpdatedLte(lastUpdatedLte *string) *TenancyContactRolesListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithLimit(limit *int64) *TenancyContactRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithName(name *string) *TenancyContactRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithNameEmpty adds the nameEmpty to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameEmpty(nameEmpty *string) *TenancyContactRolesListParams { + o.SetNameEmpty(nameEmpty) + return o +} + +// SetNameEmpty adds the nameEmpty to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameEmpty(nameEmpty *string) { + o.NameEmpty = nameEmpty +} + +// WithNameIc adds the nameIc to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameIc(nameIc *string) *TenancyContactRolesListParams { + o.SetNameIc(nameIc) + return o +} + +// SetNameIc adds the nameIc to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameIc(nameIc *string) { + o.NameIc = nameIc +} + +// WithNameIe adds the nameIe to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameIe(nameIe *string) *TenancyContactRolesListParams { + o.SetNameIe(nameIe) + return o +} + +// SetNameIe adds the nameIe to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameIe(nameIe *string) { + o.NameIe = nameIe +} + +// WithNameIew adds the nameIew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameIew(nameIew *string) *TenancyContactRolesListParams { + o.SetNameIew(nameIew) + return o +} + +// SetNameIew adds the nameIew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameIew(nameIew *string) { + o.NameIew = nameIew +} + +// WithNameIsw adds the nameIsw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameIsw(nameIsw *string) *TenancyContactRolesListParams { + o.SetNameIsw(nameIsw) + return o +} + +// SetNameIsw adds the nameIsw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameIsw(nameIsw *string) { + o.NameIsw = nameIsw +} + +// WithNamen adds the namen to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNamen(namen *string) *TenancyContactRolesListParams { + o.SetNamen(namen) + return o +} + +// SetNamen adds the nameN to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNamen(namen *string) { + o.Namen = namen +} + +// WithNameNic adds the nameNic to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameNic(nameNic *string) *TenancyContactRolesListParams { + o.SetNameNic(nameNic) + return o +} + +// SetNameNic adds the nameNic to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameNic(nameNic *string) { + o.NameNic = nameNic +} + +// WithNameNie adds the nameNie to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameNie(nameNie *string) *TenancyContactRolesListParams { + o.SetNameNie(nameNie) + return o +} + +// SetNameNie adds the nameNie to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameNie(nameNie *string) { + o.NameNie = nameNie +} + +// WithNameNiew adds the nameNiew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameNiew(nameNiew *string) *TenancyContactRolesListParams { + o.SetNameNiew(nameNiew) + return o +} + +// SetNameNiew adds the nameNiew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameNiew(nameNiew *string) { + o.NameNiew = nameNiew +} + +// WithNameNisw adds the nameNisw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithNameNisw(nameNisw *string) *TenancyContactRolesListParams { + o.SetNameNisw(nameNisw) + return o +} + +// SetNameNisw adds the nameNisw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetNameNisw(nameNisw *string) { + o.NameNisw = nameNisw +} + +// WithOffset adds the offset to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithOffset(offset *int64) *TenancyContactRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithQ(q *string) *TenancyContactRolesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlug(slug *string) *TenancyContactRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithSlugEmpty adds the slugEmpty to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugEmpty(slugEmpty *string) *TenancyContactRolesListParams { + o.SetSlugEmpty(slugEmpty) + return o +} + +// SetSlugEmpty adds the slugEmpty to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugEmpty(slugEmpty *string) { + o.SlugEmpty = slugEmpty +} + +// WithSlugIc adds the slugIc to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugIc(slugIc *string) *TenancyContactRolesListParams { + o.SetSlugIc(slugIc) + return o +} + +// SetSlugIc adds the slugIc to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugIc(slugIc *string) { + o.SlugIc = slugIc +} + +// WithSlugIe adds the slugIe to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugIe(slugIe *string) *TenancyContactRolesListParams { + o.SetSlugIe(slugIe) + return o +} + +// SetSlugIe adds the slugIe to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugIe(slugIe *string) { + o.SlugIe = slugIe +} + +// WithSlugIew adds the slugIew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugIew(slugIew *string) *TenancyContactRolesListParams { + o.SetSlugIew(slugIew) + return o +} + +// SetSlugIew adds the slugIew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugIew(slugIew *string) { + o.SlugIew = slugIew +} + +// WithSlugIsw adds the slugIsw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugIsw(slugIsw *string) *TenancyContactRolesListParams { + o.SetSlugIsw(slugIsw) + return o +} + +// SetSlugIsw adds the slugIsw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugIsw(slugIsw *string) { + o.SlugIsw = slugIsw +} + +// WithSlugn adds the slugn to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugn(slugn *string) *TenancyContactRolesListParams { + o.SetSlugn(slugn) + return o +} + +// SetSlugn adds the slugN to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugn(slugn *string) { + o.Slugn = slugn +} + +// WithSlugNic adds the slugNic to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugNic(slugNic *string) *TenancyContactRolesListParams { + o.SetSlugNic(slugNic) + return o +} + +// SetSlugNic adds the slugNic to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugNic(slugNic *string) { + o.SlugNic = slugNic +} + +// WithSlugNie adds the slugNie to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugNie(slugNie *string) *TenancyContactRolesListParams { + o.SetSlugNie(slugNie) + return o +} + +// SetSlugNie adds the slugNie to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugNie(slugNie *string) { + o.SlugNie = slugNie +} + +// WithSlugNiew adds the slugNiew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugNiew(slugNiew *string) *TenancyContactRolesListParams { + o.SetSlugNiew(slugNiew) + return o +} + +// SetSlugNiew adds the slugNiew to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugNiew(slugNiew *string) { + o.SlugNiew = slugNiew +} + +// WithSlugNisw adds the slugNisw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithSlugNisw(slugNisw *string) *TenancyContactRolesListParams { + o.SetSlugNisw(slugNisw) + return o +} + +// SetSlugNisw adds the slugNisw to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetSlugNisw(slugNisw *string) { + o.SlugNisw = slugNisw +} + +// WithTag adds the tag to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithTag(tag *string) *TenancyContactRolesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) WithTagn(tagn *string) *TenancyContactRolesListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the tenancy contact roles list params +func (o *TenancyContactRolesListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.NameEmpty != nil { + + // query param name__empty + var qrNameEmpty string + + if o.NameEmpty != nil { + qrNameEmpty = *o.NameEmpty + } + qNameEmpty := qrNameEmpty + if qNameEmpty != "" { + + if err := r.SetQueryParam("name__empty", qNameEmpty); err != nil { + return err + } + } + } + + if o.NameIc != nil { + + // query param name__ic + var qrNameIc string + + if o.NameIc != nil { + qrNameIc = *o.NameIc + } + qNameIc := qrNameIc + if qNameIc != "" { + + if err := r.SetQueryParam("name__ic", qNameIc); err != nil { + return err + } + } + } + + if o.NameIe != nil { + + // query param name__ie + var qrNameIe string + + if o.NameIe != nil { + qrNameIe = *o.NameIe + } + qNameIe := qrNameIe + if qNameIe != "" { + + if err := r.SetQueryParam("name__ie", qNameIe); err != nil { + return err + } + } + } + + if o.NameIew != nil { + + // query param name__iew + var qrNameIew string + + if o.NameIew != nil { + qrNameIew = *o.NameIew + } + qNameIew := qrNameIew + if qNameIew != "" { + + if err := r.SetQueryParam("name__iew", qNameIew); err != nil { + return err + } + } + } + + if o.NameIsw != nil { + + // query param name__isw + var qrNameIsw string + + if o.NameIsw != nil { + qrNameIsw = *o.NameIsw + } + qNameIsw := qrNameIsw + if qNameIsw != "" { + + if err := r.SetQueryParam("name__isw", qNameIsw); err != nil { + return err + } + } + } + + if o.Namen != nil { + + // query param name__n + var qrNamen string + + if o.Namen != nil { + qrNamen = *o.Namen + } + qNamen := qrNamen + if qNamen != "" { + + if err := r.SetQueryParam("name__n", qNamen); err != nil { + return err + } + } + } + + if o.NameNic != nil { + + // query param name__nic + var qrNameNic string + + if o.NameNic != nil { + qrNameNic = *o.NameNic + } + qNameNic := qrNameNic + if qNameNic != "" { + + if err := r.SetQueryParam("name__nic", qNameNic); err != nil { + return err + } + } + } + + if o.NameNie != nil { + + // query param name__nie + var qrNameNie string + + if o.NameNie != nil { + qrNameNie = *o.NameNie + } + qNameNie := qrNameNie + if qNameNie != "" { + + if err := r.SetQueryParam("name__nie", qNameNie); err != nil { + return err + } + } + } + + if o.NameNiew != nil { + + // query param name__niew + var qrNameNiew string + + if o.NameNiew != nil { + qrNameNiew = *o.NameNiew + } + qNameNiew := qrNameNiew + if qNameNiew != "" { + + if err := r.SetQueryParam("name__niew", qNameNiew); err != nil { + return err + } + } + } + + if o.NameNisw != nil { + + // query param name__nisw + var qrNameNisw string + + if o.NameNisw != nil { + qrNameNisw = *o.NameNisw + } + qNameNisw := qrNameNisw + if qNameNisw != "" { + + if err := r.SetQueryParam("name__nisw", qNameNisw); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + } + + if o.SlugEmpty != nil { + + // query param slug__empty + var qrSlugEmpty string + + if o.SlugEmpty != nil { + qrSlugEmpty = *o.SlugEmpty + } + qSlugEmpty := qrSlugEmpty + if qSlugEmpty != "" { + + if err := r.SetQueryParam("slug__empty", qSlugEmpty); err != nil { + return err + } + } + } + + if o.SlugIc != nil { + + // query param slug__ic + var qrSlugIc string + + if o.SlugIc != nil { + qrSlugIc = *o.SlugIc + } + qSlugIc := qrSlugIc + if qSlugIc != "" { + + if err := r.SetQueryParam("slug__ic", qSlugIc); err != nil { + return err + } + } + } + + if o.SlugIe != nil { + + // query param slug__ie + var qrSlugIe string + + if o.SlugIe != nil { + qrSlugIe = *o.SlugIe + } + qSlugIe := qrSlugIe + if qSlugIe != "" { + + if err := r.SetQueryParam("slug__ie", qSlugIe); err != nil { + return err + } + } + } + + if o.SlugIew != nil { + + // query param slug__iew + var qrSlugIew string + + if o.SlugIew != nil { + qrSlugIew = *o.SlugIew + } + qSlugIew := qrSlugIew + if qSlugIew != "" { + + if err := r.SetQueryParam("slug__iew", qSlugIew); err != nil { + return err + } + } + } + + if o.SlugIsw != nil { + + // query param slug__isw + var qrSlugIsw string + + if o.SlugIsw != nil { + qrSlugIsw = *o.SlugIsw + } + qSlugIsw := qrSlugIsw + if qSlugIsw != "" { + + if err := r.SetQueryParam("slug__isw", qSlugIsw); err != nil { + return err + } + } + } + + if o.Slugn != nil { + + // query param slug__n + var qrSlugn string + + if o.Slugn != nil { + qrSlugn = *o.Slugn + } + qSlugn := qrSlugn + if qSlugn != "" { + + if err := r.SetQueryParam("slug__n", qSlugn); err != nil { + return err + } + } + } + + if o.SlugNic != nil { + + // query param slug__nic + var qrSlugNic string + + if o.SlugNic != nil { + qrSlugNic = *o.SlugNic + } + qSlugNic := qrSlugNic + if qSlugNic != "" { + + if err := r.SetQueryParam("slug__nic", qSlugNic); err != nil { + return err + } + } + } + + if o.SlugNie != nil { + + // query param slug__nie + var qrSlugNie string + + if o.SlugNie != nil { + qrSlugNie = *o.SlugNie + } + qSlugNie := qrSlugNie + if qSlugNie != "" { + + if err := r.SetQueryParam("slug__nie", qSlugNie); err != nil { + return err + } + } + } + + if o.SlugNiew != nil { + + // query param slug__niew + var qrSlugNiew string + + if o.SlugNiew != nil { + qrSlugNiew = *o.SlugNiew + } + qSlugNiew := qrSlugNiew + if qSlugNiew != "" { + + if err := r.SetQueryParam("slug__niew", qSlugNiew); err != nil { + return err + } + } + } + + if o.SlugNisw != nil { + + // query param slug__nisw + var qrSlugNisw string + + if o.SlugNisw != nil { + qrSlugNisw = *o.SlugNisw + } + qSlugNisw := qrSlugNisw + if qSlugNisw != "" { + + if err := r.SetQueryParam("slug__nisw", qSlugNisw); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_responses.go new file mode 100644 index 000000000..424d53341 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactRolesListReader is a Reader for the TenancyContactRolesList structure. +type TenancyContactRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactRolesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesListOK creates a TenancyContactRolesListOK with default headers values +func NewTenancyContactRolesListOK() *TenancyContactRolesListOK { + return &TenancyContactRolesListOK{} +} + +/* TenancyContactRolesListOK describes a response with status code 200, with default header values. + +TenancyContactRolesListOK tenancy contact roles list o k +*/ +type TenancyContactRolesListOK struct { + Payload *TenancyContactRolesListOKBody +} + +func (o *TenancyContactRolesListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contact-roles/][%d] tenancyContactRolesListOK %+v", 200, o.Payload) +} +func (o *TenancyContactRolesListOK) GetPayload() *TenancyContactRolesListOKBody { + return o.Payload +} + +func (o *TenancyContactRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(TenancyContactRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*TenancyContactRolesListOKBody tenancy contact roles list o k body +swagger:model TenancyContactRolesListOKBody +*/ +type TenancyContactRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ContactRole `json:"results"` +} + +// Validate validates this tenancy contact roles list o k body +func (o *TenancyContactRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactRolesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactRolesListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactRolesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactRolesListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactRolesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactRolesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this tenancy contact roles list o k body based on the context it is used +func (o *TenancyContactRolesListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactRolesListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *TenancyContactRolesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *TenancyContactRolesListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyContactRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_parameters.go new file mode 100644 index 000000000..332dc3eb6 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactRolesPartialUpdateParams creates a new TenancyContactRolesPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesPartialUpdateParams() *TenancyContactRolesPartialUpdateParams { + return &TenancyContactRolesPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesPartialUpdateParamsWithTimeout creates a new TenancyContactRolesPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactRolesPartialUpdateParams { + return &TenancyContactRolesPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesPartialUpdateParamsWithContext creates a new TenancyContactRolesPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactRolesPartialUpdateParams { + return &TenancyContactRolesPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesPartialUpdateParamsWithHTTPClient creates a new TenancyContactRolesPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactRolesPartialUpdateParams { + return &TenancyContactRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact roles partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesPartialUpdateParams struct { + + // Data. + Data *models.ContactRole + + /* ID. + + A unique integer value identifying this contact role. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesPartialUpdateParams) WithDefaults() *TenancyContactRolesPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) WithData(data *models.ContactRole) *TenancyContactRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) SetData(data *models.ContactRole) { + o.Data = data +} + +// WithID adds the id to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) WithID(id int64) *TenancyContactRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact roles partial update params +func (o *TenancyContactRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_responses.go new file mode 100644 index 000000000..19c6b7dcf --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactRolesPartialUpdateReader is a Reader for the TenancyContactRolesPartialUpdate structure. +type TenancyContactRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactRolesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesPartialUpdateOK creates a TenancyContactRolesPartialUpdateOK with default headers values +func NewTenancyContactRolesPartialUpdateOK() *TenancyContactRolesPartialUpdateOK { + return &TenancyContactRolesPartialUpdateOK{} +} + +/* TenancyContactRolesPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactRolesPartialUpdateOK tenancy contact roles partial update o k +*/ +type TenancyContactRolesPartialUpdateOK struct { + Payload *models.ContactRole +} + +func (o *TenancyContactRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contact-roles/{id}/][%d] tenancyContactRolesPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactRolesPartialUpdateOK) GetPayload() *models.ContactRole { + return o.Payload +} + +func (o *TenancyContactRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_parameters.go new file mode 100644 index 000000000..96e36bfaa --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactRolesReadParams creates a new TenancyContactRolesReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesReadParams() *TenancyContactRolesReadParams { + return &TenancyContactRolesReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesReadParamsWithTimeout creates a new TenancyContactRolesReadParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesReadParamsWithTimeout(timeout time.Duration) *TenancyContactRolesReadParams { + return &TenancyContactRolesReadParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesReadParamsWithContext creates a new TenancyContactRolesReadParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesReadParamsWithContext(ctx context.Context) *TenancyContactRolesReadParams { + return &TenancyContactRolesReadParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesReadParamsWithHTTPClient creates a new TenancyContactRolesReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesReadParamsWithHTTPClient(client *http.Client) *TenancyContactRolesReadParams { + return &TenancyContactRolesReadParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesReadParams contains all the parameters to send to the API endpoint + for the tenancy contact roles read operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesReadParams struct { + + /* ID. + + A unique integer value identifying this contact role. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesReadParams) WithDefaults() *TenancyContactRolesReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) WithTimeout(timeout time.Duration) *TenancyContactRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) WithContext(ctx context.Context) *TenancyContactRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) WithHTTPClient(client *http.Client) *TenancyContactRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) WithID(id int64) *TenancyContactRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact roles read params +func (o *TenancyContactRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_responses.go new file mode 100644 index 000000000..5577d5c7b --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactRolesReadReader is a Reader for the TenancyContactRolesRead structure. +type TenancyContactRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactRolesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesReadOK creates a TenancyContactRolesReadOK with default headers values +func NewTenancyContactRolesReadOK() *TenancyContactRolesReadOK { + return &TenancyContactRolesReadOK{} +} + +/* TenancyContactRolesReadOK describes a response with status code 200, with default header values. + +TenancyContactRolesReadOK tenancy contact roles read o k +*/ +type TenancyContactRolesReadOK struct { + Payload *models.ContactRole +} + +func (o *TenancyContactRolesReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contact-roles/{id}/][%d] tenancyContactRolesReadOK %+v", 200, o.Payload) +} +func (o *TenancyContactRolesReadOK) GetPayload() *models.ContactRole { + return o.Payload +} + +func (o *TenancyContactRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_parameters.go new file mode 100644 index 000000000..810830988 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactRolesUpdateParams creates a new TenancyContactRolesUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactRolesUpdateParams() *TenancyContactRolesUpdateParams { + return &TenancyContactRolesUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactRolesUpdateParamsWithTimeout creates a new TenancyContactRolesUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactRolesUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactRolesUpdateParams { + return &TenancyContactRolesUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactRolesUpdateParamsWithContext creates a new TenancyContactRolesUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactRolesUpdateParamsWithContext(ctx context.Context) *TenancyContactRolesUpdateParams { + return &TenancyContactRolesUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactRolesUpdateParamsWithHTTPClient creates a new TenancyContactRolesUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactRolesUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactRolesUpdateParams { + return &TenancyContactRolesUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactRolesUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contact roles update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactRolesUpdateParams struct { + + // Data. + Data *models.ContactRole + + /* ID. + + A unique integer value identifying this contact role. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contact roles update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesUpdateParams) WithDefaults() *TenancyContactRolesUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contact roles update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactRolesUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) WithContext(ctx context.Context) *TenancyContactRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) WithData(data *models.ContactRole) *TenancyContactRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) SetData(data *models.ContactRole) { + o.Data = data +} + +// WithID adds the id to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) WithID(id int64) *TenancyContactRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contact roles update params +func (o *TenancyContactRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactRolesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_responses.go new file mode 100644 index 000000000..1ff5e96fe --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contact_roles_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactRolesUpdateReader is a Reader for the TenancyContactRolesUpdate structure. +type TenancyContactRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactRolesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactRolesUpdateOK creates a TenancyContactRolesUpdateOK with default headers values +func NewTenancyContactRolesUpdateOK() *TenancyContactRolesUpdateOK { + return &TenancyContactRolesUpdateOK{} +} + +/* TenancyContactRolesUpdateOK describes a response with status code 200, with default header values. + +TenancyContactRolesUpdateOK tenancy contact roles update o k +*/ +type TenancyContactRolesUpdateOK struct { + Payload *models.ContactRole +} + +func (o *TenancyContactRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contact-roles/{id}/][%d] tenancyContactRolesUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactRolesUpdateOK) GetPayload() *models.ContactRole { + return o.Payload +} + +func (o *TenancyContactRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ContactRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_parameters.go new file mode 100644 index 000000000..de6d62f48 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewTenancyContactsBulkDeleteParams creates a new TenancyContactsBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsBulkDeleteParams() *TenancyContactsBulkDeleteParams { + return &TenancyContactsBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsBulkDeleteParamsWithTimeout creates a new TenancyContactsBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsBulkDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactsBulkDeleteParams { + return &TenancyContactsBulkDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactsBulkDeleteParamsWithContext creates a new TenancyContactsBulkDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactsBulkDeleteParamsWithContext(ctx context.Context) *TenancyContactsBulkDeleteParams { + return &TenancyContactsBulkDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactsBulkDeleteParamsWithHTTPClient creates a new TenancyContactsBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsBulkDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactsBulkDeleteParams { + return &TenancyContactsBulkDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactsBulkDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contacts bulk delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsBulkDeleteParams) WithDefaults() *TenancyContactsBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts bulk delete params +func (o *TenancyContactsBulkDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactsBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts bulk delete params +func (o *TenancyContactsBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts bulk delete params +func (o *TenancyContactsBulkDeleteParams) WithContext(ctx context.Context) *TenancyContactsBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts bulk delete params +func (o *TenancyContactsBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts bulk delete params +func (o *TenancyContactsBulkDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactsBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts bulk delete params +func (o *TenancyContactsBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_responses.go new file mode 100644 index 000000000..c78023cbc --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactsBulkDeleteReader is a Reader for the TenancyContactsBulkDelete structure. +type TenancyContactsBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactsBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsBulkDeleteNoContent creates a TenancyContactsBulkDeleteNoContent with default headers values +func NewTenancyContactsBulkDeleteNoContent() *TenancyContactsBulkDeleteNoContent { + return &TenancyContactsBulkDeleteNoContent{} +} + +/* TenancyContactsBulkDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactsBulkDeleteNoContent tenancy contacts bulk delete no content +*/ +type TenancyContactsBulkDeleteNoContent struct { +} + +func (o *TenancyContactsBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contacts/][%d] tenancyContactsBulkDeleteNoContent ", 204) +} + +func (o *TenancyContactsBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_parameters.go new file mode 100644 index 000000000..322747adf --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactsBulkPartialUpdateParams creates a new TenancyContactsBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsBulkPartialUpdateParams() *TenancyContactsBulkPartialUpdateParams { + return &TenancyContactsBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsBulkPartialUpdateParamsWithTimeout creates a new TenancyContactsBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactsBulkPartialUpdateParams { + return &TenancyContactsBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactsBulkPartialUpdateParamsWithContext creates a new TenancyContactsBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactsBulkPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactsBulkPartialUpdateParams { + return &TenancyContactsBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactsBulkPartialUpdateParamsWithHTTPClient creates a new TenancyContactsBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactsBulkPartialUpdateParams { + return &TenancyContactsBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactsBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contacts bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableContact + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsBulkPartialUpdateParams) WithDefaults() *TenancyContactsBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactsBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactsBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactsBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) WithData(data *models.WritableContact) *TenancyContactsBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contacts bulk partial update params +func (o *TenancyContactsBulkPartialUpdateParams) SetData(data *models.WritableContact) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_responses.go new file mode 100644 index 000000000..66cc95439 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactsBulkPartialUpdateReader is a Reader for the TenancyContactsBulkPartialUpdate structure. +type TenancyContactsBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactsBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsBulkPartialUpdateOK creates a TenancyContactsBulkPartialUpdateOK with default headers values +func NewTenancyContactsBulkPartialUpdateOK() *TenancyContactsBulkPartialUpdateOK { + return &TenancyContactsBulkPartialUpdateOK{} +} + +/* TenancyContactsBulkPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactsBulkPartialUpdateOK tenancy contacts bulk partial update o k +*/ +type TenancyContactsBulkPartialUpdateOK struct { + Payload *models.Contact +} + +func (o *TenancyContactsBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contacts/][%d] tenancyContactsBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactsBulkPartialUpdateOK) GetPayload() *models.Contact { + return o.Payload +} + +func (o *TenancyContactsBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Contact) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_parameters.go new file mode 100644 index 000000000..2ad7e311a --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactsBulkUpdateParams creates a new TenancyContactsBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsBulkUpdateParams() *TenancyContactsBulkUpdateParams { + return &TenancyContactsBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsBulkUpdateParamsWithTimeout creates a new TenancyContactsBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsBulkUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactsBulkUpdateParams { + return &TenancyContactsBulkUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactsBulkUpdateParamsWithContext creates a new TenancyContactsBulkUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactsBulkUpdateParamsWithContext(ctx context.Context) *TenancyContactsBulkUpdateParams { + return &TenancyContactsBulkUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactsBulkUpdateParamsWithHTTPClient creates a new TenancyContactsBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsBulkUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactsBulkUpdateParams { + return &TenancyContactsBulkUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactsBulkUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contacts bulk update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsBulkUpdateParams struct { + + // Data. + Data *models.WritableContact + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsBulkUpdateParams) WithDefaults() *TenancyContactsBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactsBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) WithContext(ctx context.Context) *TenancyContactsBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactsBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) WithData(data *models.WritableContact) *TenancyContactsBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contacts bulk update params +func (o *TenancyContactsBulkUpdateParams) SetData(data *models.WritableContact) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_responses.go new file mode 100644 index 000000000..86c7fff40 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactsBulkUpdateReader is a Reader for the TenancyContactsBulkUpdate structure. +type TenancyContactsBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactsBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsBulkUpdateOK creates a TenancyContactsBulkUpdateOK with default headers values +func NewTenancyContactsBulkUpdateOK() *TenancyContactsBulkUpdateOK { + return &TenancyContactsBulkUpdateOK{} +} + +/* TenancyContactsBulkUpdateOK describes a response with status code 200, with default header values. + +TenancyContactsBulkUpdateOK tenancy contacts bulk update o k +*/ +type TenancyContactsBulkUpdateOK struct { + Payload *models.Contact +} + +func (o *TenancyContactsBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contacts/][%d] tenancyContactsBulkUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactsBulkUpdateOK) GetPayload() *models.Contact { + return o.Payload +} + +func (o *TenancyContactsBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Contact) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_parameters.go new file mode 100644 index 000000000..2fb7beb83 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactsCreateParams creates a new TenancyContactsCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsCreateParams() *TenancyContactsCreateParams { + return &TenancyContactsCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsCreateParamsWithTimeout creates a new TenancyContactsCreateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsCreateParamsWithTimeout(timeout time.Duration) *TenancyContactsCreateParams { + return &TenancyContactsCreateParams{ + timeout: timeout, + } +} + +// NewTenancyContactsCreateParamsWithContext creates a new TenancyContactsCreateParams object +// with the ability to set a context for a request. +func NewTenancyContactsCreateParamsWithContext(ctx context.Context) *TenancyContactsCreateParams { + return &TenancyContactsCreateParams{ + Context: ctx, + } +} + +// NewTenancyContactsCreateParamsWithHTTPClient creates a new TenancyContactsCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsCreateParamsWithHTTPClient(client *http.Client) *TenancyContactsCreateParams { + return &TenancyContactsCreateParams{ + HTTPClient: client, + } +} + +/* TenancyContactsCreateParams contains all the parameters to send to the API endpoint + for the tenancy contacts create operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsCreateParams struct { + + // Data. + Data *models.WritableContact + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsCreateParams) WithDefaults() *TenancyContactsCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts create params +func (o *TenancyContactsCreateParams) WithTimeout(timeout time.Duration) *TenancyContactsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts create params +func (o *TenancyContactsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts create params +func (o *TenancyContactsCreateParams) WithContext(ctx context.Context) *TenancyContactsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts create params +func (o *TenancyContactsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts create params +func (o *TenancyContactsCreateParams) WithHTTPClient(client *http.Client) *TenancyContactsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts create params +func (o *TenancyContactsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contacts create params +func (o *TenancyContactsCreateParams) WithData(data *models.WritableContact) *TenancyContactsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contacts create params +func (o *TenancyContactsCreateParams) SetData(data *models.WritableContact) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_responses.go new file mode 100644 index 000000000..990260ce0 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactsCreateReader is a Reader for the TenancyContactsCreate structure. +type TenancyContactsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewTenancyContactsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsCreateCreated creates a TenancyContactsCreateCreated with default headers values +func NewTenancyContactsCreateCreated() *TenancyContactsCreateCreated { + return &TenancyContactsCreateCreated{} +} + +/* TenancyContactsCreateCreated describes a response with status code 201, with default header values. + +TenancyContactsCreateCreated tenancy contacts create created +*/ +type TenancyContactsCreateCreated struct { + Payload *models.Contact +} + +func (o *TenancyContactsCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/contacts/][%d] tenancyContactsCreateCreated %+v", 201, o.Payload) +} +func (o *TenancyContactsCreateCreated) GetPayload() *models.Contact { + return o.Payload +} + +func (o *TenancyContactsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Contact) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_parameters.go new file mode 100644 index 000000000..0632faed8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactsDeleteParams creates a new TenancyContactsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsDeleteParams() *TenancyContactsDeleteParams { + return &TenancyContactsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsDeleteParamsWithTimeout creates a new TenancyContactsDeleteParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsDeleteParamsWithTimeout(timeout time.Duration) *TenancyContactsDeleteParams { + return &TenancyContactsDeleteParams{ + timeout: timeout, + } +} + +// NewTenancyContactsDeleteParamsWithContext creates a new TenancyContactsDeleteParams object +// with the ability to set a context for a request. +func NewTenancyContactsDeleteParamsWithContext(ctx context.Context) *TenancyContactsDeleteParams { + return &TenancyContactsDeleteParams{ + Context: ctx, + } +} + +// NewTenancyContactsDeleteParamsWithHTTPClient creates a new TenancyContactsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsDeleteParamsWithHTTPClient(client *http.Client) *TenancyContactsDeleteParams { + return &TenancyContactsDeleteParams{ + HTTPClient: client, + } +} + +/* TenancyContactsDeleteParams contains all the parameters to send to the API endpoint + for the tenancy contacts delete operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsDeleteParams struct { + + /* ID. + + A unique integer value identifying this contact. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsDeleteParams) WithDefaults() *TenancyContactsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) WithTimeout(timeout time.Duration) *TenancyContactsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) WithContext(ctx context.Context) *TenancyContactsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) WithHTTPClient(client *http.Client) *TenancyContactsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) WithID(id int64) *TenancyContactsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contacts delete params +func (o *TenancyContactsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_responses.go new file mode 100644 index 000000000..65bff98d9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// TenancyContactsDeleteReader is a Reader for the TenancyContactsDelete structure. +type TenancyContactsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewTenancyContactsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsDeleteNoContent creates a TenancyContactsDeleteNoContent with default headers values +func NewTenancyContactsDeleteNoContent() *TenancyContactsDeleteNoContent { + return &TenancyContactsDeleteNoContent{} +} + +/* TenancyContactsDeleteNoContent describes a response with status code 204, with default header values. + +TenancyContactsDeleteNoContent tenancy contacts delete no content +*/ +type TenancyContactsDeleteNoContent struct { +} + +func (o *TenancyContactsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/contacts/{id}/][%d] tenancyContactsDeleteNoContent ", 204) +} + +func (o *TenancyContactsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_parameters.go new file mode 100644 index 000000000..d965f727a --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_parameters.go @@ -0,0 +1,2505 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactsListParams creates a new TenancyContactsListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsListParams() *TenancyContactsListParams { + return &TenancyContactsListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsListParamsWithTimeout creates a new TenancyContactsListParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsListParamsWithTimeout(timeout time.Duration) *TenancyContactsListParams { + return &TenancyContactsListParams{ + timeout: timeout, + } +} + +// NewTenancyContactsListParamsWithContext creates a new TenancyContactsListParams object +// with the ability to set a context for a request. +func NewTenancyContactsListParamsWithContext(ctx context.Context) *TenancyContactsListParams { + return &TenancyContactsListParams{ + Context: ctx, + } +} + +// NewTenancyContactsListParamsWithHTTPClient creates a new TenancyContactsListParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsListParamsWithHTTPClient(client *http.Client) *TenancyContactsListParams { + return &TenancyContactsListParams{ + HTTPClient: client, + } +} + +/* TenancyContactsListParams contains all the parameters to send to the API endpoint + for the tenancy contacts list operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsListParams struct { + + // Address. + Address *string + + // AddressEmpty. + AddressEmpty *string + + // AddressIc. + AddressIc *string + + // AddressIe. + AddressIe *string + + // AddressIew. + AddressIew *string + + // AddressIsw. + AddressIsw *string + + // Addressn. + Addressn *string + + // AddressNic. + AddressNic *string + + // AddressNie. + AddressNie *string + + // AddressNiew. + AddressNiew *string + + // AddressNisw. + AddressNisw *string + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // Email. + Email *string + + // EmailEmpty. + EmailEmpty *string + + // EmailIc. + EmailIc *string + + // EmailIe. + EmailIe *string + + // EmailIew. + EmailIew *string + + // EmailIsw. + EmailIsw *string + + // Emailn. + Emailn *string + + // EmailNic. + EmailNic *string + + // EmailNie. + EmailNie *string + + // EmailNiew. + EmailNiew *string + + // EmailNisw. + EmailNisw *string + + // Group. + Group *string + + // Groupn. + Groupn *string + + // GroupID. + GroupID *string + + // GroupIDn. + GroupIDn *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + // Name. + Name *string + + // NameEmpty. + NameEmpty *string + + // NameIc. + NameIc *string + + // NameIe. + NameIe *string + + // NameIew. + NameIew *string + + // NameIsw. + NameIsw *string + + // Namen. + Namen *string + + // NameNic. + NameNic *string + + // NameNie. + NameNie *string + + // NameNiew. + NameNiew *string + + // NameNisw. + NameNisw *string + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Phone. + Phone *string + + // PhoneEmpty. + PhoneEmpty *string + + // PhoneIc. + PhoneIc *string + + // PhoneIe. + PhoneIe *string + + // PhoneIew. + PhoneIew *string + + // PhoneIsw. + PhoneIsw *string + + // Phonen. + Phonen *string + + // PhoneNic. + PhoneNic *string + + // PhoneNie. + PhoneNie *string + + // PhoneNiew. + PhoneNiew *string + + // PhoneNisw. + PhoneNisw *string + + // Q. + Q *string + + // Tag. + Tag *string + + // Tagn. + Tagn *string + + // Title. + Title *string + + // TitleEmpty. + TitleEmpty *string + + // TitleIc. + TitleIc *string + + // TitleIe. + TitleIe *string + + // TitleIew. + TitleIew *string + + // TitleIsw. + TitleIsw *string + + // Titlen. + Titlen *string + + // TitleNic. + TitleNic *string + + // TitleNie. + TitleNie *string + + // TitleNiew. + TitleNiew *string + + // TitleNisw. + TitleNisw *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsListParams) WithDefaults() *TenancyContactsListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTimeout(timeout time.Duration) *TenancyContactsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts list params +func (o *TenancyContactsListParams) WithContext(ctx context.Context) *TenancyContactsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts list params +func (o *TenancyContactsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts list params +func (o *TenancyContactsListParams) WithHTTPClient(client *http.Client) *TenancyContactsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts list params +func (o *TenancyContactsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAddress adds the address to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddress(address *string) *TenancyContactsListParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddress(address *string) { + o.Address = address +} + +// WithAddressEmpty adds the addressEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressEmpty(addressEmpty *string) *TenancyContactsListParams { + o.SetAddressEmpty(addressEmpty) + return o +} + +// SetAddressEmpty adds the addressEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressEmpty(addressEmpty *string) { + o.AddressEmpty = addressEmpty +} + +// WithAddressIc adds the addressIc to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressIc(addressIc *string) *TenancyContactsListParams { + o.SetAddressIc(addressIc) + return o +} + +// SetAddressIc adds the addressIc to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressIc(addressIc *string) { + o.AddressIc = addressIc +} + +// WithAddressIe adds the addressIe to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressIe(addressIe *string) *TenancyContactsListParams { + o.SetAddressIe(addressIe) + return o +} + +// SetAddressIe adds the addressIe to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressIe(addressIe *string) { + o.AddressIe = addressIe +} + +// WithAddressIew adds the addressIew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressIew(addressIew *string) *TenancyContactsListParams { + o.SetAddressIew(addressIew) + return o +} + +// SetAddressIew adds the addressIew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressIew(addressIew *string) { + o.AddressIew = addressIew +} + +// WithAddressIsw adds the addressIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressIsw(addressIsw *string) *TenancyContactsListParams { + o.SetAddressIsw(addressIsw) + return o +} + +// SetAddressIsw adds the addressIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressIsw(addressIsw *string) { + o.AddressIsw = addressIsw +} + +// WithAddressn adds the addressn to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressn(addressn *string) *TenancyContactsListParams { + o.SetAddressn(addressn) + return o +} + +// SetAddressn adds the addressN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressn(addressn *string) { + o.Addressn = addressn +} + +// WithAddressNic adds the addressNic to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressNic(addressNic *string) *TenancyContactsListParams { + o.SetAddressNic(addressNic) + return o +} + +// SetAddressNic adds the addressNic to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressNic(addressNic *string) { + o.AddressNic = addressNic +} + +// WithAddressNie adds the addressNie to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressNie(addressNie *string) *TenancyContactsListParams { + o.SetAddressNie(addressNie) + return o +} + +// SetAddressNie adds the addressNie to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressNie(addressNie *string) { + o.AddressNie = addressNie +} + +// WithAddressNiew adds the addressNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressNiew(addressNiew *string) *TenancyContactsListParams { + o.SetAddressNiew(addressNiew) + return o +} + +// SetAddressNiew adds the addressNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressNiew(addressNiew *string) { + o.AddressNiew = addressNiew +} + +// WithAddressNisw adds the addressNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithAddressNisw(addressNisw *string) *TenancyContactsListParams { + o.SetAddressNisw(addressNisw) + return o +} + +// SetAddressNisw adds the addressNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetAddressNisw(addressNisw *string) { + o.AddressNisw = addressNisw +} + +// WithCreated adds the created to the tenancy contacts list params +func (o *TenancyContactsListParams) WithCreated(created *string) *TenancyContactsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the tenancy contacts list params +func (o *TenancyContactsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the tenancy contacts list params +func (o *TenancyContactsListParams) WithCreatedGte(createdGte *string) *TenancyContactsListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the tenancy contacts list params +func (o *TenancyContactsListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the tenancy contacts list params +func (o *TenancyContactsListParams) WithCreatedLte(createdLte *string) *TenancyContactsListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the tenancy contacts list params +func (o *TenancyContactsListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithEmail adds the email to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmail(email *string) *TenancyContactsListParams { + o.SetEmail(email) + return o +} + +// SetEmail adds the email to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmail(email *string) { + o.Email = email +} + +// WithEmailEmpty adds the emailEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailEmpty(emailEmpty *string) *TenancyContactsListParams { + o.SetEmailEmpty(emailEmpty) + return o +} + +// SetEmailEmpty adds the emailEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailEmpty(emailEmpty *string) { + o.EmailEmpty = emailEmpty +} + +// WithEmailIc adds the emailIc to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailIc(emailIc *string) *TenancyContactsListParams { + o.SetEmailIc(emailIc) + return o +} + +// SetEmailIc adds the emailIc to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailIc(emailIc *string) { + o.EmailIc = emailIc +} + +// WithEmailIe adds the emailIe to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailIe(emailIe *string) *TenancyContactsListParams { + o.SetEmailIe(emailIe) + return o +} + +// SetEmailIe adds the emailIe to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailIe(emailIe *string) { + o.EmailIe = emailIe +} + +// WithEmailIew adds the emailIew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailIew(emailIew *string) *TenancyContactsListParams { + o.SetEmailIew(emailIew) + return o +} + +// SetEmailIew adds the emailIew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailIew(emailIew *string) { + o.EmailIew = emailIew +} + +// WithEmailIsw adds the emailIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailIsw(emailIsw *string) *TenancyContactsListParams { + o.SetEmailIsw(emailIsw) + return o +} + +// SetEmailIsw adds the emailIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailIsw(emailIsw *string) { + o.EmailIsw = emailIsw +} + +// WithEmailn adds the emailn to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailn(emailn *string) *TenancyContactsListParams { + o.SetEmailn(emailn) + return o +} + +// SetEmailn adds the emailN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailn(emailn *string) { + o.Emailn = emailn +} + +// WithEmailNic adds the emailNic to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailNic(emailNic *string) *TenancyContactsListParams { + o.SetEmailNic(emailNic) + return o +} + +// SetEmailNic adds the emailNic to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailNic(emailNic *string) { + o.EmailNic = emailNic +} + +// WithEmailNie adds the emailNie to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailNie(emailNie *string) *TenancyContactsListParams { + o.SetEmailNie(emailNie) + return o +} + +// SetEmailNie adds the emailNie to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailNie(emailNie *string) { + o.EmailNie = emailNie +} + +// WithEmailNiew adds the emailNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailNiew(emailNiew *string) *TenancyContactsListParams { + o.SetEmailNiew(emailNiew) + return o +} + +// SetEmailNiew adds the emailNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailNiew(emailNiew *string) { + o.EmailNiew = emailNiew +} + +// WithEmailNisw adds the emailNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithEmailNisw(emailNisw *string) *TenancyContactsListParams { + o.SetEmailNisw(emailNisw) + return o +} + +// SetEmailNisw adds the emailNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetEmailNisw(emailNisw *string) { + o.EmailNisw = emailNisw +} + +// WithGroup adds the group to the tenancy contacts list params +func (o *TenancyContactsListParams) WithGroup(group *string) *TenancyContactsListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the tenancy contacts list params +func (o *TenancyContactsListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupn adds the groupn to the tenancy contacts list params +func (o *TenancyContactsListParams) WithGroupn(groupn *string) *TenancyContactsListParams { + o.SetGroupn(groupn) + return o +} + +// SetGroupn adds the groupN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetGroupn(groupn *string) { + o.Groupn = groupn +} + +// WithGroupID adds the groupID to the tenancy contacts list params +func (o *TenancyContactsListParams) WithGroupID(groupID *string) *TenancyContactsListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the tenancy contacts list params +func (o *TenancyContactsListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithGroupIDn adds the groupIDn to the tenancy contacts list params +func (o *TenancyContactsListParams) WithGroupIDn(groupIDn *string) *TenancyContactsListParams { + o.SetGroupIDn(groupIDn) + return o +} + +// SetGroupIDn adds the groupIdN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetGroupIDn(groupIDn *string) { + o.GroupIDn = groupIDn +} + +// WithID adds the id to the tenancy contacts list params +func (o *TenancyContactsListParams) WithID(id *string) *TenancyContactsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contacts list params +func (o *TenancyContactsListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the tenancy contacts list params +func (o *TenancyContactsListParams) WithIDGt(iDGt *string) *TenancyContactsListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the tenancy contacts list params +func (o *TenancyContactsListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the tenancy contacts list params +func (o *TenancyContactsListParams) WithIDGte(iDGte *string) *TenancyContactsListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the tenancy contacts list params +func (o *TenancyContactsListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the tenancy contacts list params +func (o *TenancyContactsListParams) WithIDLt(iDLt *string) *TenancyContactsListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the tenancy contacts list params +func (o *TenancyContactsListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the tenancy contacts list params +func (o *TenancyContactsListParams) WithIDLte(iDLte *string) *TenancyContactsListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the tenancy contacts list params +func (o *TenancyContactsListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the tenancy contacts list params +func (o *TenancyContactsListParams) WithIDn(iDn *string) *TenancyContactsListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the tenancy contacts list params +func (o *TenancyContactsListParams) WithLastUpdated(lastUpdated *string) *TenancyContactsListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the tenancy contacts list params +func (o *TenancyContactsListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the tenancy contacts list params +func (o *TenancyContactsListParams) WithLastUpdatedGte(lastUpdatedGte *string) *TenancyContactsListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the tenancy contacts list params +func (o *TenancyContactsListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the tenancy contacts list params +func (o *TenancyContactsListParams) WithLastUpdatedLte(lastUpdatedLte *string) *TenancyContactsListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the tenancy contacts list params +func (o *TenancyContactsListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the tenancy contacts list params +func (o *TenancyContactsListParams) WithLimit(limit *int64) *TenancyContactsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy contacts list params +func (o *TenancyContactsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the tenancy contacts list params +func (o *TenancyContactsListParams) WithName(name *string) *TenancyContactsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the tenancy contacts list params +func (o *TenancyContactsListParams) SetName(name *string) { + o.Name = name +} + +// WithNameEmpty adds the nameEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameEmpty(nameEmpty *string) *TenancyContactsListParams { + o.SetNameEmpty(nameEmpty) + return o +} + +// SetNameEmpty adds the nameEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameEmpty(nameEmpty *string) { + o.NameEmpty = nameEmpty +} + +// WithNameIc adds the nameIc to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameIc(nameIc *string) *TenancyContactsListParams { + o.SetNameIc(nameIc) + return o +} + +// SetNameIc adds the nameIc to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameIc(nameIc *string) { + o.NameIc = nameIc +} + +// WithNameIe adds the nameIe to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameIe(nameIe *string) *TenancyContactsListParams { + o.SetNameIe(nameIe) + return o +} + +// SetNameIe adds the nameIe to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameIe(nameIe *string) { + o.NameIe = nameIe +} + +// WithNameIew adds the nameIew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameIew(nameIew *string) *TenancyContactsListParams { + o.SetNameIew(nameIew) + return o +} + +// SetNameIew adds the nameIew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameIew(nameIew *string) { + o.NameIew = nameIew +} + +// WithNameIsw adds the nameIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameIsw(nameIsw *string) *TenancyContactsListParams { + o.SetNameIsw(nameIsw) + return o +} + +// SetNameIsw adds the nameIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameIsw(nameIsw *string) { + o.NameIsw = nameIsw +} + +// WithNamen adds the namen to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNamen(namen *string) *TenancyContactsListParams { + o.SetNamen(namen) + return o +} + +// SetNamen adds the nameN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNamen(namen *string) { + o.Namen = namen +} + +// WithNameNic adds the nameNic to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameNic(nameNic *string) *TenancyContactsListParams { + o.SetNameNic(nameNic) + return o +} + +// SetNameNic adds the nameNic to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameNic(nameNic *string) { + o.NameNic = nameNic +} + +// WithNameNie adds the nameNie to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameNie(nameNie *string) *TenancyContactsListParams { + o.SetNameNie(nameNie) + return o +} + +// SetNameNie adds the nameNie to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameNie(nameNie *string) { + o.NameNie = nameNie +} + +// WithNameNiew adds the nameNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameNiew(nameNiew *string) *TenancyContactsListParams { + o.SetNameNiew(nameNiew) + return o +} + +// SetNameNiew adds the nameNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameNiew(nameNiew *string) { + o.NameNiew = nameNiew +} + +// WithNameNisw adds the nameNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithNameNisw(nameNisw *string) *TenancyContactsListParams { + o.SetNameNisw(nameNisw) + return o +} + +// SetNameNisw adds the nameNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetNameNisw(nameNisw *string) { + o.NameNisw = nameNisw +} + +// WithOffset adds the offset to the tenancy contacts list params +func (o *TenancyContactsListParams) WithOffset(offset *int64) *TenancyContactsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy contacts list params +func (o *TenancyContactsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPhone adds the phone to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhone(phone *string) *TenancyContactsListParams { + o.SetPhone(phone) + return o +} + +// SetPhone adds the phone to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhone(phone *string) { + o.Phone = phone +} + +// WithPhoneEmpty adds the phoneEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneEmpty(phoneEmpty *string) *TenancyContactsListParams { + o.SetPhoneEmpty(phoneEmpty) + return o +} + +// SetPhoneEmpty adds the phoneEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneEmpty(phoneEmpty *string) { + o.PhoneEmpty = phoneEmpty +} + +// WithPhoneIc adds the phoneIc to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneIc(phoneIc *string) *TenancyContactsListParams { + o.SetPhoneIc(phoneIc) + return o +} + +// SetPhoneIc adds the phoneIc to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneIc(phoneIc *string) { + o.PhoneIc = phoneIc +} + +// WithPhoneIe adds the phoneIe to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneIe(phoneIe *string) *TenancyContactsListParams { + o.SetPhoneIe(phoneIe) + return o +} + +// SetPhoneIe adds the phoneIe to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneIe(phoneIe *string) { + o.PhoneIe = phoneIe +} + +// WithPhoneIew adds the phoneIew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneIew(phoneIew *string) *TenancyContactsListParams { + o.SetPhoneIew(phoneIew) + return o +} + +// SetPhoneIew adds the phoneIew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneIew(phoneIew *string) { + o.PhoneIew = phoneIew +} + +// WithPhoneIsw adds the phoneIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneIsw(phoneIsw *string) *TenancyContactsListParams { + o.SetPhoneIsw(phoneIsw) + return o +} + +// SetPhoneIsw adds the phoneIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneIsw(phoneIsw *string) { + o.PhoneIsw = phoneIsw +} + +// WithPhonen adds the phonen to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhonen(phonen *string) *TenancyContactsListParams { + o.SetPhonen(phonen) + return o +} + +// SetPhonen adds the phoneN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhonen(phonen *string) { + o.Phonen = phonen +} + +// WithPhoneNic adds the phoneNic to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneNic(phoneNic *string) *TenancyContactsListParams { + o.SetPhoneNic(phoneNic) + return o +} + +// SetPhoneNic adds the phoneNic to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneNic(phoneNic *string) { + o.PhoneNic = phoneNic +} + +// WithPhoneNie adds the phoneNie to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneNie(phoneNie *string) *TenancyContactsListParams { + o.SetPhoneNie(phoneNie) + return o +} + +// SetPhoneNie adds the phoneNie to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneNie(phoneNie *string) { + o.PhoneNie = phoneNie +} + +// WithPhoneNiew adds the phoneNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneNiew(phoneNiew *string) *TenancyContactsListParams { + o.SetPhoneNiew(phoneNiew) + return o +} + +// SetPhoneNiew adds the phoneNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneNiew(phoneNiew *string) { + o.PhoneNiew = phoneNiew +} + +// WithPhoneNisw adds the phoneNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithPhoneNisw(phoneNisw *string) *TenancyContactsListParams { + o.SetPhoneNisw(phoneNisw) + return o +} + +// SetPhoneNisw adds the phoneNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetPhoneNisw(phoneNisw *string) { + o.PhoneNisw = phoneNisw +} + +// WithQ adds the q to the tenancy contacts list params +func (o *TenancyContactsListParams) WithQ(q *string) *TenancyContactsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the tenancy contacts list params +func (o *TenancyContactsListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTag(tag *string) *TenancyContactsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTagn(tagn *string) *TenancyContactsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WithTitle adds the title to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitle(title *string) *TenancyContactsListParams { + o.SetTitle(title) + return o +} + +// SetTitle adds the title to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitle(title *string) { + o.Title = title +} + +// WithTitleEmpty adds the titleEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleEmpty(titleEmpty *string) *TenancyContactsListParams { + o.SetTitleEmpty(titleEmpty) + return o +} + +// SetTitleEmpty adds the titleEmpty to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleEmpty(titleEmpty *string) { + o.TitleEmpty = titleEmpty +} + +// WithTitleIc adds the titleIc to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleIc(titleIc *string) *TenancyContactsListParams { + o.SetTitleIc(titleIc) + return o +} + +// SetTitleIc adds the titleIc to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleIc(titleIc *string) { + o.TitleIc = titleIc +} + +// WithTitleIe adds the titleIe to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleIe(titleIe *string) *TenancyContactsListParams { + o.SetTitleIe(titleIe) + return o +} + +// SetTitleIe adds the titleIe to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleIe(titleIe *string) { + o.TitleIe = titleIe +} + +// WithTitleIew adds the titleIew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleIew(titleIew *string) *TenancyContactsListParams { + o.SetTitleIew(titleIew) + return o +} + +// SetTitleIew adds the titleIew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleIew(titleIew *string) { + o.TitleIew = titleIew +} + +// WithTitleIsw adds the titleIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleIsw(titleIsw *string) *TenancyContactsListParams { + o.SetTitleIsw(titleIsw) + return o +} + +// SetTitleIsw adds the titleIsw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleIsw(titleIsw *string) { + o.TitleIsw = titleIsw +} + +// WithTitlen adds the titlen to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitlen(titlen *string) *TenancyContactsListParams { + o.SetTitlen(titlen) + return o +} + +// SetTitlen adds the titleN to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitlen(titlen *string) { + o.Titlen = titlen +} + +// WithTitleNic adds the titleNic to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleNic(titleNic *string) *TenancyContactsListParams { + o.SetTitleNic(titleNic) + return o +} + +// SetTitleNic adds the titleNic to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleNic(titleNic *string) { + o.TitleNic = titleNic +} + +// WithTitleNie adds the titleNie to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleNie(titleNie *string) *TenancyContactsListParams { + o.SetTitleNie(titleNie) + return o +} + +// SetTitleNie adds the titleNie to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleNie(titleNie *string) { + o.TitleNie = titleNie +} + +// WithTitleNiew adds the titleNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleNiew(titleNiew *string) *TenancyContactsListParams { + o.SetTitleNiew(titleNiew) + return o +} + +// SetTitleNiew adds the titleNiew to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleNiew(titleNiew *string) { + o.TitleNiew = titleNiew +} + +// WithTitleNisw adds the titleNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) WithTitleNisw(titleNisw *string) *TenancyContactsListParams { + o.SetTitleNisw(titleNisw) + return o +} + +// SetTitleNisw adds the titleNisw to the tenancy contacts list params +func (o *TenancyContactsListParams) SetTitleNisw(titleNisw *string) { + o.TitleNisw = titleNisw +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Address != nil { + + // query param address + var qrAddress string + + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + } + + if o.AddressEmpty != nil { + + // query param address__empty + var qrAddressEmpty string + + if o.AddressEmpty != nil { + qrAddressEmpty = *o.AddressEmpty + } + qAddressEmpty := qrAddressEmpty + if qAddressEmpty != "" { + + if err := r.SetQueryParam("address__empty", qAddressEmpty); err != nil { + return err + } + } + } + + if o.AddressIc != nil { + + // query param address__ic + var qrAddressIc string + + if o.AddressIc != nil { + qrAddressIc = *o.AddressIc + } + qAddressIc := qrAddressIc + if qAddressIc != "" { + + if err := r.SetQueryParam("address__ic", qAddressIc); err != nil { + return err + } + } + } + + if o.AddressIe != nil { + + // query param address__ie + var qrAddressIe string + + if o.AddressIe != nil { + qrAddressIe = *o.AddressIe + } + qAddressIe := qrAddressIe + if qAddressIe != "" { + + if err := r.SetQueryParam("address__ie", qAddressIe); err != nil { + return err + } + } + } + + if o.AddressIew != nil { + + // query param address__iew + var qrAddressIew string + + if o.AddressIew != nil { + qrAddressIew = *o.AddressIew + } + qAddressIew := qrAddressIew + if qAddressIew != "" { + + if err := r.SetQueryParam("address__iew", qAddressIew); err != nil { + return err + } + } + } + + if o.AddressIsw != nil { + + // query param address__isw + var qrAddressIsw string + + if o.AddressIsw != nil { + qrAddressIsw = *o.AddressIsw + } + qAddressIsw := qrAddressIsw + if qAddressIsw != "" { + + if err := r.SetQueryParam("address__isw", qAddressIsw); err != nil { + return err + } + } + } + + if o.Addressn != nil { + + // query param address__n + var qrAddressn string + + if o.Addressn != nil { + qrAddressn = *o.Addressn + } + qAddressn := qrAddressn + if qAddressn != "" { + + if err := r.SetQueryParam("address__n", qAddressn); err != nil { + return err + } + } + } + + if o.AddressNic != nil { + + // query param address__nic + var qrAddressNic string + + if o.AddressNic != nil { + qrAddressNic = *o.AddressNic + } + qAddressNic := qrAddressNic + if qAddressNic != "" { + + if err := r.SetQueryParam("address__nic", qAddressNic); err != nil { + return err + } + } + } + + if o.AddressNie != nil { + + // query param address__nie + var qrAddressNie string + + if o.AddressNie != nil { + qrAddressNie = *o.AddressNie + } + qAddressNie := qrAddressNie + if qAddressNie != "" { + + if err := r.SetQueryParam("address__nie", qAddressNie); err != nil { + return err + } + } + } + + if o.AddressNiew != nil { + + // query param address__niew + var qrAddressNiew string + + if o.AddressNiew != nil { + qrAddressNiew = *o.AddressNiew + } + qAddressNiew := qrAddressNiew + if qAddressNiew != "" { + + if err := r.SetQueryParam("address__niew", qAddressNiew); err != nil { + return err + } + } + } + + if o.AddressNisw != nil { + + // query param address__nisw + var qrAddressNisw string + + if o.AddressNisw != nil { + qrAddressNisw = *o.AddressNisw + } + qAddressNisw := qrAddressNisw + if qAddressNisw != "" { + + if err := r.SetQueryParam("address__nisw", qAddressNisw); err != nil { + return err + } + } + } + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.Email != nil { + + // query param email + var qrEmail string + + if o.Email != nil { + qrEmail = *o.Email + } + qEmail := qrEmail + if qEmail != "" { + + if err := r.SetQueryParam("email", qEmail); err != nil { + return err + } + } + } + + if o.EmailEmpty != nil { + + // query param email__empty + var qrEmailEmpty string + + if o.EmailEmpty != nil { + qrEmailEmpty = *o.EmailEmpty + } + qEmailEmpty := qrEmailEmpty + if qEmailEmpty != "" { + + if err := r.SetQueryParam("email__empty", qEmailEmpty); err != nil { + return err + } + } + } + + if o.EmailIc != nil { + + // query param email__ic + var qrEmailIc string + + if o.EmailIc != nil { + qrEmailIc = *o.EmailIc + } + qEmailIc := qrEmailIc + if qEmailIc != "" { + + if err := r.SetQueryParam("email__ic", qEmailIc); err != nil { + return err + } + } + } + + if o.EmailIe != nil { + + // query param email__ie + var qrEmailIe string + + if o.EmailIe != nil { + qrEmailIe = *o.EmailIe + } + qEmailIe := qrEmailIe + if qEmailIe != "" { + + if err := r.SetQueryParam("email__ie", qEmailIe); err != nil { + return err + } + } + } + + if o.EmailIew != nil { + + // query param email__iew + var qrEmailIew string + + if o.EmailIew != nil { + qrEmailIew = *o.EmailIew + } + qEmailIew := qrEmailIew + if qEmailIew != "" { + + if err := r.SetQueryParam("email__iew", qEmailIew); err != nil { + return err + } + } + } + + if o.EmailIsw != nil { + + // query param email__isw + var qrEmailIsw string + + if o.EmailIsw != nil { + qrEmailIsw = *o.EmailIsw + } + qEmailIsw := qrEmailIsw + if qEmailIsw != "" { + + if err := r.SetQueryParam("email__isw", qEmailIsw); err != nil { + return err + } + } + } + + if o.Emailn != nil { + + // query param email__n + var qrEmailn string + + if o.Emailn != nil { + qrEmailn = *o.Emailn + } + qEmailn := qrEmailn + if qEmailn != "" { + + if err := r.SetQueryParam("email__n", qEmailn); err != nil { + return err + } + } + } + + if o.EmailNic != nil { + + // query param email__nic + var qrEmailNic string + + if o.EmailNic != nil { + qrEmailNic = *o.EmailNic + } + qEmailNic := qrEmailNic + if qEmailNic != "" { + + if err := r.SetQueryParam("email__nic", qEmailNic); err != nil { + return err + } + } + } + + if o.EmailNie != nil { + + // query param email__nie + var qrEmailNie string + + if o.EmailNie != nil { + qrEmailNie = *o.EmailNie + } + qEmailNie := qrEmailNie + if qEmailNie != "" { + + if err := r.SetQueryParam("email__nie", qEmailNie); err != nil { + return err + } + } + } + + if o.EmailNiew != nil { + + // query param email__niew + var qrEmailNiew string + + if o.EmailNiew != nil { + qrEmailNiew = *o.EmailNiew + } + qEmailNiew := qrEmailNiew + if qEmailNiew != "" { + + if err := r.SetQueryParam("email__niew", qEmailNiew); err != nil { + return err + } + } + } + + if o.EmailNisw != nil { + + // query param email__nisw + var qrEmailNisw string + + if o.EmailNisw != nil { + qrEmailNisw = *o.EmailNisw + } + qEmailNisw := qrEmailNisw + if qEmailNisw != "" { + + if err := r.SetQueryParam("email__nisw", qEmailNisw); err != nil { + return err + } + } + } + + if o.Group != nil { + + // query param group + var qrGroup string + + if o.Group != nil { + qrGroup = *o.Group + } + qGroup := qrGroup + if qGroup != "" { + + if err := r.SetQueryParam("group", qGroup); err != nil { + return err + } + } + } + + if o.Groupn != nil { + + // query param group__n + var qrGroupn string + + if o.Groupn != nil { + qrGroupn = *o.Groupn + } + qGroupn := qrGroupn + if qGroupn != "" { + + if err := r.SetQueryParam("group__n", qGroupn); err != nil { + return err + } + } + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + } + + if o.GroupIDn != nil { + + // query param group_id__n + var qrGroupIDn string + + if o.GroupIDn != nil { + qrGroupIDn = *o.GroupIDn + } + qGroupIDn := qrGroupIDn + if qGroupIDn != "" { + + if err := r.SetQueryParam("group_id__n", qGroupIDn); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.NameEmpty != nil { + + // query param name__empty + var qrNameEmpty string + + if o.NameEmpty != nil { + qrNameEmpty = *o.NameEmpty + } + qNameEmpty := qrNameEmpty + if qNameEmpty != "" { + + if err := r.SetQueryParam("name__empty", qNameEmpty); err != nil { + return err + } + } + } + + if o.NameIc != nil { + + // query param name__ic + var qrNameIc string + + if o.NameIc != nil { + qrNameIc = *o.NameIc + } + qNameIc := qrNameIc + if qNameIc != "" { + + if err := r.SetQueryParam("name__ic", qNameIc); err != nil { + return err + } + } + } + + if o.NameIe != nil { + + // query param name__ie + var qrNameIe string + + if o.NameIe != nil { + qrNameIe = *o.NameIe + } + qNameIe := qrNameIe + if qNameIe != "" { + + if err := r.SetQueryParam("name__ie", qNameIe); err != nil { + return err + } + } + } + + if o.NameIew != nil { + + // query param name__iew + var qrNameIew string + + if o.NameIew != nil { + qrNameIew = *o.NameIew + } + qNameIew := qrNameIew + if qNameIew != "" { + + if err := r.SetQueryParam("name__iew", qNameIew); err != nil { + return err + } + } + } + + if o.NameIsw != nil { + + // query param name__isw + var qrNameIsw string + + if o.NameIsw != nil { + qrNameIsw = *o.NameIsw + } + qNameIsw := qrNameIsw + if qNameIsw != "" { + + if err := r.SetQueryParam("name__isw", qNameIsw); err != nil { + return err + } + } + } + + if o.Namen != nil { + + // query param name__n + var qrNamen string + + if o.Namen != nil { + qrNamen = *o.Namen + } + qNamen := qrNamen + if qNamen != "" { + + if err := r.SetQueryParam("name__n", qNamen); err != nil { + return err + } + } + } + + if o.NameNic != nil { + + // query param name__nic + var qrNameNic string + + if o.NameNic != nil { + qrNameNic = *o.NameNic + } + qNameNic := qrNameNic + if qNameNic != "" { + + if err := r.SetQueryParam("name__nic", qNameNic); err != nil { + return err + } + } + } + + if o.NameNie != nil { + + // query param name__nie + var qrNameNie string + + if o.NameNie != nil { + qrNameNie = *o.NameNie + } + qNameNie := qrNameNie + if qNameNie != "" { + + if err := r.SetQueryParam("name__nie", qNameNie); err != nil { + return err + } + } + } + + if o.NameNiew != nil { + + // query param name__niew + var qrNameNiew string + + if o.NameNiew != nil { + qrNameNiew = *o.NameNiew + } + qNameNiew := qrNameNiew + if qNameNiew != "" { + + if err := r.SetQueryParam("name__niew", qNameNiew); err != nil { + return err + } + } + } + + if o.NameNisw != nil { + + // query param name__nisw + var qrNameNisw string + + if o.NameNisw != nil { + qrNameNisw = *o.NameNisw + } + qNameNisw := qrNameNisw + if qNameNisw != "" { + + if err := r.SetQueryParam("name__nisw", qNameNisw); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Phone != nil { + + // query param phone + var qrPhone string + + if o.Phone != nil { + qrPhone = *o.Phone + } + qPhone := qrPhone + if qPhone != "" { + + if err := r.SetQueryParam("phone", qPhone); err != nil { + return err + } + } + } + + if o.PhoneEmpty != nil { + + // query param phone__empty + var qrPhoneEmpty string + + if o.PhoneEmpty != nil { + qrPhoneEmpty = *o.PhoneEmpty + } + qPhoneEmpty := qrPhoneEmpty + if qPhoneEmpty != "" { + + if err := r.SetQueryParam("phone__empty", qPhoneEmpty); err != nil { + return err + } + } + } + + if o.PhoneIc != nil { + + // query param phone__ic + var qrPhoneIc string + + if o.PhoneIc != nil { + qrPhoneIc = *o.PhoneIc + } + qPhoneIc := qrPhoneIc + if qPhoneIc != "" { + + if err := r.SetQueryParam("phone__ic", qPhoneIc); err != nil { + return err + } + } + } + + if o.PhoneIe != nil { + + // query param phone__ie + var qrPhoneIe string + + if o.PhoneIe != nil { + qrPhoneIe = *o.PhoneIe + } + qPhoneIe := qrPhoneIe + if qPhoneIe != "" { + + if err := r.SetQueryParam("phone__ie", qPhoneIe); err != nil { + return err + } + } + } + + if o.PhoneIew != nil { + + // query param phone__iew + var qrPhoneIew string + + if o.PhoneIew != nil { + qrPhoneIew = *o.PhoneIew + } + qPhoneIew := qrPhoneIew + if qPhoneIew != "" { + + if err := r.SetQueryParam("phone__iew", qPhoneIew); err != nil { + return err + } + } + } + + if o.PhoneIsw != nil { + + // query param phone__isw + var qrPhoneIsw string + + if o.PhoneIsw != nil { + qrPhoneIsw = *o.PhoneIsw + } + qPhoneIsw := qrPhoneIsw + if qPhoneIsw != "" { + + if err := r.SetQueryParam("phone__isw", qPhoneIsw); err != nil { + return err + } + } + } + + if o.Phonen != nil { + + // query param phone__n + var qrPhonen string + + if o.Phonen != nil { + qrPhonen = *o.Phonen + } + qPhonen := qrPhonen + if qPhonen != "" { + + if err := r.SetQueryParam("phone__n", qPhonen); err != nil { + return err + } + } + } + + if o.PhoneNic != nil { + + // query param phone__nic + var qrPhoneNic string + + if o.PhoneNic != nil { + qrPhoneNic = *o.PhoneNic + } + qPhoneNic := qrPhoneNic + if qPhoneNic != "" { + + if err := r.SetQueryParam("phone__nic", qPhoneNic); err != nil { + return err + } + } + } + + if o.PhoneNie != nil { + + // query param phone__nie + var qrPhoneNie string + + if o.PhoneNie != nil { + qrPhoneNie = *o.PhoneNie + } + qPhoneNie := qrPhoneNie + if qPhoneNie != "" { + + if err := r.SetQueryParam("phone__nie", qPhoneNie); err != nil { + return err + } + } + } + + if o.PhoneNiew != nil { + + // query param phone__niew + var qrPhoneNiew string + + if o.PhoneNiew != nil { + qrPhoneNiew = *o.PhoneNiew + } + qPhoneNiew := qrPhoneNiew + if qPhoneNiew != "" { + + if err := r.SetQueryParam("phone__niew", qPhoneNiew); err != nil { + return err + } + } + } + + if o.PhoneNisw != nil { + + // query param phone__nisw + var qrPhoneNisw string + + if o.PhoneNisw != nil { + qrPhoneNisw = *o.PhoneNisw + } + qPhoneNisw := qrPhoneNisw + if qPhoneNisw != "" { + + if err := r.SetQueryParam("phone__nisw", qPhoneNisw); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if o.Title != nil { + + // query param title + var qrTitle string + + if o.Title != nil { + qrTitle = *o.Title + } + qTitle := qrTitle + if qTitle != "" { + + if err := r.SetQueryParam("title", qTitle); err != nil { + return err + } + } + } + + if o.TitleEmpty != nil { + + // query param title__empty + var qrTitleEmpty string + + if o.TitleEmpty != nil { + qrTitleEmpty = *o.TitleEmpty + } + qTitleEmpty := qrTitleEmpty + if qTitleEmpty != "" { + + if err := r.SetQueryParam("title__empty", qTitleEmpty); err != nil { + return err + } + } + } + + if o.TitleIc != nil { + + // query param title__ic + var qrTitleIc string + + if o.TitleIc != nil { + qrTitleIc = *o.TitleIc + } + qTitleIc := qrTitleIc + if qTitleIc != "" { + + if err := r.SetQueryParam("title__ic", qTitleIc); err != nil { + return err + } + } + } + + if o.TitleIe != nil { + + // query param title__ie + var qrTitleIe string + + if o.TitleIe != nil { + qrTitleIe = *o.TitleIe + } + qTitleIe := qrTitleIe + if qTitleIe != "" { + + if err := r.SetQueryParam("title__ie", qTitleIe); err != nil { + return err + } + } + } + + if o.TitleIew != nil { + + // query param title__iew + var qrTitleIew string + + if o.TitleIew != nil { + qrTitleIew = *o.TitleIew + } + qTitleIew := qrTitleIew + if qTitleIew != "" { + + if err := r.SetQueryParam("title__iew", qTitleIew); err != nil { + return err + } + } + } + + if o.TitleIsw != nil { + + // query param title__isw + var qrTitleIsw string + + if o.TitleIsw != nil { + qrTitleIsw = *o.TitleIsw + } + qTitleIsw := qrTitleIsw + if qTitleIsw != "" { + + if err := r.SetQueryParam("title__isw", qTitleIsw); err != nil { + return err + } + } + } + + if o.Titlen != nil { + + // query param title__n + var qrTitlen string + + if o.Titlen != nil { + qrTitlen = *o.Titlen + } + qTitlen := qrTitlen + if qTitlen != "" { + + if err := r.SetQueryParam("title__n", qTitlen); err != nil { + return err + } + } + } + + if o.TitleNic != nil { + + // query param title__nic + var qrTitleNic string + + if o.TitleNic != nil { + qrTitleNic = *o.TitleNic + } + qTitleNic := qrTitleNic + if qTitleNic != "" { + + if err := r.SetQueryParam("title__nic", qTitleNic); err != nil { + return err + } + } + } + + if o.TitleNie != nil { + + // query param title__nie + var qrTitleNie string + + if o.TitleNie != nil { + qrTitleNie = *o.TitleNie + } + qTitleNie := qrTitleNie + if qTitleNie != "" { + + if err := r.SetQueryParam("title__nie", qTitleNie); err != nil { + return err + } + } + } + + if o.TitleNiew != nil { + + // query param title__niew + var qrTitleNiew string + + if o.TitleNiew != nil { + qrTitleNiew = *o.TitleNiew + } + qTitleNiew := qrTitleNiew + if qTitleNiew != "" { + + if err := r.SetQueryParam("title__niew", qTitleNiew); err != nil { + return err + } + } + } + + if o.TitleNisw != nil { + + // query param title__nisw + var qrTitleNisw string + + if o.TitleNisw != nil { + qrTitleNisw = *o.TitleNisw + } + qTitleNisw := qrTitleNisw + if qTitleNisw != "" { + + if err := r.SetQueryParam("title__nisw", qTitleNisw); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_responses.go new file mode 100644 index 000000000..d7cf7c5cb --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactsListReader is a Reader for the TenancyContactsList structure. +type TenancyContactsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsListOK creates a TenancyContactsListOK with default headers values +func NewTenancyContactsListOK() *TenancyContactsListOK { + return &TenancyContactsListOK{} +} + +/* TenancyContactsListOK describes a response with status code 200, with default header values. + +TenancyContactsListOK tenancy contacts list o k +*/ +type TenancyContactsListOK struct { + Payload *TenancyContactsListOKBody +} + +func (o *TenancyContactsListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contacts/][%d] tenancyContactsListOK %+v", 200, o.Payload) +} +func (o *TenancyContactsListOK) GetPayload() *TenancyContactsListOKBody { + return o.Payload +} + +func (o *TenancyContactsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(TenancyContactsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*TenancyContactsListOKBody tenancy contacts list o k body +swagger:model TenancyContactsListOKBody +*/ +type TenancyContactsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Contact `json:"results"` +} + +// Validate validates this tenancy contacts list o k body +func (o *TenancyContactsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactsListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactsListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("tenancyContactsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyContactsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("tenancyContactsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this tenancy contacts list o k body based on the context it is used +func (o *TenancyContactsListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyContactsListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyContactsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenancyContactsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *TenancyContactsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *TenancyContactsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyContactsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_parameters.go new file mode 100644 index 000000000..3d9637669 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactsPartialUpdateParams creates a new TenancyContactsPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsPartialUpdateParams() *TenancyContactsPartialUpdateParams { + return &TenancyContactsPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsPartialUpdateParamsWithTimeout creates a new TenancyContactsPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactsPartialUpdateParams { + return &TenancyContactsPartialUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactsPartialUpdateParamsWithContext creates a new TenancyContactsPartialUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactsPartialUpdateParamsWithContext(ctx context.Context) *TenancyContactsPartialUpdateParams { + return &TenancyContactsPartialUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactsPartialUpdateParamsWithHTTPClient creates a new TenancyContactsPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactsPartialUpdateParams { + return &TenancyContactsPartialUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactsPartialUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contacts partial update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsPartialUpdateParams struct { + + // Data. + Data *models.WritableContact + + /* ID. + + A unique integer value identifying this contact. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsPartialUpdateParams) WithDefaults() *TenancyContactsPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) WithContext(ctx context.Context) *TenancyContactsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) WithData(data *models.WritableContact) *TenancyContactsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) SetData(data *models.WritableContact) { + o.Data = data +} + +// WithID adds the id to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) WithID(id int64) *TenancyContactsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contacts partial update params +func (o *TenancyContactsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_responses.go new file mode 100644 index 000000000..59662a83e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactsPartialUpdateReader is a Reader for the TenancyContactsPartialUpdate structure. +type TenancyContactsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsPartialUpdateOK creates a TenancyContactsPartialUpdateOK with default headers values +func NewTenancyContactsPartialUpdateOK() *TenancyContactsPartialUpdateOK { + return &TenancyContactsPartialUpdateOK{} +} + +/* TenancyContactsPartialUpdateOK describes a response with status code 200, with default header values. + +TenancyContactsPartialUpdateOK tenancy contacts partial update o k +*/ +type TenancyContactsPartialUpdateOK struct { + Payload *models.Contact +} + +func (o *TenancyContactsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/contacts/{id}/][%d] tenancyContactsPartialUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactsPartialUpdateOK) GetPayload() *models.Contact { + return o.Payload +} + +func (o *TenancyContactsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Contact) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_parameters.go new file mode 100644 index 000000000..3ae1e71bb --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewTenancyContactsReadParams creates a new TenancyContactsReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsReadParams() *TenancyContactsReadParams { + return &TenancyContactsReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsReadParamsWithTimeout creates a new TenancyContactsReadParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsReadParamsWithTimeout(timeout time.Duration) *TenancyContactsReadParams { + return &TenancyContactsReadParams{ + timeout: timeout, + } +} + +// NewTenancyContactsReadParamsWithContext creates a new TenancyContactsReadParams object +// with the ability to set a context for a request. +func NewTenancyContactsReadParamsWithContext(ctx context.Context) *TenancyContactsReadParams { + return &TenancyContactsReadParams{ + Context: ctx, + } +} + +// NewTenancyContactsReadParamsWithHTTPClient creates a new TenancyContactsReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsReadParamsWithHTTPClient(client *http.Client) *TenancyContactsReadParams { + return &TenancyContactsReadParams{ + HTTPClient: client, + } +} + +/* TenancyContactsReadParams contains all the parameters to send to the API endpoint + for the tenancy contacts read operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsReadParams struct { + + /* ID. + + A unique integer value identifying this contact. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsReadParams) WithDefaults() *TenancyContactsReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts read params +func (o *TenancyContactsReadParams) WithTimeout(timeout time.Duration) *TenancyContactsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts read params +func (o *TenancyContactsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts read params +func (o *TenancyContactsReadParams) WithContext(ctx context.Context) *TenancyContactsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts read params +func (o *TenancyContactsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts read params +func (o *TenancyContactsReadParams) WithHTTPClient(client *http.Client) *TenancyContactsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts read params +func (o *TenancyContactsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy contacts read params +func (o *TenancyContactsReadParams) WithID(id int64) *TenancyContactsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contacts read params +func (o *TenancyContactsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_responses.go new file mode 100644 index 000000000..07ab7f616 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactsReadReader is a Reader for the TenancyContactsRead structure. +type TenancyContactsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsReadOK creates a TenancyContactsReadOK with default headers values +func NewTenancyContactsReadOK() *TenancyContactsReadOK { + return &TenancyContactsReadOK{} +} + +/* TenancyContactsReadOK describes a response with status code 200, with default header values. + +TenancyContactsReadOK tenancy contacts read o k +*/ +type TenancyContactsReadOK struct { + Payload *models.Contact +} + +func (o *TenancyContactsReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/contacts/{id}/][%d] tenancyContactsReadOK %+v", 200, o.Payload) +} +func (o *TenancyContactsReadOK) GetPayload() *models.Contact { + return o.Payload +} + +func (o *TenancyContactsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Contact) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_parameters.go new file mode 100644 index 000000000..a51e96f76 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewTenancyContactsUpdateParams creates a new TenancyContactsUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewTenancyContactsUpdateParams() *TenancyContactsUpdateParams { + return &TenancyContactsUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyContactsUpdateParamsWithTimeout creates a new TenancyContactsUpdateParams object +// with the ability to set a timeout on a request. +func NewTenancyContactsUpdateParamsWithTimeout(timeout time.Duration) *TenancyContactsUpdateParams { + return &TenancyContactsUpdateParams{ + timeout: timeout, + } +} + +// NewTenancyContactsUpdateParamsWithContext creates a new TenancyContactsUpdateParams object +// with the ability to set a context for a request. +func NewTenancyContactsUpdateParamsWithContext(ctx context.Context) *TenancyContactsUpdateParams { + return &TenancyContactsUpdateParams{ + Context: ctx, + } +} + +// NewTenancyContactsUpdateParamsWithHTTPClient creates a new TenancyContactsUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewTenancyContactsUpdateParamsWithHTTPClient(client *http.Client) *TenancyContactsUpdateParams { + return &TenancyContactsUpdateParams{ + HTTPClient: client, + } +} + +/* TenancyContactsUpdateParams contains all the parameters to send to the API endpoint + for the tenancy contacts update operation. + + Typically these are written to a http.Request. +*/ +type TenancyContactsUpdateParams struct { + + // Data. + Data *models.WritableContact + + /* ID. + + A unique integer value identifying this contact. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the tenancy contacts update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsUpdateParams) WithDefaults() *TenancyContactsUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the tenancy contacts update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *TenancyContactsUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) WithTimeout(timeout time.Duration) *TenancyContactsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) WithContext(ctx context.Context) *TenancyContactsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) WithHTTPClient(client *http.Client) *TenancyContactsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) WithData(data *models.WritableContact) *TenancyContactsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) SetData(data *models.WritableContact) { + o.Data = data +} + +// WithID adds the id to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) WithID(id int64) *TenancyContactsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy contacts update params +func (o *TenancyContactsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyContactsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_responses.go new file mode 100644 index 000000000..bfc580d28 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_contacts_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// TenancyContactsUpdateReader is a Reader for the TenancyContactsUpdate structure. +type TenancyContactsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyContactsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewTenancyContactsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewTenancyContactsUpdateOK creates a TenancyContactsUpdateOK with default headers values +func NewTenancyContactsUpdateOK() *TenancyContactsUpdateOK { + return &TenancyContactsUpdateOK{} +} + +/* TenancyContactsUpdateOK describes a response with status code 200, with default header values. + +TenancyContactsUpdateOK tenancy contacts update o k +*/ +type TenancyContactsUpdateOK struct { + Payload *models.Contact +} + +func (o *TenancyContactsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/contacts/{id}/][%d] tenancyContactsUpdateOK %+v", 200, o.Payload) +} +func (o *TenancyContactsUpdateOK) GetPayload() *models.Contact { + return o.Payload +} + +func (o *TenancyContactsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Contact) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go index 851e34f2c..b9265e3a1 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go @@ -237,6 +237,12 @@ type TenancyTenantGroupsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -862,6 +868,28 @@ func (o *TenancyTenantGroupsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithTag(tag *string) *TenancyTenantGroupsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithTagn(tagn *string) *TenancyTenantGroupsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *TenancyTenantGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -1754,6 +1782,40 @@ func (o *TenancyTenantGroupsListParams) WriteToRequest(r runtime.ClientRequest, } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go index 448d76b51..58dd8a9d7 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/tenancy/tenancy_tenants_list_parameters.go @@ -75,6 +75,18 @@ func NewTenancyTenantsListParamsWithHTTPClient(client *http.Client) *TenancyTena */ type TenancyTenantsListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -84,6 +96,39 @@ type TenancyTenantsListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Group. Group *string @@ -263,6 +308,50 @@ func (o *TenancyTenantsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithContact adds the contact to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithContact(contact *string) *TenancyTenantsListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithContactn(contactn *string) *TenancyTenantsListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithContactRole(contactRole *string) *TenancyTenantsListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithContactRolen(contactRolen *string) *TenancyTenantsListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the tenancy tenants list params func (o *TenancyTenantsListParams) WithCreated(created *string) *TenancyTenantsListParams { o.SetCreated(created) @@ -296,6 +385,127 @@ func (o *TenancyTenantsListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescription(description *string) *TenancyTenantsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionEmpty(descriptionEmpty *string) *TenancyTenantsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionIc(descriptionIc *string) *TenancyTenantsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionIe(descriptionIe *string) *TenancyTenantsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionIew(descriptionIew *string) *TenancyTenantsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionIsw(descriptionIsw *string) *TenancyTenantsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionn(descriptionn *string) *TenancyTenantsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionNic(descriptionNic *string) *TenancyTenantsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionNie(descriptionNie *string) *TenancyTenantsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionNiew(descriptionNiew *string) *TenancyTenantsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithDescriptionNisw(descriptionNisw *string) *TenancyTenantsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithGroup adds the group to the tenancy tenants list params func (o *TenancyTenantsListParams) WithGroup(group *string) *TenancyTenantsListParams { o.SetGroup(group) @@ -744,6 +954,74 @@ func (o *TenancyTenantsListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -795,6 +1073,193 @@ func (o *TenancyTenantsListParams) WriteToRequest(r runtime.ClientRequest, reg s } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Group != nil { // query param group diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/users/users_permissions_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/users/users_permissions_list_parameters.go index 592f5d3f5..8054603d9 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/users/users_permissions_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/users/users_permissions_list_parameters.go @@ -75,6 +75,39 @@ func NewUsersPermissionsListParamsWithHTTPClient(client *http.Client) *UsersPerm */ type UsersPermissionsListParams struct { + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Enabled. Enabled *string @@ -227,6 +260,127 @@ func (o *UsersPermissionsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDescription adds the description to the users permissions list params +func (o *UsersPermissionsListParams) WithDescription(description *string) *UsersPermissionsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the users permissions list params +func (o *UsersPermissionsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionEmpty(descriptionEmpty *string) *UsersPermissionsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionIc(descriptionIc *string) *UsersPermissionsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionIe(descriptionIe *string) *UsersPermissionsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionIew(descriptionIew *string) *UsersPermissionsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionIsw(descriptionIsw *string) *UsersPermissionsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionn(descriptionn *string) *UsersPermissionsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionNic(descriptionNic *string) *UsersPermissionsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionNie(descriptionNie *string) *UsersPermissionsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionNiew(descriptionNiew *string) *UsersPermissionsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the users permissions list params +func (o *UsersPermissionsListParams) WithDescriptionNisw(descriptionNisw *string) *UsersPermissionsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the users permissions list params +func (o *UsersPermissionsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithEnabled adds the enabled to the users permissions list params func (o *UsersPermissionsListParams) WithEnabled(enabled *string) *UsersPermissionsListParams { o.SetEnabled(enabled) @@ -576,6 +730,193 @@ func (o *UsersPermissionsListParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Enabled != nil { // query param enabled diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/users/users_tokens_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/users/users_tokens_list_parameters.go index 5ab2d84da..641f60223 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/users/users_tokens_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/users/users_tokens_list_parameters.go @@ -84,6 +84,39 @@ type UsersTokensListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Expires. Expires *string @@ -260,6 +293,127 @@ func (o *UsersTokensListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the users tokens list params +func (o *UsersTokensListParams) WithDescription(description *string) *UsersTokensListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the users tokens list params +func (o *UsersTokensListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionEmpty(descriptionEmpty *string) *UsersTokensListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionIc(descriptionIc *string) *UsersTokensListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionIe(descriptionIe *string) *UsersTokensListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionIew(descriptionIew *string) *UsersTokensListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionIsw(descriptionIsw *string) *UsersTokensListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionn(descriptionn *string) *UsersTokensListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionNic(descriptionNic *string) *UsersTokensListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionNie(descriptionNie *string) *UsersTokensListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionNiew(descriptionNiew *string) *UsersTokensListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the users tokens list params +func (o *UsersTokensListParams) WithDescriptionNisw(descriptionNisw *string) *UsersTokensListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the users tokens list params +func (o *UsersTokensListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithExpires adds the expires to the users tokens list params func (o *UsersTokensListParams) WithExpires(expires *string) *UsersTokensListParams { o.SetExpires(expires) @@ -627,6 +781,193 @@ func (o *UsersTokensListParams) WriteToRequest(r runtime.ClientRequest, reg strf } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Expires != nil { // query param expires diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go index 07e176b26..6edc7d009 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go @@ -75,6 +75,18 @@ func NewVirtualizationClusterGroupsListParamsWithHTTPClient(client *http.Client) */ type VirtualizationClusterGroupsListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -225,6 +237,12 @@ type VirtualizationClusterGroupsListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -278,6 +296,50 @@ func (o *VirtualizationClusterGroupsListParams) SetHTTPClient(client *http.Clien o.HTTPClient = client } +// WithContact adds the contact to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithContact(contact *string) *VirtualizationClusterGroupsListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithContactn(contactn *string) *VirtualizationClusterGroupsListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithContactRole(contactRole *string) *VirtualizationClusterGroupsListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithContactRolen(contactRolen *string) *VirtualizationClusterGroupsListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the virtualization cluster groups list params func (o *VirtualizationClusterGroupsListParams) WithCreated(created *string) *VirtualizationClusterGroupsListParams { o.SetCreated(created) @@ -806,6 +868,28 @@ func (o *VirtualizationClusterGroupsListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithTag(tag *string) *VirtualizationClusterGroupsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithTagn(tagn *string) *VirtualizationClusterGroupsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *VirtualizationClusterGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -814,6 +898,74 @@ func (o *VirtualizationClusterGroupsListParams) WriteToRequest(r runtime.ClientR } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created @@ -1630,6 +1782,40 @@ func (o *VirtualizationClusterGroupsListParams) WriteToRequest(r runtime.ClientR } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go index 9a05e58e6..37d1c2452 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go @@ -225,6 +225,12 @@ type VirtualizationClusterTypesListParams struct { // SlugNisw. SlugNisw *string + // Tag. + Tag *string + + // Tagn. + Tagn *string + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -806,6 +812,28 @@ func (o *VirtualizationClusterTypesListParams) SetSlugNisw(slugNisw *string) { o.SlugNisw = slugNisw } +// WithTag adds the tag to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithTag(tag *string) *VirtualizationClusterTypesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithTagn(tagn *string) *VirtualizationClusterTypesListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + // WriteToRequest writes these params to a swagger request func (o *VirtualizationClusterTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -1630,6 +1658,40 @@ func (o *VirtualizationClusterTypesListParams) WriteToRequest(r runtime.ClientRe } } + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go index a6f6ba1dd..213a3b22f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_clusters_list_parameters.go @@ -75,6 +75,18 @@ func NewVirtualizationClustersListParamsWithHTTPClient(client *http.Client) *Vir */ type VirtualizationClustersListParams struct { + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -302,6 +314,50 @@ func (o *VirtualizationClustersListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithContact adds the contact to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithContact(contact *string) *VirtualizationClustersListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithContactn(contactn *string) *VirtualizationClustersListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithContactRole(contactRole *string) *VirtualizationClustersListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithContactRolen(contactRolen *string) *VirtualizationClustersListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the virtualization clusters list params func (o *VirtualizationClustersListParams) WithCreated(created *string) *VirtualizationClustersListParams { o.SetCreated(created) @@ -926,6 +982,74 @@ func (o *VirtualizationClustersListParams) WriteToRequest(r runtime.ClientReques } var res []error + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go index 74e33439f..8ece9a3ba 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_interfaces_list_parameters.go @@ -75,6 +75,12 @@ func NewVirtualizationInterfacesListParamsWithHTTPClient(client *http.Client) *V */ type VirtualizationInterfacesListParams struct { + // BridgeID. + BridgeID *string + + // BridgeIDn. + BridgeIDn *string + // Cluster. Cluster *string @@ -96,6 +102,39 @@ type VirtualizationInterfacesListParams struct { // CreatedLte. CreatedLte *string + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + // Enabled. Enabled *string @@ -299,6 +338,28 @@ func (o *VirtualizationInterfacesListParams) SetHTTPClient(client *http.Client) o.HTTPClient = client } +// WithBridgeID adds the bridgeID to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithBridgeID(bridgeID *string) *VirtualizationInterfacesListParams { + o.SetBridgeID(bridgeID) + return o +} + +// SetBridgeID adds the bridgeId to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetBridgeID(bridgeID *string) { + o.BridgeID = bridgeID +} + +// WithBridgeIDn adds the bridgeIDn to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithBridgeIDn(bridgeIDn *string) *VirtualizationInterfacesListParams { + o.SetBridgeIDn(bridgeIDn) + return o +} + +// SetBridgeIDn adds the bridgeIdN to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetBridgeIDn(bridgeIDn *string) { + o.BridgeIDn = bridgeIDn +} + // WithCluster adds the cluster to the virtualization interfaces list params func (o *VirtualizationInterfacesListParams) WithCluster(cluster *string) *VirtualizationInterfacesListParams { o.SetCluster(cluster) @@ -376,6 +437,127 @@ func (o *VirtualizationInterfacesListParams) SetCreatedLte(createdLte *string) { o.CreatedLte = createdLte } +// WithDescription adds the description to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescription(description *string) *VirtualizationInterfacesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionEmpty(descriptionEmpty *string) *VirtualizationInterfacesListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionIc(descriptionIc *string) *VirtualizationInterfacesListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionIe(descriptionIe *string) *VirtualizationInterfacesListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionIew(descriptionIew *string) *VirtualizationInterfacesListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionIsw(descriptionIsw *string) *VirtualizationInterfacesListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionn(descriptionn *string) *VirtualizationInterfacesListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionNic(descriptionNic *string) *VirtualizationInterfacesListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionNie(descriptionNie *string) *VirtualizationInterfacesListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionNiew(descriptionNiew *string) *VirtualizationInterfacesListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithDescriptionNisw(descriptionNisw *string) *VirtualizationInterfacesListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + // WithEnabled adds the enabled to the virtualization interfaces list params func (o *VirtualizationInterfacesListParams) WithEnabled(enabled *string) *VirtualizationInterfacesListParams { o.SetEnabled(enabled) @@ -912,6 +1094,40 @@ func (o *VirtualizationInterfacesListParams) WriteToRequest(r runtime.ClientRequ } var res []error + if o.BridgeID != nil { + + // query param bridge_id + var qrBridgeID string + + if o.BridgeID != nil { + qrBridgeID = *o.BridgeID + } + qBridgeID := qrBridgeID + if qBridgeID != "" { + + if err := r.SetQueryParam("bridge_id", qBridgeID); err != nil { + return err + } + } + } + + if o.BridgeIDn != nil { + + // query param bridge_id__n + var qrBridgeIDn string + + if o.BridgeIDn != nil { + qrBridgeIDn = *o.BridgeIDn + } + qBridgeIDn := qrBridgeIDn + if qBridgeIDn != "" { + + if err := r.SetQueryParam("bridge_id__n", qBridgeIDn); err != nil { + return err + } + } + } + if o.Cluster != nil { // query param cluster @@ -1031,6 +1247,193 @@ func (o *VirtualizationInterfacesListParams) WriteToRequest(r runtime.ClientRequ } } + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + if o.Enabled != nil { // query param enabled diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go index c54f632fe..4e800038e 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go +++ b/vendor/github.com/smutel/go-netbox/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go @@ -111,6 +111,18 @@ type VirtualizationVirtualMachinesListParams struct { // ClusterTypeIDn. ClusterTypeIDn *string + // Contact. + Contact *string + + // Contactn. + Contactn *string + + // ContactRole. + ContactRole *string + + // ContactRolen. + ContactRolen *string + // Created. Created *string @@ -566,6 +578,50 @@ func (o *VirtualizationVirtualMachinesListParams) SetClusterTypeIDn(clusterTypeI o.ClusterTypeIDn = clusterTypeIDn } +// WithContact adds the contact to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithContact(contact *string) *VirtualizationVirtualMachinesListParams { + o.SetContact(contact) + return o +} + +// SetContact adds the contact to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetContact(contact *string) { + o.Contact = contact +} + +// WithContactn adds the contactn to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithContactn(contactn *string) *VirtualizationVirtualMachinesListParams { + o.SetContactn(contactn) + return o +} + +// SetContactn adds the contactN to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetContactn(contactn *string) { + o.Contactn = contactn +} + +// WithContactRole adds the contactRole to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithContactRole(contactRole *string) *VirtualizationVirtualMachinesListParams { + o.SetContactRole(contactRole) + return o +} + +// SetContactRole adds the contactRole to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetContactRole(contactRole *string) { + o.ContactRole = contactRole +} + +// WithContactRolen adds the contactRolen to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithContactRolen(contactRolen *string) *VirtualizationVirtualMachinesListParams { + o.SetContactRolen(contactRolen) + return o +} + +// SetContactRolen adds the contactRoleN to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetContactRolen(contactRolen *string) { + o.ContactRolen = contactRolen +} + // WithCreated adds the created to the virtualization virtual machines list params func (o *VirtualizationVirtualMachinesListParams) WithCreated(created *string) *VirtualizationVirtualMachinesListParams { o.SetCreated(created) @@ -1746,6 +1802,74 @@ func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.Clien } } + if o.Contact != nil { + + // query param contact + var qrContact string + + if o.Contact != nil { + qrContact = *o.Contact + } + qContact := qrContact + if qContact != "" { + + if err := r.SetQueryParam("contact", qContact); err != nil { + return err + } + } + } + + if o.Contactn != nil { + + // query param contact__n + var qrContactn string + + if o.Contactn != nil { + qrContactn = *o.Contactn + } + qContactn := qrContactn + if qContactn != "" { + + if err := r.SetQueryParam("contact__n", qContactn); err != nil { + return err + } + } + } + + if o.ContactRole != nil { + + // query param contact_role + var qrContactRole string + + if o.ContactRole != nil { + qrContactRole = *o.ContactRole + } + qContactRole := qrContactRole + if qContactRole != "" { + + if err := r.SetQueryParam("contact_role", qContactRole); err != nil { + return err + } + } + } + + if o.ContactRolen != nil { + + // query param contact_role__n + var qrContactRolen string + + if o.ContactRolen != nil { + qrContactRolen = *o.ContactRolen + } + qContactRolen := qrContactRolen + if qContactRolen != "" { + + if err := r.SetQueryParam("contact_role__n", qContactRolen); err != nil { + return err + } + } + } + if o.Created != nil { // query param created diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_client.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_client.go new file mode 100644 index 000000000..7c7352f55 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_client.go @@ -0,0 +1,1161 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new wireless API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for wireless API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + WirelessWirelessLanGroupsBulkDelete(params *WirelessWirelessLanGroupsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsBulkDeleteNoContent, error) + + WirelessWirelessLanGroupsBulkPartialUpdate(params *WirelessWirelessLanGroupsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsBulkPartialUpdateOK, error) + + WirelessWirelessLanGroupsBulkUpdate(params *WirelessWirelessLanGroupsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsBulkUpdateOK, error) + + WirelessWirelessLanGroupsCreate(params *WirelessWirelessLanGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsCreateCreated, error) + + WirelessWirelessLanGroupsDelete(params *WirelessWirelessLanGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsDeleteNoContent, error) + + WirelessWirelessLanGroupsList(params *WirelessWirelessLanGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsListOK, error) + + WirelessWirelessLanGroupsPartialUpdate(params *WirelessWirelessLanGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsPartialUpdateOK, error) + + WirelessWirelessLanGroupsRead(params *WirelessWirelessLanGroupsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsReadOK, error) + + WirelessWirelessLanGroupsUpdate(params *WirelessWirelessLanGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsUpdateOK, error) + + WirelessWirelessLansBulkDelete(params *WirelessWirelessLansBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansBulkDeleteNoContent, error) + + WirelessWirelessLansBulkPartialUpdate(params *WirelessWirelessLansBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansBulkPartialUpdateOK, error) + + WirelessWirelessLansBulkUpdate(params *WirelessWirelessLansBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansBulkUpdateOK, error) + + WirelessWirelessLansCreate(params *WirelessWirelessLansCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansCreateCreated, error) + + WirelessWirelessLansDelete(params *WirelessWirelessLansDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansDeleteNoContent, error) + + WirelessWirelessLansList(params *WirelessWirelessLansListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansListOK, error) + + WirelessWirelessLansPartialUpdate(params *WirelessWirelessLansPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansPartialUpdateOK, error) + + WirelessWirelessLansRead(params *WirelessWirelessLansReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansReadOK, error) + + WirelessWirelessLansUpdate(params *WirelessWirelessLansUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansUpdateOK, error) + + WirelessWirelessLinksBulkDelete(params *WirelessWirelessLinksBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksBulkDeleteNoContent, error) + + WirelessWirelessLinksBulkPartialUpdate(params *WirelessWirelessLinksBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksBulkPartialUpdateOK, error) + + WirelessWirelessLinksBulkUpdate(params *WirelessWirelessLinksBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksBulkUpdateOK, error) + + WirelessWirelessLinksCreate(params *WirelessWirelessLinksCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksCreateCreated, error) + + WirelessWirelessLinksDelete(params *WirelessWirelessLinksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksDeleteNoContent, error) + + WirelessWirelessLinksList(params *WirelessWirelessLinksListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksListOK, error) + + WirelessWirelessLinksPartialUpdate(params *WirelessWirelessLinksPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksPartialUpdateOK, error) + + WirelessWirelessLinksRead(params *WirelessWirelessLinksReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksReadOK, error) + + WirelessWirelessLinksUpdate(params *WirelessWirelessLinksUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksUpdateOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + WirelessWirelessLanGroupsBulkDelete wireless wireless lan groups bulk delete API +*/ +func (a *Client) WirelessWirelessLanGroupsBulkDelete(params *WirelessWirelessLanGroupsBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_bulk_delete", + Method: "DELETE", + PathPattern: "/wireless/wireless-lan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsBulkPartialUpdate wireless wireless lan groups bulk partial update API +*/ +func (a *Client) WirelessWirelessLanGroupsBulkPartialUpdate(params *WirelessWirelessLanGroupsBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_bulk_partial_update", + Method: "PATCH", + PathPattern: "/wireless/wireless-lan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsBulkUpdate wireless wireless lan groups bulk update API +*/ +func (a *Client) WirelessWirelessLanGroupsBulkUpdate(params *WirelessWirelessLanGroupsBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_bulk_update", + Method: "PUT", + PathPattern: "/wireless/wireless-lan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsCreate wireless wireless lan groups create API +*/ +func (a *Client) WirelessWirelessLanGroupsCreate(params *WirelessWirelessLanGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsCreateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_create", + Method: "POST", + PathPattern: "/wireless/wireless-lan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsDelete wireless wireless lan groups delete API +*/ +func (a *Client) WirelessWirelessLanGroupsDelete(params *WirelessWirelessLanGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_delete", + Method: "DELETE", + PathPattern: "/wireless/wireless-lan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) WirelessWirelessLanGroupsList(params *WirelessWirelessLanGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsListParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_list", + Method: "GET", + PathPattern: "/wireless/wireless-lan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsPartialUpdate wireless wireless lan groups partial update API +*/ +func (a *Client) WirelessWirelessLanGroupsPartialUpdate(params *WirelessWirelessLanGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_partial_update", + Method: "PATCH", + PathPattern: "/wireless/wireless-lan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsRead wireless wireless lan groups read API +*/ +func (a *Client) WirelessWirelessLanGroupsRead(params *WirelessWirelessLanGroupsReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsReadParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_read", + Method: "GET", + PathPattern: "/wireless/wireless-lan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLanGroupsUpdate wireless wireless lan groups update API +*/ +func (a *Client) WirelessWirelessLanGroupsUpdate(params *WirelessWirelessLanGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLanGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLanGroupsUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lan-groups_update", + Method: "PUT", + PathPattern: "/wireless/wireless-lan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLanGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLanGroupsUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lan-groups_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansBulkDelete wireless wireless lans bulk delete API +*/ +func (a *Client) WirelessWirelessLansBulkDelete(params *WirelessWirelessLansBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_bulk_delete", + Method: "DELETE", + PathPattern: "/wireless/wireless-lans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansBulkPartialUpdate wireless wireless lans bulk partial update API +*/ +func (a *Client) WirelessWirelessLansBulkPartialUpdate(params *WirelessWirelessLansBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_bulk_partial_update", + Method: "PATCH", + PathPattern: "/wireless/wireless-lans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansBulkUpdate wireless wireless lans bulk update API +*/ +func (a *Client) WirelessWirelessLansBulkUpdate(params *WirelessWirelessLansBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_bulk_update", + Method: "PUT", + PathPattern: "/wireless/wireless-lans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansCreate wireless wireless lans create API +*/ +func (a *Client) WirelessWirelessLansCreate(params *WirelessWirelessLansCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansCreateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_create", + Method: "POST", + PathPattern: "/wireless/wireless-lans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansDelete wireless wireless lans delete API +*/ +func (a *Client) WirelessWirelessLansDelete(params *WirelessWirelessLansDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_delete", + Method: "DELETE", + PathPattern: "/wireless/wireless-lans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) WirelessWirelessLansList(params *WirelessWirelessLansListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansListParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_list", + Method: "GET", + PathPattern: "/wireless/wireless-lans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansPartialUpdate wireless wireless lans partial update API +*/ +func (a *Client) WirelessWirelessLansPartialUpdate(params *WirelessWirelessLansPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_partial_update", + Method: "PATCH", + PathPattern: "/wireless/wireless-lans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansRead wireless wireless lans read API +*/ +func (a *Client) WirelessWirelessLansRead(params *WirelessWirelessLansReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansReadParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_read", + Method: "GET", + PathPattern: "/wireless/wireless-lans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLansUpdate wireless wireless lans update API +*/ +func (a *Client) WirelessWirelessLansUpdate(params *WirelessWirelessLansUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLansUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLansUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-lans_update", + Method: "PUT", + PathPattern: "/wireless/wireless-lans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLansUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLansUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-lans_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksBulkDelete wireless wireless links bulk delete API +*/ +func (a *Client) WirelessWirelessLinksBulkDelete(params *WirelessWirelessLinksBulkDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksBulkDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksBulkDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_bulk_delete", + Method: "DELETE", + PathPattern: "/wireless/wireless-links/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksBulkDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksBulkDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_bulk_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksBulkPartialUpdate wireless wireless links bulk partial update API +*/ +func (a *Client) WirelessWirelessLinksBulkPartialUpdate(params *WirelessWirelessLinksBulkPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksBulkPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksBulkPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_bulk_partial_update", + Method: "PATCH", + PathPattern: "/wireless/wireless-links/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksBulkPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksBulkPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_bulk_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksBulkUpdate wireless wireless links bulk update API +*/ +func (a *Client) WirelessWirelessLinksBulkUpdate(params *WirelessWirelessLinksBulkUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksBulkUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksBulkUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_bulk_update", + Method: "PUT", + PathPattern: "/wireless/wireless-links/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksBulkUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksBulkUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_bulk_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksCreate wireless wireless links create API +*/ +func (a *Client) WirelessWirelessLinksCreate(params *WirelessWirelessLinksCreateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksCreateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_create", + Method: "POST", + PathPattern: "/wireless/wireless-links/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksCreateCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_create: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksDelete wireless wireless links delete API +*/ +func (a *Client) WirelessWirelessLinksDelete(params *WirelessWirelessLinksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_delete", + Method: "DELETE", + PathPattern: "/wireless/wireless-links/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksDeleteNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksList Overrides ListModelMixin to allow processing ExportTemplates. +*/ +func (a *Client) WirelessWirelessLinksList(params *WirelessWirelessLinksListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksListParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_list", + Method: "GET", + PathPattern: "/wireless/wireless-links/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksListOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksPartialUpdate wireless wireless links partial update API +*/ +func (a *Client) WirelessWirelessLinksPartialUpdate(params *WirelessWirelessLinksPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksPartialUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_partial_update", + Method: "PATCH", + PathPattern: "/wireless/wireless-links/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksPartialUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_partial_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksRead wireless wireless links read API +*/ +func (a *Client) WirelessWirelessLinksRead(params *WirelessWirelessLinksReadParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksReadParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_read", + Method: "GET", + PathPattern: "/wireless/wireless-links/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksReadOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_read: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + WirelessWirelessLinksUpdate wireless wireless links update API +*/ +func (a *Client) WirelessWirelessLinksUpdate(params *WirelessWirelessLinksUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*WirelessWirelessLinksUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewWirelessWirelessLinksUpdateParams() + } + op := &runtime.ClientOperation{ + ID: "wireless_wireless-links_update", + Method: "PUT", + PathPattern: "/wireless/wireless-links/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &WirelessWirelessLinksUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*WirelessWirelessLinksUpdateOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for wireless_wireless-links_update: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_parameters.go new file mode 100644 index 000000000..6ea2b01ea --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewWirelessWirelessLanGroupsBulkDeleteParams creates a new WirelessWirelessLanGroupsBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsBulkDeleteParams() *WirelessWirelessLanGroupsBulkDeleteParams { + return &WirelessWirelessLanGroupsBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsBulkDeleteParamsWithTimeout creates a new WirelessWirelessLanGroupsBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsBulkDeleteParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsBulkDeleteParams { + return &WirelessWirelessLanGroupsBulkDeleteParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsBulkDeleteParamsWithContext creates a new WirelessWirelessLanGroupsBulkDeleteParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsBulkDeleteParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsBulkDeleteParams { + return &WirelessWirelessLanGroupsBulkDeleteParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsBulkDeleteParamsWithHTTPClient creates a new WirelessWirelessLanGroupsBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsBulkDeleteParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsBulkDeleteParams { + return &WirelessWirelessLanGroupsBulkDeleteParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsBulkDeleteParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups bulk delete operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsBulkDeleteParams) WithDefaults() *WirelessWirelessLanGroupsBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups bulk delete params +func (o *WirelessWirelessLanGroupsBulkDeleteParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups bulk delete params +func (o *WirelessWirelessLanGroupsBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups bulk delete params +func (o *WirelessWirelessLanGroupsBulkDeleteParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups bulk delete params +func (o *WirelessWirelessLanGroupsBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups bulk delete params +func (o *WirelessWirelessLanGroupsBulkDeleteParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups bulk delete params +func (o *WirelessWirelessLanGroupsBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_responses.go new file mode 100644 index 000000000..e66da5eb8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// WirelessWirelessLanGroupsBulkDeleteReader is a Reader for the WirelessWirelessLanGroupsBulkDelete structure. +type WirelessWirelessLanGroupsBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewWirelessWirelessLanGroupsBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsBulkDeleteNoContent creates a WirelessWirelessLanGroupsBulkDeleteNoContent with default headers values +func NewWirelessWirelessLanGroupsBulkDeleteNoContent() *WirelessWirelessLanGroupsBulkDeleteNoContent { + return &WirelessWirelessLanGroupsBulkDeleteNoContent{} +} + +/* WirelessWirelessLanGroupsBulkDeleteNoContent describes a response with status code 204, with default header values. + +WirelessWirelessLanGroupsBulkDeleteNoContent wireless wireless lan groups bulk delete no content +*/ +type WirelessWirelessLanGroupsBulkDeleteNoContent struct { +} + +func (o *WirelessWirelessLanGroupsBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /wireless/wireless-lan-groups/][%d] wirelessWirelessLanGroupsBulkDeleteNoContent ", 204) +} + +func (o *WirelessWirelessLanGroupsBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_parameters.go new file mode 100644 index 000000000..f28da450f --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLanGroupsBulkPartialUpdateParams creates a new WirelessWirelessLanGroupsBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsBulkPartialUpdateParams() *WirelessWirelessLanGroupsBulkPartialUpdateParams { + return &WirelessWirelessLanGroupsBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsBulkPartialUpdateParamsWithTimeout creates a new WirelessWirelessLanGroupsBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsBulkPartialUpdateParams { + return &WirelessWirelessLanGroupsBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsBulkPartialUpdateParamsWithContext creates a new WirelessWirelessLanGroupsBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsBulkPartialUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsBulkPartialUpdateParams { + return &WirelessWirelessLanGroupsBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsBulkPartialUpdateParamsWithHTTPClient creates a new WirelessWirelessLanGroupsBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsBulkPartialUpdateParams { + return &WirelessWirelessLanGroupsBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableWirelessLANGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) WithDefaults() *WirelessWirelessLanGroupsBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) WithData(data *models.WritableWirelessLANGroup) *WirelessWirelessLanGroupsBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lan groups bulk partial update params +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) SetData(data *models.WritableWirelessLANGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_responses.go new file mode 100644 index 000000000..316d88432 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLanGroupsBulkPartialUpdateReader is a Reader for the WirelessWirelessLanGroupsBulkPartialUpdate structure. +type WirelessWirelessLanGroupsBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLanGroupsBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsBulkPartialUpdateOK creates a WirelessWirelessLanGroupsBulkPartialUpdateOK with default headers values +func NewWirelessWirelessLanGroupsBulkPartialUpdateOK() *WirelessWirelessLanGroupsBulkPartialUpdateOK { + return &WirelessWirelessLanGroupsBulkPartialUpdateOK{} +} + +/* WirelessWirelessLanGroupsBulkPartialUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLanGroupsBulkPartialUpdateOK wireless wireless lan groups bulk partial update o k +*/ +type WirelessWirelessLanGroupsBulkPartialUpdateOK struct { + Payload *models.WirelessLANGroup +} + +func (o *WirelessWirelessLanGroupsBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /wireless/wireless-lan-groups/][%d] wirelessWirelessLanGroupsBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLanGroupsBulkPartialUpdateOK) GetPayload() *models.WirelessLANGroup { + return o.Payload +} + +func (o *WirelessWirelessLanGroupsBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_parameters.go new file mode 100644 index 000000000..0c3edbbb8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLanGroupsBulkUpdateParams creates a new WirelessWirelessLanGroupsBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsBulkUpdateParams() *WirelessWirelessLanGroupsBulkUpdateParams { + return &WirelessWirelessLanGroupsBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsBulkUpdateParamsWithTimeout creates a new WirelessWirelessLanGroupsBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsBulkUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsBulkUpdateParams { + return &WirelessWirelessLanGroupsBulkUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsBulkUpdateParamsWithContext creates a new WirelessWirelessLanGroupsBulkUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsBulkUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsBulkUpdateParams { + return &WirelessWirelessLanGroupsBulkUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsBulkUpdateParamsWithHTTPClient creates a new WirelessWirelessLanGroupsBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsBulkUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsBulkUpdateParams { + return &WirelessWirelessLanGroupsBulkUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsBulkUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups bulk update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsBulkUpdateParams struct { + + // Data. + Data *models.WritableWirelessLANGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsBulkUpdateParams) WithDefaults() *WirelessWirelessLanGroupsBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) WithData(data *models.WritableWirelessLANGroup) *WirelessWirelessLanGroupsBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lan groups bulk update params +func (o *WirelessWirelessLanGroupsBulkUpdateParams) SetData(data *models.WritableWirelessLANGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_responses.go new file mode 100644 index 000000000..8ae06d576 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLanGroupsBulkUpdateReader is a Reader for the WirelessWirelessLanGroupsBulkUpdate structure. +type WirelessWirelessLanGroupsBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLanGroupsBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsBulkUpdateOK creates a WirelessWirelessLanGroupsBulkUpdateOK with default headers values +func NewWirelessWirelessLanGroupsBulkUpdateOK() *WirelessWirelessLanGroupsBulkUpdateOK { + return &WirelessWirelessLanGroupsBulkUpdateOK{} +} + +/* WirelessWirelessLanGroupsBulkUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLanGroupsBulkUpdateOK wireless wireless lan groups bulk update o k +*/ +type WirelessWirelessLanGroupsBulkUpdateOK struct { + Payload *models.WirelessLANGroup +} + +func (o *WirelessWirelessLanGroupsBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /wireless/wireless-lan-groups/][%d] wirelessWirelessLanGroupsBulkUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLanGroupsBulkUpdateOK) GetPayload() *models.WirelessLANGroup { + return o.Payload +} + +func (o *WirelessWirelessLanGroupsBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_parameters.go new file mode 100644 index 000000000..eb4c9830a --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLanGroupsCreateParams creates a new WirelessWirelessLanGroupsCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsCreateParams() *WirelessWirelessLanGroupsCreateParams { + return &WirelessWirelessLanGroupsCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsCreateParamsWithTimeout creates a new WirelessWirelessLanGroupsCreateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsCreateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsCreateParams { + return &WirelessWirelessLanGroupsCreateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsCreateParamsWithContext creates a new WirelessWirelessLanGroupsCreateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsCreateParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsCreateParams { + return &WirelessWirelessLanGroupsCreateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsCreateParamsWithHTTPClient creates a new WirelessWirelessLanGroupsCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsCreateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsCreateParams { + return &WirelessWirelessLanGroupsCreateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsCreateParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups create operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsCreateParams struct { + + // Data. + Data *models.WritableWirelessLANGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsCreateParams) WithDefaults() *WirelessWirelessLanGroupsCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) WithData(data *models.WritableWirelessLANGroup) *WirelessWirelessLanGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lan groups create params +func (o *WirelessWirelessLanGroupsCreateParams) SetData(data *models.WritableWirelessLANGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_responses.go new file mode 100644 index 000000000..1c2cf9eb2 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLanGroupsCreateReader is a Reader for the WirelessWirelessLanGroupsCreate structure. +type WirelessWirelessLanGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewWirelessWirelessLanGroupsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsCreateCreated creates a WirelessWirelessLanGroupsCreateCreated with default headers values +func NewWirelessWirelessLanGroupsCreateCreated() *WirelessWirelessLanGroupsCreateCreated { + return &WirelessWirelessLanGroupsCreateCreated{} +} + +/* WirelessWirelessLanGroupsCreateCreated describes a response with status code 201, with default header values. + +WirelessWirelessLanGroupsCreateCreated wireless wireless lan groups create created +*/ +type WirelessWirelessLanGroupsCreateCreated struct { + Payload *models.WirelessLANGroup +} + +func (o *WirelessWirelessLanGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /wireless/wireless-lan-groups/][%d] wirelessWirelessLanGroupsCreateCreated %+v", 201, o.Payload) +} +func (o *WirelessWirelessLanGroupsCreateCreated) GetPayload() *models.WirelessLANGroup { + return o.Payload +} + +func (o *WirelessWirelessLanGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_parameters.go new file mode 100644 index 000000000..e5f8bb6ce --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLanGroupsDeleteParams creates a new WirelessWirelessLanGroupsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsDeleteParams() *WirelessWirelessLanGroupsDeleteParams { + return &WirelessWirelessLanGroupsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsDeleteParamsWithTimeout creates a new WirelessWirelessLanGroupsDeleteParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsDeleteParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsDeleteParams { + return &WirelessWirelessLanGroupsDeleteParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsDeleteParamsWithContext creates a new WirelessWirelessLanGroupsDeleteParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsDeleteParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsDeleteParams { + return &WirelessWirelessLanGroupsDeleteParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsDeleteParamsWithHTTPClient creates a new WirelessWirelessLanGroupsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsDeleteParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsDeleteParams { + return &WirelessWirelessLanGroupsDeleteParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsDeleteParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups delete operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsDeleteParams struct { + + /* ID. + + A unique integer value identifying this Wireless LAN Group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsDeleteParams) WithDefaults() *WirelessWirelessLanGroupsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) WithID(id int64) *WirelessWirelessLanGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lan groups delete params +func (o *WirelessWirelessLanGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_responses.go new file mode 100644 index 000000000..c90a4273c --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// WirelessWirelessLanGroupsDeleteReader is a Reader for the WirelessWirelessLanGroupsDelete structure. +type WirelessWirelessLanGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewWirelessWirelessLanGroupsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsDeleteNoContent creates a WirelessWirelessLanGroupsDeleteNoContent with default headers values +func NewWirelessWirelessLanGroupsDeleteNoContent() *WirelessWirelessLanGroupsDeleteNoContent { + return &WirelessWirelessLanGroupsDeleteNoContent{} +} + +/* WirelessWirelessLanGroupsDeleteNoContent describes a response with status code 204, with default header values. + +WirelessWirelessLanGroupsDeleteNoContent wireless wireless lan groups delete no content +*/ +type WirelessWirelessLanGroupsDeleteNoContent struct { +} + +func (o *WirelessWirelessLanGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /wireless/wireless-lan-groups/{id}/][%d] wirelessWirelessLanGroupsDeleteNoContent ", 204) +} + +func (o *WirelessWirelessLanGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_parameters.go new file mode 100644 index 000000000..5e653ad2e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_parameters.go @@ -0,0 +1,1823 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLanGroupsListParams creates a new WirelessWirelessLanGroupsListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsListParams() *WirelessWirelessLanGroupsListParams { + return &WirelessWirelessLanGroupsListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsListParamsWithTimeout creates a new WirelessWirelessLanGroupsListParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsListParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsListParams { + return &WirelessWirelessLanGroupsListParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsListParamsWithContext creates a new WirelessWirelessLanGroupsListParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsListParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsListParams { + return &WirelessWirelessLanGroupsListParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsListParamsWithHTTPClient creates a new WirelessWirelessLanGroupsListParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsListParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsListParams { + return &WirelessWirelessLanGroupsListParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsListParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups list operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsListParams struct { + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + // Name. + Name *string + + // NameEmpty. + NameEmpty *string + + // NameIc. + NameIc *string + + // NameIe. + NameIe *string + + // NameIew. + NameIew *string + + // NameIsw. + NameIsw *string + + // Namen. + Namen *string + + // NameNic. + NameNic *string + + // NameNie. + NameNie *string + + // NameNiew. + NameNiew *string + + // NameNisw. + NameNisw *string + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Parent. + Parent *string + + // Parentn. + Parentn *string + + // ParentID. + ParentID *string + + // ParentIDn. + ParentIDn *string + + // Q. + Q *string + + // Slug. + Slug *string + + // SlugEmpty. + SlugEmpty *string + + // SlugIc. + SlugIc *string + + // SlugIe. + SlugIe *string + + // SlugIew. + SlugIew *string + + // SlugIsw. + SlugIsw *string + + // Slugn. + Slugn *string + + // SlugNic. + SlugNic *string + + // SlugNie. + SlugNie *string + + // SlugNiew. + SlugNiew *string + + // SlugNisw. + SlugNisw *string + + // Tag. + Tag *string + + // Tagn. + Tagn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsListParams) WithDefaults() *WirelessWirelessLanGroupsListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreated adds the created to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithCreated(created *string) *WirelessWirelessLanGroupsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithCreatedGte(createdGte *string) *WirelessWirelessLanGroupsListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithCreatedLte(createdLte *string) *WirelessWirelessLanGroupsListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithDescription adds the description to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescription(description *string) *WirelessWirelessLanGroupsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionEmpty(descriptionEmpty *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionIc(descriptionIc *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionIe(descriptionIe *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionIew(descriptionIew *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionIsw(descriptionIsw *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionn(descriptionn *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionNic(descriptionNic *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionNie(descriptionNie *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionNiew(descriptionNiew *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithDescriptionNisw(descriptionNisw *string) *WirelessWirelessLanGroupsListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + +// WithID adds the id to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithID(id *string) *WirelessWirelessLanGroupsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithIDGt(iDGt *string) *WirelessWirelessLanGroupsListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithIDGte(iDGte *string) *WirelessWirelessLanGroupsListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithIDLt(iDLt *string) *WirelessWirelessLanGroupsListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithIDLte(iDLte *string) *WirelessWirelessLanGroupsListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithIDn(iDn *string) *WirelessWirelessLanGroupsListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithLastUpdated(lastUpdated *string) *WirelessWirelessLanGroupsListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithLastUpdatedGte(lastUpdatedGte *string) *WirelessWirelessLanGroupsListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithLastUpdatedLte(lastUpdatedLte *string) *WirelessWirelessLanGroupsListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithLimit(limit *int64) *WirelessWirelessLanGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithName(name *string) *WirelessWirelessLanGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithNameEmpty adds the nameEmpty to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameEmpty(nameEmpty *string) *WirelessWirelessLanGroupsListParams { + o.SetNameEmpty(nameEmpty) + return o +} + +// SetNameEmpty adds the nameEmpty to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameEmpty(nameEmpty *string) { + o.NameEmpty = nameEmpty +} + +// WithNameIc adds the nameIc to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameIc(nameIc *string) *WirelessWirelessLanGroupsListParams { + o.SetNameIc(nameIc) + return o +} + +// SetNameIc adds the nameIc to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameIc(nameIc *string) { + o.NameIc = nameIc +} + +// WithNameIe adds the nameIe to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameIe(nameIe *string) *WirelessWirelessLanGroupsListParams { + o.SetNameIe(nameIe) + return o +} + +// SetNameIe adds the nameIe to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameIe(nameIe *string) { + o.NameIe = nameIe +} + +// WithNameIew adds the nameIew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameIew(nameIew *string) *WirelessWirelessLanGroupsListParams { + o.SetNameIew(nameIew) + return o +} + +// SetNameIew adds the nameIew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameIew(nameIew *string) { + o.NameIew = nameIew +} + +// WithNameIsw adds the nameIsw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameIsw(nameIsw *string) *WirelessWirelessLanGroupsListParams { + o.SetNameIsw(nameIsw) + return o +} + +// SetNameIsw adds the nameIsw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameIsw(nameIsw *string) { + o.NameIsw = nameIsw +} + +// WithNamen adds the namen to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNamen(namen *string) *WirelessWirelessLanGroupsListParams { + o.SetNamen(namen) + return o +} + +// SetNamen adds the nameN to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNamen(namen *string) { + o.Namen = namen +} + +// WithNameNic adds the nameNic to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameNic(nameNic *string) *WirelessWirelessLanGroupsListParams { + o.SetNameNic(nameNic) + return o +} + +// SetNameNic adds the nameNic to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameNic(nameNic *string) { + o.NameNic = nameNic +} + +// WithNameNie adds the nameNie to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameNie(nameNie *string) *WirelessWirelessLanGroupsListParams { + o.SetNameNie(nameNie) + return o +} + +// SetNameNie adds the nameNie to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameNie(nameNie *string) { + o.NameNie = nameNie +} + +// WithNameNiew adds the nameNiew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameNiew(nameNiew *string) *WirelessWirelessLanGroupsListParams { + o.SetNameNiew(nameNiew) + return o +} + +// SetNameNiew adds the nameNiew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameNiew(nameNiew *string) { + o.NameNiew = nameNiew +} + +// WithNameNisw adds the nameNisw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithNameNisw(nameNisw *string) *WirelessWirelessLanGroupsListParams { + o.SetNameNisw(nameNisw) + return o +} + +// SetNameNisw adds the nameNisw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetNameNisw(nameNisw *string) { + o.NameNisw = nameNisw +} + +// WithOffset adds the offset to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithOffset(offset *int64) *WirelessWirelessLanGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParent adds the parent to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithParent(parent *string) *WirelessWirelessLanGroupsListParams { + o.SetParent(parent) + return o +} + +// SetParent adds the parent to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetParent(parent *string) { + o.Parent = parent +} + +// WithParentn adds the parentn to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithParentn(parentn *string) *WirelessWirelessLanGroupsListParams { + o.SetParentn(parentn) + return o +} + +// SetParentn adds the parentN to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetParentn(parentn *string) { + o.Parentn = parentn +} + +// WithParentID adds the parentID to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithParentID(parentID *string) *WirelessWirelessLanGroupsListParams { + o.SetParentID(parentID) + return o +} + +// SetParentID adds the parentId to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetParentID(parentID *string) { + o.ParentID = parentID +} + +// WithParentIDn adds the parentIDn to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithParentIDn(parentIDn *string) *WirelessWirelessLanGroupsListParams { + o.SetParentIDn(parentIDn) + return o +} + +// SetParentIDn adds the parentIdN to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetParentIDn(parentIDn *string) { + o.ParentIDn = parentIDn +} + +// WithQ adds the q to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithQ(q *string) *WirelessWirelessLanGroupsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlug(slug *string) *WirelessWirelessLanGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithSlugEmpty adds the slugEmpty to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugEmpty(slugEmpty *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugEmpty(slugEmpty) + return o +} + +// SetSlugEmpty adds the slugEmpty to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugEmpty(slugEmpty *string) { + o.SlugEmpty = slugEmpty +} + +// WithSlugIc adds the slugIc to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugIc(slugIc *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugIc(slugIc) + return o +} + +// SetSlugIc adds the slugIc to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugIc(slugIc *string) { + o.SlugIc = slugIc +} + +// WithSlugIe adds the slugIe to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugIe(slugIe *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugIe(slugIe) + return o +} + +// SetSlugIe adds the slugIe to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugIe(slugIe *string) { + o.SlugIe = slugIe +} + +// WithSlugIew adds the slugIew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugIew(slugIew *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugIew(slugIew) + return o +} + +// SetSlugIew adds the slugIew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugIew(slugIew *string) { + o.SlugIew = slugIew +} + +// WithSlugIsw adds the slugIsw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugIsw(slugIsw *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugIsw(slugIsw) + return o +} + +// SetSlugIsw adds the slugIsw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugIsw(slugIsw *string) { + o.SlugIsw = slugIsw +} + +// WithSlugn adds the slugn to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugn(slugn *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugn(slugn) + return o +} + +// SetSlugn adds the slugN to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugn(slugn *string) { + o.Slugn = slugn +} + +// WithSlugNic adds the slugNic to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugNic(slugNic *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugNic(slugNic) + return o +} + +// SetSlugNic adds the slugNic to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugNic(slugNic *string) { + o.SlugNic = slugNic +} + +// WithSlugNie adds the slugNie to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugNie(slugNie *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugNie(slugNie) + return o +} + +// SetSlugNie adds the slugNie to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugNie(slugNie *string) { + o.SlugNie = slugNie +} + +// WithSlugNiew adds the slugNiew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugNiew(slugNiew *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugNiew(slugNiew) + return o +} + +// SetSlugNiew adds the slugNiew to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugNiew(slugNiew *string) { + o.SlugNiew = slugNiew +} + +// WithSlugNisw adds the slugNisw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithSlugNisw(slugNisw *string) *WirelessWirelessLanGroupsListParams { + o.SetSlugNisw(slugNisw) + return o +} + +// SetSlugNisw adds the slugNisw to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetSlugNisw(slugNisw *string) { + o.SlugNisw = slugNisw +} + +// WithTag adds the tag to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithTag(tag *string) *WirelessWirelessLanGroupsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) WithTagn(tagn *string) *WirelessWirelessLanGroupsListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the wireless wireless lan groups list params +func (o *WirelessWirelessLanGroupsListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Name != nil { + + // query param name + var qrName string + + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + } + + if o.NameEmpty != nil { + + // query param name__empty + var qrNameEmpty string + + if o.NameEmpty != nil { + qrNameEmpty = *o.NameEmpty + } + qNameEmpty := qrNameEmpty + if qNameEmpty != "" { + + if err := r.SetQueryParam("name__empty", qNameEmpty); err != nil { + return err + } + } + } + + if o.NameIc != nil { + + // query param name__ic + var qrNameIc string + + if o.NameIc != nil { + qrNameIc = *o.NameIc + } + qNameIc := qrNameIc + if qNameIc != "" { + + if err := r.SetQueryParam("name__ic", qNameIc); err != nil { + return err + } + } + } + + if o.NameIe != nil { + + // query param name__ie + var qrNameIe string + + if o.NameIe != nil { + qrNameIe = *o.NameIe + } + qNameIe := qrNameIe + if qNameIe != "" { + + if err := r.SetQueryParam("name__ie", qNameIe); err != nil { + return err + } + } + } + + if o.NameIew != nil { + + // query param name__iew + var qrNameIew string + + if o.NameIew != nil { + qrNameIew = *o.NameIew + } + qNameIew := qrNameIew + if qNameIew != "" { + + if err := r.SetQueryParam("name__iew", qNameIew); err != nil { + return err + } + } + } + + if o.NameIsw != nil { + + // query param name__isw + var qrNameIsw string + + if o.NameIsw != nil { + qrNameIsw = *o.NameIsw + } + qNameIsw := qrNameIsw + if qNameIsw != "" { + + if err := r.SetQueryParam("name__isw", qNameIsw); err != nil { + return err + } + } + } + + if o.Namen != nil { + + // query param name__n + var qrNamen string + + if o.Namen != nil { + qrNamen = *o.Namen + } + qNamen := qrNamen + if qNamen != "" { + + if err := r.SetQueryParam("name__n", qNamen); err != nil { + return err + } + } + } + + if o.NameNic != nil { + + // query param name__nic + var qrNameNic string + + if o.NameNic != nil { + qrNameNic = *o.NameNic + } + qNameNic := qrNameNic + if qNameNic != "" { + + if err := r.SetQueryParam("name__nic", qNameNic); err != nil { + return err + } + } + } + + if o.NameNie != nil { + + // query param name__nie + var qrNameNie string + + if o.NameNie != nil { + qrNameNie = *o.NameNie + } + qNameNie := qrNameNie + if qNameNie != "" { + + if err := r.SetQueryParam("name__nie", qNameNie); err != nil { + return err + } + } + } + + if o.NameNiew != nil { + + // query param name__niew + var qrNameNiew string + + if o.NameNiew != nil { + qrNameNiew = *o.NameNiew + } + qNameNiew := qrNameNiew + if qNameNiew != "" { + + if err := r.SetQueryParam("name__niew", qNameNiew); err != nil { + return err + } + } + } + + if o.NameNisw != nil { + + // query param name__nisw + var qrNameNisw string + + if o.NameNisw != nil { + qrNameNisw = *o.NameNisw + } + qNameNisw := qrNameNisw + if qNameNisw != "" { + + if err := r.SetQueryParam("name__nisw", qNameNisw); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Parent != nil { + + // query param parent + var qrParent string + + if o.Parent != nil { + qrParent = *o.Parent + } + qParent := qrParent + if qParent != "" { + + if err := r.SetQueryParam("parent", qParent); err != nil { + return err + } + } + } + + if o.Parentn != nil { + + // query param parent__n + var qrParentn string + + if o.Parentn != nil { + qrParentn = *o.Parentn + } + qParentn := qrParentn + if qParentn != "" { + + if err := r.SetQueryParam("parent__n", qParentn); err != nil { + return err + } + } + } + + if o.ParentID != nil { + + // query param parent_id + var qrParentID string + + if o.ParentID != nil { + qrParentID = *o.ParentID + } + qParentID := qrParentID + if qParentID != "" { + + if err := r.SetQueryParam("parent_id", qParentID); err != nil { + return err + } + } + } + + if o.ParentIDn != nil { + + // query param parent_id__n + var qrParentIDn string + + if o.ParentIDn != nil { + qrParentIDn = *o.ParentIDn + } + qParentIDn := qrParentIDn + if qParentIDn != "" { + + if err := r.SetQueryParam("parent_id__n", qParentIDn); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + } + + if o.SlugEmpty != nil { + + // query param slug__empty + var qrSlugEmpty string + + if o.SlugEmpty != nil { + qrSlugEmpty = *o.SlugEmpty + } + qSlugEmpty := qrSlugEmpty + if qSlugEmpty != "" { + + if err := r.SetQueryParam("slug__empty", qSlugEmpty); err != nil { + return err + } + } + } + + if o.SlugIc != nil { + + // query param slug__ic + var qrSlugIc string + + if o.SlugIc != nil { + qrSlugIc = *o.SlugIc + } + qSlugIc := qrSlugIc + if qSlugIc != "" { + + if err := r.SetQueryParam("slug__ic", qSlugIc); err != nil { + return err + } + } + } + + if o.SlugIe != nil { + + // query param slug__ie + var qrSlugIe string + + if o.SlugIe != nil { + qrSlugIe = *o.SlugIe + } + qSlugIe := qrSlugIe + if qSlugIe != "" { + + if err := r.SetQueryParam("slug__ie", qSlugIe); err != nil { + return err + } + } + } + + if o.SlugIew != nil { + + // query param slug__iew + var qrSlugIew string + + if o.SlugIew != nil { + qrSlugIew = *o.SlugIew + } + qSlugIew := qrSlugIew + if qSlugIew != "" { + + if err := r.SetQueryParam("slug__iew", qSlugIew); err != nil { + return err + } + } + } + + if o.SlugIsw != nil { + + // query param slug__isw + var qrSlugIsw string + + if o.SlugIsw != nil { + qrSlugIsw = *o.SlugIsw + } + qSlugIsw := qrSlugIsw + if qSlugIsw != "" { + + if err := r.SetQueryParam("slug__isw", qSlugIsw); err != nil { + return err + } + } + } + + if o.Slugn != nil { + + // query param slug__n + var qrSlugn string + + if o.Slugn != nil { + qrSlugn = *o.Slugn + } + qSlugn := qrSlugn + if qSlugn != "" { + + if err := r.SetQueryParam("slug__n", qSlugn); err != nil { + return err + } + } + } + + if o.SlugNic != nil { + + // query param slug__nic + var qrSlugNic string + + if o.SlugNic != nil { + qrSlugNic = *o.SlugNic + } + qSlugNic := qrSlugNic + if qSlugNic != "" { + + if err := r.SetQueryParam("slug__nic", qSlugNic); err != nil { + return err + } + } + } + + if o.SlugNie != nil { + + // query param slug__nie + var qrSlugNie string + + if o.SlugNie != nil { + qrSlugNie = *o.SlugNie + } + qSlugNie := qrSlugNie + if qSlugNie != "" { + + if err := r.SetQueryParam("slug__nie", qSlugNie); err != nil { + return err + } + } + } + + if o.SlugNiew != nil { + + // query param slug__niew + var qrSlugNiew string + + if o.SlugNiew != nil { + qrSlugNiew = *o.SlugNiew + } + qSlugNiew := qrSlugNiew + if qSlugNiew != "" { + + if err := r.SetQueryParam("slug__niew", qSlugNiew); err != nil { + return err + } + } + } + + if o.SlugNisw != nil { + + // query param slug__nisw + var qrSlugNisw string + + if o.SlugNisw != nil { + qrSlugNisw = *o.SlugNisw + } + qSlugNisw := qrSlugNisw + if qSlugNisw != "" { + + if err := r.SetQueryParam("slug__nisw", qSlugNisw); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_responses.go new file mode 100644 index 000000000..ef3a705b2 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLanGroupsListReader is a Reader for the WirelessWirelessLanGroupsList structure. +type WirelessWirelessLanGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLanGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsListOK creates a WirelessWirelessLanGroupsListOK with default headers values +func NewWirelessWirelessLanGroupsListOK() *WirelessWirelessLanGroupsListOK { + return &WirelessWirelessLanGroupsListOK{} +} + +/* WirelessWirelessLanGroupsListOK describes a response with status code 200, with default header values. + +WirelessWirelessLanGroupsListOK wireless wireless lan groups list o k +*/ +type WirelessWirelessLanGroupsListOK struct { + Payload *WirelessWirelessLanGroupsListOKBody +} + +func (o *WirelessWirelessLanGroupsListOK) Error() string { + return fmt.Sprintf("[GET /wireless/wireless-lan-groups/][%d] wirelessWirelessLanGroupsListOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLanGroupsListOK) GetPayload() *WirelessWirelessLanGroupsListOKBody { + return o.Payload +} + +func (o *WirelessWirelessLanGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(WirelessWirelessLanGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*WirelessWirelessLanGroupsListOKBody wireless wireless lan groups list o k body +swagger:model WirelessWirelessLanGroupsListOKBody +*/ +type WirelessWirelessLanGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.WirelessLANGroup `json:"results"` +} + +// Validate validates this wireless wireless lan groups list o k body +func (o *WirelessWirelessLanGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *WirelessWirelessLanGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("wirelessWirelessLanGroupsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLanGroupsListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("wirelessWirelessLanGroupsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLanGroupsListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("wirelessWirelessLanGroupsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLanGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("wirelessWirelessLanGroupsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wirelessWirelessLanGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wirelessWirelessLanGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this wireless wireless lan groups list o k body based on the context it is used +func (o *WirelessWirelessLanGroupsListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *WirelessWirelessLanGroupsListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wirelessWirelessLanGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wirelessWirelessLanGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *WirelessWirelessLanGroupsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *WirelessWirelessLanGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res WirelessWirelessLanGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_parameters.go new file mode 100644 index 000000000..391ac62ce --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLanGroupsPartialUpdateParams creates a new WirelessWirelessLanGroupsPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsPartialUpdateParams() *WirelessWirelessLanGroupsPartialUpdateParams { + return &WirelessWirelessLanGroupsPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsPartialUpdateParamsWithTimeout creates a new WirelessWirelessLanGroupsPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsPartialUpdateParams { + return &WirelessWirelessLanGroupsPartialUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsPartialUpdateParamsWithContext creates a new WirelessWirelessLanGroupsPartialUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsPartialUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsPartialUpdateParams { + return &WirelessWirelessLanGroupsPartialUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsPartialUpdateParamsWithHTTPClient creates a new WirelessWirelessLanGroupsPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsPartialUpdateParams { + return &WirelessWirelessLanGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsPartialUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups partial update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsPartialUpdateParams struct { + + // Data. + Data *models.WritableWirelessLANGroup + + /* ID. + + A unique integer value identifying this Wireless LAN Group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsPartialUpdateParams) WithDefaults() *WirelessWirelessLanGroupsPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) WithData(data *models.WritableWirelessLANGroup) *WirelessWirelessLanGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) SetData(data *models.WritableWirelessLANGroup) { + o.Data = data +} + +// WithID adds the id to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) WithID(id int64) *WirelessWirelessLanGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lan groups partial update params +func (o *WirelessWirelessLanGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_responses.go new file mode 100644 index 000000000..863bdfd51 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLanGroupsPartialUpdateReader is a Reader for the WirelessWirelessLanGroupsPartialUpdate structure. +type WirelessWirelessLanGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLanGroupsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsPartialUpdateOK creates a WirelessWirelessLanGroupsPartialUpdateOK with default headers values +func NewWirelessWirelessLanGroupsPartialUpdateOK() *WirelessWirelessLanGroupsPartialUpdateOK { + return &WirelessWirelessLanGroupsPartialUpdateOK{} +} + +/* WirelessWirelessLanGroupsPartialUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLanGroupsPartialUpdateOK wireless wireless lan groups partial update o k +*/ +type WirelessWirelessLanGroupsPartialUpdateOK struct { + Payload *models.WirelessLANGroup +} + +func (o *WirelessWirelessLanGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /wireless/wireless-lan-groups/{id}/][%d] wirelessWirelessLanGroupsPartialUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLanGroupsPartialUpdateOK) GetPayload() *models.WirelessLANGroup { + return o.Payload +} + +func (o *WirelessWirelessLanGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_parameters.go new file mode 100644 index 000000000..97ae5d59d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLanGroupsReadParams creates a new WirelessWirelessLanGroupsReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsReadParams() *WirelessWirelessLanGroupsReadParams { + return &WirelessWirelessLanGroupsReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsReadParamsWithTimeout creates a new WirelessWirelessLanGroupsReadParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsReadParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsReadParams { + return &WirelessWirelessLanGroupsReadParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsReadParamsWithContext creates a new WirelessWirelessLanGroupsReadParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsReadParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsReadParams { + return &WirelessWirelessLanGroupsReadParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsReadParamsWithHTTPClient creates a new WirelessWirelessLanGroupsReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsReadParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsReadParams { + return &WirelessWirelessLanGroupsReadParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsReadParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups read operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsReadParams struct { + + /* ID. + + A unique integer value identifying this Wireless LAN Group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsReadParams) WithDefaults() *WirelessWirelessLanGroupsReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) WithID(id int64) *WirelessWirelessLanGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lan groups read params +func (o *WirelessWirelessLanGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_responses.go new file mode 100644 index 000000000..676f3ff06 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLanGroupsReadReader is a Reader for the WirelessWirelessLanGroupsRead structure. +type WirelessWirelessLanGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLanGroupsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsReadOK creates a WirelessWirelessLanGroupsReadOK with default headers values +func NewWirelessWirelessLanGroupsReadOK() *WirelessWirelessLanGroupsReadOK { + return &WirelessWirelessLanGroupsReadOK{} +} + +/* WirelessWirelessLanGroupsReadOK describes a response with status code 200, with default header values. + +WirelessWirelessLanGroupsReadOK wireless wireless lan groups read o k +*/ +type WirelessWirelessLanGroupsReadOK struct { + Payload *models.WirelessLANGroup +} + +func (o *WirelessWirelessLanGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /wireless/wireless-lan-groups/{id}/][%d] wirelessWirelessLanGroupsReadOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLanGroupsReadOK) GetPayload() *models.WirelessLANGroup { + return o.Payload +} + +func (o *WirelessWirelessLanGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_parameters.go new file mode 100644 index 000000000..198c413b2 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLanGroupsUpdateParams creates a new WirelessWirelessLanGroupsUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLanGroupsUpdateParams() *WirelessWirelessLanGroupsUpdateParams { + return &WirelessWirelessLanGroupsUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLanGroupsUpdateParamsWithTimeout creates a new WirelessWirelessLanGroupsUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLanGroupsUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsUpdateParams { + return &WirelessWirelessLanGroupsUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLanGroupsUpdateParamsWithContext creates a new WirelessWirelessLanGroupsUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLanGroupsUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLanGroupsUpdateParams { + return &WirelessWirelessLanGroupsUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLanGroupsUpdateParamsWithHTTPClient creates a new WirelessWirelessLanGroupsUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLanGroupsUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsUpdateParams { + return &WirelessWirelessLanGroupsUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLanGroupsUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lan groups update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLanGroupsUpdateParams struct { + + // Data. + Data *models.WritableWirelessLANGroup + + /* ID. + + A unique integer value identifying this Wireless LAN Group. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lan groups update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsUpdateParams) WithDefaults() *WirelessWirelessLanGroupsUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lan groups update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLanGroupsUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLanGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLanGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLanGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) WithData(data *models.WritableWirelessLANGroup) *WirelessWirelessLanGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) SetData(data *models.WritableWirelessLANGroup) { + o.Data = data +} + +// WithID adds the id to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) WithID(id int64) *WirelessWirelessLanGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lan groups update params +func (o *WirelessWirelessLanGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLanGroupsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_responses.go new file mode 100644 index 000000000..09ed0c060 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lan_groups_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLanGroupsUpdateReader is a Reader for the WirelessWirelessLanGroupsUpdate structure. +type WirelessWirelessLanGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLanGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLanGroupsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLanGroupsUpdateOK creates a WirelessWirelessLanGroupsUpdateOK with default headers values +func NewWirelessWirelessLanGroupsUpdateOK() *WirelessWirelessLanGroupsUpdateOK { + return &WirelessWirelessLanGroupsUpdateOK{} +} + +/* WirelessWirelessLanGroupsUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLanGroupsUpdateOK wireless wireless lan groups update o k +*/ +type WirelessWirelessLanGroupsUpdateOK struct { + Payload *models.WirelessLANGroup +} + +func (o *WirelessWirelessLanGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /wireless/wireless-lan-groups/{id}/][%d] wirelessWirelessLanGroupsUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLanGroupsUpdateOK) GetPayload() *models.WirelessLANGroup { + return o.Payload +} + +func (o *WirelessWirelessLanGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_parameters.go new file mode 100644 index 000000000..9c1248d69 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewWirelessWirelessLansBulkDeleteParams creates a new WirelessWirelessLansBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansBulkDeleteParams() *WirelessWirelessLansBulkDeleteParams { + return &WirelessWirelessLansBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansBulkDeleteParamsWithTimeout creates a new WirelessWirelessLansBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansBulkDeleteParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansBulkDeleteParams { + return &WirelessWirelessLansBulkDeleteParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansBulkDeleteParamsWithContext creates a new WirelessWirelessLansBulkDeleteParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansBulkDeleteParamsWithContext(ctx context.Context) *WirelessWirelessLansBulkDeleteParams { + return &WirelessWirelessLansBulkDeleteParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansBulkDeleteParamsWithHTTPClient creates a new WirelessWirelessLansBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansBulkDeleteParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansBulkDeleteParams { + return &WirelessWirelessLansBulkDeleteParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansBulkDeleteParams contains all the parameters to send to the API endpoint + for the wireless wireless lans bulk delete operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansBulkDeleteParams) WithDefaults() *WirelessWirelessLansBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans bulk delete params +func (o *WirelessWirelessLansBulkDeleteParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans bulk delete params +func (o *WirelessWirelessLansBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans bulk delete params +func (o *WirelessWirelessLansBulkDeleteParams) WithContext(ctx context.Context) *WirelessWirelessLansBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans bulk delete params +func (o *WirelessWirelessLansBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans bulk delete params +func (o *WirelessWirelessLansBulkDeleteParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans bulk delete params +func (o *WirelessWirelessLansBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_responses.go new file mode 100644 index 000000000..36d25d7ce --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// WirelessWirelessLansBulkDeleteReader is a Reader for the WirelessWirelessLansBulkDelete structure. +type WirelessWirelessLansBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewWirelessWirelessLansBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansBulkDeleteNoContent creates a WirelessWirelessLansBulkDeleteNoContent with default headers values +func NewWirelessWirelessLansBulkDeleteNoContent() *WirelessWirelessLansBulkDeleteNoContent { + return &WirelessWirelessLansBulkDeleteNoContent{} +} + +/* WirelessWirelessLansBulkDeleteNoContent describes a response with status code 204, with default header values. + +WirelessWirelessLansBulkDeleteNoContent wireless wireless lans bulk delete no content +*/ +type WirelessWirelessLansBulkDeleteNoContent struct { +} + +func (o *WirelessWirelessLansBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /wireless/wireless-lans/][%d] wirelessWirelessLansBulkDeleteNoContent ", 204) +} + +func (o *WirelessWirelessLansBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_parameters.go new file mode 100644 index 000000000..4aaa37c5f --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLansBulkPartialUpdateParams creates a new WirelessWirelessLansBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansBulkPartialUpdateParams() *WirelessWirelessLansBulkPartialUpdateParams { + return &WirelessWirelessLansBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansBulkPartialUpdateParamsWithTimeout creates a new WirelessWirelessLansBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansBulkPartialUpdateParams { + return &WirelessWirelessLansBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansBulkPartialUpdateParamsWithContext creates a new WirelessWirelessLansBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansBulkPartialUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLansBulkPartialUpdateParams { + return &WirelessWirelessLansBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansBulkPartialUpdateParamsWithHTTPClient creates a new WirelessWirelessLansBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansBulkPartialUpdateParams { + return &WirelessWirelessLansBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lans bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableWirelessLAN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansBulkPartialUpdateParams) WithDefaults() *WirelessWirelessLansBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLansBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) WithData(data *models.WritableWirelessLAN) *WirelessWirelessLansBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lans bulk partial update params +func (o *WirelessWirelessLansBulkPartialUpdateParams) SetData(data *models.WritableWirelessLAN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_responses.go new file mode 100644 index 000000000..1829db3c2 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLansBulkPartialUpdateReader is a Reader for the WirelessWirelessLansBulkPartialUpdate structure. +type WirelessWirelessLansBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLansBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansBulkPartialUpdateOK creates a WirelessWirelessLansBulkPartialUpdateOK with default headers values +func NewWirelessWirelessLansBulkPartialUpdateOK() *WirelessWirelessLansBulkPartialUpdateOK { + return &WirelessWirelessLansBulkPartialUpdateOK{} +} + +/* WirelessWirelessLansBulkPartialUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLansBulkPartialUpdateOK wireless wireless lans bulk partial update o k +*/ +type WirelessWirelessLansBulkPartialUpdateOK struct { + Payload *models.WirelessLAN +} + +func (o *WirelessWirelessLansBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /wireless/wireless-lans/][%d] wirelessWirelessLansBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLansBulkPartialUpdateOK) GetPayload() *models.WirelessLAN { + return o.Payload +} + +func (o *WirelessWirelessLansBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_parameters.go new file mode 100644 index 000000000..c80b27b22 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLansBulkUpdateParams creates a new WirelessWirelessLansBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansBulkUpdateParams() *WirelessWirelessLansBulkUpdateParams { + return &WirelessWirelessLansBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansBulkUpdateParamsWithTimeout creates a new WirelessWirelessLansBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansBulkUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansBulkUpdateParams { + return &WirelessWirelessLansBulkUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansBulkUpdateParamsWithContext creates a new WirelessWirelessLansBulkUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansBulkUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLansBulkUpdateParams { + return &WirelessWirelessLansBulkUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansBulkUpdateParamsWithHTTPClient creates a new WirelessWirelessLansBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansBulkUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansBulkUpdateParams { + return &WirelessWirelessLansBulkUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansBulkUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lans bulk update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansBulkUpdateParams struct { + + // Data. + Data *models.WritableWirelessLAN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansBulkUpdateParams) WithDefaults() *WirelessWirelessLansBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLansBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) WithData(data *models.WritableWirelessLAN) *WirelessWirelessLansBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lans bulk update params +func (o *WirelessWirelessLansBulkUpdateParams) SetData(data *models.WritableWirelessLAN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_responses.go new file mode 100644 index 000000000..5dbffdb8d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLansBulkUpdateReader is a Reader for the WirelessWirelessLansBulkUpdate structure. +type WirelessWirelessLansBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLansBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansBulkUpdateOK creates a WirelessWirelessLansBulkUpdateOK with default headers values +func NewWirelessWirelessLansBulkUpdateOK() *WirelessWirelessLansBulkUpdateOK { + return &WirelessWirelessLansBulkUpdateOK{} +} + +/* WirelessWirelessLansBulkUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLansBulkUpdateOK wireless wireless lans bulk update o k +*/ +type WirelessWirelessLansBulkUpdateOK struct { + Payload *models.WirelessLAN +} + +func (o *WirelessWirelessLansBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /wireless/wireless-lans/][%d] wirelessWirelessLansBulkUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLansBulkUpdateOK) GetPayload() *models.WirelessLAN { + return o.Payload +} + +func (o *WirelessWirelessLansBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_parameters.go new file mode 100644 index 000000000..c60786cfa --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLansCreateParams creates a new WirelessWirelessLansCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansCreateParams() *WirelessWirelessLansCreateParams { + return &WirelessWirelessLansCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansCreateParamsWithTimeout creates a new WirelessWirelessLansCreateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansCreateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansCreateParams { + return &WirelessWirelessLansCreateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansCreateParamsWithContext creates a new WirelessWirelessLansCreateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansCreateParamsWithContext(ctx context.Context) *WirelessWirelessLansCreateParams { + return &WirelessWirelessLansCreateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansCreateParamsWithHTTPClient creates a new WirelessWirelessLansCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansCreateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansCreateParams { + return &WirelessWirelessLansCreateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansCreateParams contains all the parameters to send to the API endpoint + for the wireless wireless lans create operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansCreateParams struct { + + // Data. + Data *models.WritableWirelessLAN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansCreateParams) WithDefaults() *WirelessWirelessLansCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) WithContext(ctx context.Context) *WirelessWirelessLansCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) WithData(data *models.WritableWirelessLAN) *WirelessWirelessLansCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lans create params +func (o *WirelessWirelessLansCreateParams) SetData(data *models.WritableWirelessLAN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_responses.go new file mode 100644 index 000000000..93e5c5648 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLansCreateReader is a Reader for the WirelessWirelessLansCreate structure. +type WirelessWirelessLansCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewWirelessWirelessLansCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansCreateCreated creates a WirelessWirelessLansCreateCreated with default headers values +func NewWirelessWirelessLansCreateCreated() *WirelessWirelessLansCreateCreated { + return &WirelessWirelessLansCreateCreated{} +} + +/* WirelessWirelessLansCreateCreated describes a response with status code 201, with default header values. + +WirelessWirelessLansCreateCreated wireless wireless lans create created +*/ +type WirelessWirelessLansCreateCreated struct { + Payload *models.WirelessLAN +} + +func (o *WirelessWirelessLansCreateCreated) Error() string { + return fmt.Sprintf("[POST /wireless/wireless-lans/][%d] wirelessWirelessLansCreateCreated %+v", 201, o.Payload) +} +func (o *WirelessWirelessLansCreateCreated) GetPayload() *models.WirelessLAN { + return o.Payload +} + +func (o *WirelessWirelessLansCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_parameters.go new file mode 100644 index 000000000..772cabbe4 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLansDeleteParams creates a new WirelessWirelessLansDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansDeleteParams() *WirelessWirelessLansDeleteParams { + return &WirelessWirelessLansDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansDeleteParamsWithTimeout creates a new WirelessWirelessLansDeleteParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansDeleteParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansDeleteParams { + return &WirelessWirelessLansDeleteParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansDeleteParamsWithContext creates a new WirelessWirelessLansDeleteParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansDeleteParamsWithContext(ctx context.Context) *WirelessWirelessLansDeleteParams { + return &WirelessWirelessLansDeleteParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansDeleteParamsWithHTTPClient creates a new WirelessWirelessLansDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansDeleteParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansDeleteParams { + return &WirelessWirelessLansDeleteParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansDeleteParams contains all the parameters to send to the API endpoint + for the wireless wireless lans delete operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansDeleteParams struct { + + /* ID. + + A unique integer value identifying this Wireless LAN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansDeleteParams) WithDefaults() *WirelessWirelessLansDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) WithContext(ctx context.Context) *WirelessWirelessLansDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) WithID(id int64) *WirelessWirelessLansDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lans delete params +func (o *WirelessWirelessLansDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_responses.go new file mode 100644 index 000000000..2735e2c4e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// WirelessWirelessLansDeleteReader is a Reader for the WirelessWirelessLansDelete structure. +type WirelessWirelessLansDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewWirelessWirelessLansDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansDeleteNoContent creates a WirelessWirelessLansDeleteNoContent with default headers values +func NewWirelessWirelessLansDeleteNoContent() *WirelessWirelessLansDeleteNoContent { + return &WirelessWirelessLansDeleteNoContent{} +} + +/* WirelessWirelessLansDeleteNoContent describes a response with status code 204, with default header values. + +WirelessWirelessLansDeleteNoContent wireless wireless lans delete no content +*/ +type WirelessWirelessLansDeleteNoContent struct { +} + +func (o *WirelessWirelessLansDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /wireless/wireless-lans/{id}/][%d] wirelessWirelessLansDeleteNoContent ", 204) +} + +func (o *WirelessWirelessLansDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_parameters.go new file mode 100644 index 000000000..6a3f2cd9c --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_parameters.go @@ -0,0 +1,2009 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLansListParams creates a new WirelessWirelessLansListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansListParams() *WirelessWirelessLansListParams { + return &WirelessWirelessLansListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansListParamsWithTimeout creates a new WirelessWirelessLansListParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansListParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansListParams { + return &WirelessWirelessLansListParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansListParamsWithContext creates a new WirelessWirelessLansListParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansListParamsWithContext(ctx context.Context) *WirelessWirelessLansListParams { + return &WirelessWirelessLansListParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansListParamsWithHTTPClient creates a new WirelessWirelessLansListParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansListParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansListParams { + return &WirelessWirelessLansListParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansListParams contains all the parameters to send to the API endpoint + for the wireless wireless lans list operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansListParams struct { + + // AuthCipher. + AuthCipher *string + + // AuthCiphern. + AuthCiphern *string + + // AuthPsk. + AuthPsk *string + + // AuthPskEmpty. + AuthPskEmpty *string + + // AuthPskIc. + AuthPskIc *string + + // AuthPskIe. + AuthPskIe *string + + // AuthPskIew. + AuthPskIew *string + + // AuthPskIsw. + AuthPskIsw *string + + // AuthPskn. + AuthPskn *string + + // AuthPskNic. + AuthPskNic *string + + // AuthPskNie. + AuthPskNie *string + + // AuthPskNiew. + AuthPskNiew *string + + // AuthPskNisw. + AuthPskNisw *string + + // AuthType. + AuthType *string + + // AuthTypen. + AuthTypen *string + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + + // Group. + Group *string + + // Groupn. + Groupn *string + + // GroupID. + GroupID *string + + // GroupIDn. + GroupIDn *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Q. + Q *string + + // Ssid. + Ssid *string + + // SsidEmpty. + SsidEmpty *string + + // SsidIc. + SsidIc *string + + // SsidIe. + SsidIe *string + + // SsidIew. + SsidIew *string + + // SsidIsw. + SsidIsw *string + + // Ssidn. + Ssidn *string + + // SsidNic. + SsidNic *string + + // SsidNie. + SsidNie *string + + // SsidNiew. + SsidNiew *string + + // SsidNisw. + SsidNisw *string + + // Tag. + Tag *string + + // Tagn. + Tagn *string + + // VlanID. + VlanID *string + + // VlanIDn. + VlanIDn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansListParams) WithDefaults() *WirelessWirelessLansListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithContext(ctx context.Context) *WirelessWirelessLansListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthCipher adds the authCipher to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthCipher(authCipher *string) *WirelessWirelessLansListParams { + o.SetAuthCipher(authCipher) + return o +} + +// SetAuthCipher adds the authCipher to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthCipher(authCipher *string) { + o.AuthCipher = authCipher +} + +// WithAuthCiphern adds the authCiphern to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthCiphern(authCiphern *string) *WirelessWirelessLansListParams { + o.SetAuthCiphern(authCiphern) + return o +} + +// SetAuthCiphern adds the authCipherN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthCiphern(authCiphern *string) { + o.AuthCiphern = authCiphern +} + +// WithAuthPsk adds the authPsk to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPsk(authPsk *string) *WirelessWirelessLansListParams { + o.SetAuthPsk(authPsk) + return o +} + +// SetAuthPsk adds the authPsk to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPsk(authPsk *string) { + o.AuthPsk = authPsk +} + +// WithAuthPskEmpty adds the authPskEmpty to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskEmpty(authPskEmpty *string) *WirelessWirelessLansListParams { + o.SetAuthPskEmpty(authPskEmpty) + return o +} + +// SetAuthPskEmpty adds the authPskEmpty to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskEmpty(authPskEmpty *string) { + o.AuthPskEmpty = authPskEmpty +} + +// WithAuthPskIc adds the authPskIc to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskIc(authPskIc *string) *WirelessWirelessLansListParams { + o.SetAuthPskIc(authPskIc) + return o +} + +// SetAuthPskIc adds the authPskIc to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskIc(authPskIc *string) { + o.AuthPskIc = authPskIc +} + +// WithAuthPskIe adds the authPskIe to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskIe(authPskIe *string) *WirelessWirelessLansListParams { + o.SetAuthPskIe(authPskIe) + return o +} + +// SetAuthPskIe adds the authPskIe to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskIe(authPskIe *string) { + o.AuthPskIe = authPskIe +} + +// WithAuthPskIew adds the authPskIew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskIew(authPskIew *string) *WirelessWirelessLansListParams { + o.SetAuthPskIew(authPskIew) + return o +} + +// SetAuthPskIew adds the authPskIew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskIew(authPskIew *string) { + o.AuthPskIew = authPskIew +} + +// WithAuthPskIsw adds the authPskIsw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskIsw(authPskIsw *string) *WirelessWirelessLansListParams { + o.SetAuthPskIsw(authPskIsw) + return o +} + +// SetAuthPskIsw adds the authPskIsw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskIsw(authPskIsw *string) { + o.AuthPskIsw = authPskIsw +} + +// WithAuthPskn adds the authPskn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskn(authPskn *string) *WirelessWirelessLansListParams { + o.SetAuthPskn(authPskn) + return o +} + +// SetAuthPskn adds the authPskN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskn(authPskn *string) { + o.AuthPskn = authPskn +} + +// WithAuthPskNic adds the authPskNic to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskNic(authPskNic *string) *WirelessWirelessLansListParams { + o.SetAuthPskNic(authPskNic) + return o +} + +// SetAuthPskNic adds the authPskNic to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskNic(authPskNic *string) { + o.AuthPskNic = authPskNic +} + +// WithAuthPskNie adds the authPskNie to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskNie(authPskNie *string) *WirelessWirelessLansListParams { + o.SetAuthPskNie(authPskNie) + return o +} + +// SetAuthPskNie adds the authPskNie to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskNie(authPskNie *string) { + o.AuthPskNie = authPskNie +} + +// WithAuthPskNiew adds the authPskNiew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskNiew(authPskNiew *string) *WirelessWirelessLansListParams { + o.SetAuthPskNiew(authPskNiew) + return o +} + +// SetAuthPskNiew adds the authPskNiew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskNiew(authPskNiew *string) { + o.AuthPskNiew = authPskNiew +} + +// WithAuthPskNisw adds the authPskNisw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthPskNisw(authPskNisw *string) *WirelessWirelessLansListParams { + o.SetAuthPskNisw(authPskNisw) + return o +} + +// SetAuthPskNisw adds the authPskNisw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthPskNisw(authPskNisw *string) { + o.AuthPskNisw = authPskNisw +} + +// WithAuthType adds the authType to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthType(authType *string) *WirelessWirelessLansListParams { + o.SetAuthType(authType) + return o +} + +// SetAuthType adds the authType to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthType(authType *string) { + o.AuthType = authType +} + +// WithAuthTypen adds the authTypen to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithAuthTypen(authTypen *string) *WirelessWirelessLansListParams { + o.SetAuthTypen(authTypen) + return o +} + +// SetAuthTypen adds the authTypeN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetAuthTypen(authTypen *string) { + o.AuthTypen = authTypen +} + +// WithCreated adds the created to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithCreated(created *string) *WirelessWirelessLansListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithCreatedGte(createdGte *string) *WirelessWirelessLansListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithCreatedLte(createdLte *string) *WirelessWirelessLansListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithDescription adds the description to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescription(description *string) *WirelessWirelessLansListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionEmpty(descriptionEmpty *string) *WirelessWirelessLansListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionIc(descriptionIc *string) *WirelessWirelessLansListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionIe(descriptionIe *string) *WirelessWirelessLansListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionIew(descriptionIew *string) *WirelessWirelessLansListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionIsw(descriptionIsw *string) *WirelessWirelessLansListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionn(descriptionn *string) *WirelessWirelessLansListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionNic(descriptionNic *string) *WirelessWirelessLansListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionNie(descriptionNie *string) *WirelessWirelessLansListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionNiew(descriptionNiew *string) *WirelessWirelessLansListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithDescriptionNisw(descriptionNisw *string) *WirelessWirelessLansListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + +// WithGroup adds the group to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithGroup(group *string) *WirelessWirelessLansListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupn adds the groupn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithGroupn(groupn *string) *WirelessWirelessLansListParams { + o.SetGroupn(groupn) + return o +} + +// SetGroupn adds the groupN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetGroupn(groupn *string) { + o.Groupn = groupn +} + +// WithGroupID adds the groupID to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithGroupID(groupID *string) *WirelessWirelessLansListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithGroupIDn adds the groupIDn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithGroupIDn(groupIDn *string) *WirelessWirelessLansListParams { + o.SetGroupIDn(groupIDn) + return o +} + +// SetGroupIDn adds the groupIdN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetGroupIDn(groupIDn *string) { + o.GroupIDn = groupIDn +} + +// WithID adds the id to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithID(id *string) *WirelessWirelessLansListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithIDGt(iDGt *string) *WirelessWirelessLansListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithIDGte(iDGte *string) *WirelessWirelessLansListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithIDLt(iDLt *string) *WirelessWirelessLansListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithIDLte(iDLte *string) *WirelessWirelessLansListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithIDn(iDn *string) *WirelessWirelessLansListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithLastUpdated adds the lastUpdated to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithLastUpdated(lastUpdated *string) *WirelessWirelessLansListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithLastUpdatedGte(lastUpdatedGte *string) *WirelessWirelessLansListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithLastUpdatedLte(lastUpdatedLte *string) *WirelessWirelessLansListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithLimit(limit *int64) *WirelessWirelessLansListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithOffset(offset *int64) *WirelessWirelessLansListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithQ(q *string) *WirelessWirelessLansListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetQ(q *string) { + o.Q = q +} + +// WithSsid adds the ssid to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsid(ssid *string) *WirelessWirelessLansListParams { + o.SetSsid(ssid) + return o +} + +// SetSsid adds the ssid to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsid(ssid *string) { + o.Ssid = ssid +} + +// WithSsidEmpty adds the ssidEmpty to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidEmpty(ssidEmpty *string) *WirelessWirelessLansListParams { + o.SetSsidEmpty(ssidEmpty) + return o +} + +// SetSsidEmpty adds the ssidEmpty to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidEmpty(ssidEmpty *string) { + o.SsidEmpty = ssidEmpty +} + +// WithSsidIc adds the ssidIc to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidIc(ssidIc *string) *WirelessWirelessLansListParams { + o.SetSsidIc(ssidIc) + return o +} + +// SetSsidIc adds the ssidIc to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidIc(ssidIc *string) { + o.SsidIc = ssidIc +} + +// WithSsidIe adds the ssidIe to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidIe(ssidIe *string) *WirelessWirelessLansListParams { + o.SetSsidIe(ssidIe) + return o +} + +// SetSsidIe adds the ssidIe to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidIe(ssidIe *string) { + o.SsidIe = ssidIe +} + +// WithSsidIew adds the ssidIew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidIew(ssidIew *string) *WirelessWirelessLansListParams { + o.SetSsidIew(ssidIew) + return o +} + +// SetSsidIew adds the ssidIew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidIew(ssidIew *string) { + o.SsidIew = ssidIew +} + +// WithSsidIsw adds the ssidIsw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidIsw(ssidIsw *string) *WirelessWirelessLansListParams { + o.SetSsidIsw(ssidIsw) + return o +} + +// SetSsidIsw adds the ssidIsw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidIsw(ssidIsw *string) { + o.SsidIsw = ssidIsw +} + +// WithSsidn adds the ssidn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidn(ssidn *string) *WirelessWirelessLansListParams { + o.SetSsidn(ssidn) + return o +} + +// SetSsidn adds the ssidN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidn(ssidn *string) { + o.Ssidn = ssidn +} + +// WithSsidNic adds the ssidNic to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidNic(ssidNic *string) *WirelessWirelessLansListParams { + o.SetSsidNic(ssidNic) + return o +} + +// SetSsidNic adds the ssidNic to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidNic(ssidNic *string) { + o.SsidNic = ssidNic +} + +// WithSsidNie adds the ssidNie to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidNie(ssidNie *string) *WirelessWirelessLansListParams { + o.SetSsidNie(ssidNie) + return o +} + +// SetSsidNie adds the ssidNie to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidNie(ssidNie *string) { + o.SsidNie = ssidNie +} + +// WithSsidNiew adds the ssidNiew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidNiew(ssidNiew *string) *WirelessWirelessLansListParams { + o.SetSsidNiew(ssidNiew) + return o +} + +// SetSsidNiew adds the ssidNiew to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidNiew(ssidNiew *string) { + o.SsidNiew = ssidNiew +} + +// WithSsidNisw adds the ssidNisw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithSsidNisw(ssidNisw *string) *WirelessWirelessLansListParams { + o.SetSsidNisw(ssidNisw) + return o +} + +// SetSsidNisw adds the ssidNisw to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetSsidNisw(ssidNisw *string) { + o.SsidNisw = ssidNisw +} + +// WithTag adds the tag to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithTag(tag *string) *WirelessWirelessLansListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithTagn(tagn *string) *WirelessWirelessLansListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WithVlanID adds the vlanID to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithVlanID(vlanID *string) *WirelessWirelessLansListParams { + o.SetVlanID(vlanID) + return o +} + +// SetVlanID adds the vlanId to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetVlanID(vlanID *string) { + o.VlanID = vlanID +} + +// WithVlanIDn adds the vlanIDn to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) WithVlanIDn(vlanIDn *string) *WirelessWirelessLansListParams { + o.SetVlanIDn(vlanIDn) + return o +} + +// SetVlanIDn adds the vlanIdN to the wireless wireless lans list params +func (o *WirelessWirelessLansListParams) SetVlanIDn(vlanIDn *string) { + o.VlanIDn = vlanIDn +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AuthCipher != nil { + + // query param auth_cipher + var qrAuthCipher string + + if o.AuthCipher != nil { + qrAuthCipher = *o.AuthCipher + } + qAuthCipher := qrAuthCipher + if qAuthCipher != "" { + + if err := r.SetQueryParam("auth_cipher", qAuthCipher); err != nil { + return err + } + } + } + + if o.AuthCiphern != nil { + + // query param auth_cipher__n + var qrAuthCiphern string + + if o.AuthCiphern != nil { + qrAuthCiphern = *o.AuthCiphern + } + qAuthCiphern := qrAuthCiphern + if qAuthCiphern != "" { + + if err := r.SetQueryParam("auth_cipher__n", qAuthCiphern); err != nil { + return err + } + } + } + + if o.AuthPsk != nil { + + // query param auth_psk + var qrAuthPsk string + + if o.AuthPsk != nil { + qrAuthPsk = *o.AuthPsk + } + qAuthPsk := qrAuthPsk + if qAuthPsk != "" { + + if err := r.SetQueryParam("auth_psk", qAuthPsk); err != nil { + return err + } + } + } + + if o.AuthPskEmpty != nil { + + // query param auth_psk__empty + var qrAuthPskEmpty string + + if o.AuthPskEmpty != nil { + qrAuthPskEmpty = *o.AuthPskEmpty + } + qAuthPskEmpty := qrAuthPskEmpty + if qAuthPskEmpty != "" { + + if err := r.SetQueryParam("auth_psk__empty", qAuthPskEmpty); err != nil { + return err + } + } + } + + if o.AuthPskIc != nil { + + // query param auth_psk__ic + var qrAuthPskIc string + + if o.AuthPskIc != nil { + qrAuthPskIc = *o.AuthPskIc + } + qAuthPskIc := qrAuthPskIc + if qAuthPskIc != "" { + + if err := r.SetQueryParam("auth_psk__ic", qAuthPskIc); err != nil { + return err + } + } + } + + if o.AuthPskIe != nil { + + // query param auth_psk__ie + var qrAuthPskIe string + + if o.AuthPskIe != nil { + qrAuthPskIe = *o.AuthPskIe + } + qAuthPskIe := qrAuthPskIe + if qAuthPskIe != "" { + + if err := r.SetQueryParam("auth_psk__ie", qAuthPskIe); err != nil { + return err + } + } + } + + if o.AuthPskIew != nil { + + // query param auth_psk__iew + var qrAuthPskIew string + + if o.AuthPskIew != nil { + qrAuthPskIew = *o.AuthPskIew + } + qAuthPskIew := qrAuthPskIew + if qAuthPskIew != "" { + + if err := r.SetQueryParam("auth_psk__iew", qAuthPskIew); err != nil { + return err + } + } + } + + if o.AuthPskIsw != nil { + + // query param auth_psk__isw + var qrAuthPskIsw string + + if o.AuthPskIsw != nil { + qrAuthPskIsw = *o.AuthPskIsw + } + qAuthPskIsw := qrAuthPskIsw + if qAuthPskIsw != "" { + + if err := r.SetQueryParam("auth_psk__isw", qAuthPskIsw); err != nil { + return err + } + } + } + + if o.AuthPskn != nil { + + // query param auth_psk__n + var qrAuthPskn string + + if o.AuthPskn != nil { + qrAuthPskn = *o.AuthPskn + } + qAuthPskn := qrAuthPskn + if qAuthPskn != "" { + + if err := r.SetQueryParam("auth_psk__n", qAuthPskn); err != nil { + return err + } + } + } + + if o.AuthPskNic != nil { + + // query param auth_psk__nic + var qrAuthPskNic string + + if o.AuthPskNic != nil { + qrAuthPskNic = *o.AuthPskNic + } + qAuthPskNic := qrAuthPskNic + if qAuthPskNic != "" { + + if err := r.SetQueryParam("auth_psk__nic", qAuthPskNic); err != nil { + return err + } + } + } + + if o.AuthPskNie != nil { + + // query param auth_psk__nie + var qrAuthPskNie string + + if o.AuthPskNie != nil { + qrAuthPskNie = *o.AuthPskNie + } + qAuthPskNie := qrAuthPskNie + if qAuthPskNie != "" { + + if err := r.SetQueryParam("auth_psk__nie", qAuthPskNie); err != nil { + return err + } + } + } + + if o.AuthPskNiew != nil { + + // query param auth_psk__niew + var qrAuthPskNiew string + + if o.AuthPskNiew != nil { + qrAuthPskNiew = *o.AuthPskNiew + } + qAuthPskNiew := qrAuthPskNiew + if qAuthPskNiew != "" { + + if err := r.SetQueryParam("auth_psk__niew", qAuthPskNiew); err != nil { + return err + } + } + } + + if o.AuthPskNisw != nil { + + // query param auth_psk__nisw + var qrAuthPskNisw string + + if o.AuthPskNisw != nil { + qrAuthPskNisw = *o.AuthPskNisw + } + qAuthPskNisw := qrAuthPskNisw + if qAuthPskNisw != "" { + + if err := r.SetQueryParam("auth_psk__nisw", qAuthPskNisw); err != nil { + return err + } + } + } + + if o.AuthType != nil { + + // query param auth_type + var qrAuthType string + + if o.AuthType != nil { + qrAuthType = *o.AuthType + } + qAuthType := qrAuthType + if qAuthType != "" { + + if err := r.SetQueryParam("auth_type", qAuthType); err != nil { + return err + } + } + } + + if o.AuthTypen != nil { + + // query param auth_type__n + var qrAuthTypen string + + if o.AuthTypen != nil { + qrAuthTypen = *o.AuthTypen + } + qAuthTypen := qrAuthTypen + if qAuthTypen != "" { + + if err := r.SetQueryParam("auth_type__n", qAuthTypen); err != nil { + return err + } + } + } + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + + if o.Group != nil { + + // query param group + var qrGroup string + + if o.Group != nil { + qrGroup = *o.Group + } + qGroup := qrGroup + if qGroup != "" { + + if err := r.SetQueryParam("group", qGroup); err != nil { + return err + } + } + } + + if o.Groupn != nil { + + // query param group__n + var qrGroupn string + + if o.Groupn != nil { + qrGroupn = *o.Groupn + } + qGroupn := qrGroupn + if qGroupn != "" { + + if err := r.SetQueryParam("group__n", qGroupn); err != nil { + return err + } + } + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + } + + if o.GroupIDn != nil { + + // query param group_id__n + var qrGroupIDn string + + if o.GroupIDn != nil { + qrGroupIDn = *o.GroupIDn + } + qGroupIDn := qrGroupIDn + if qGroupIDn != "" { + + if err := r.SetQueryParam("group_id__n", qGroupIDn); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Ssid != nil { + + // query param ssid + var qrSsid string + + if o.Ssid != nil { + qrSsid = *o.Ssid + } + qSsid := qrSsid + if qSsid != "" { + + if err := r.SetQueryParam("ssid", qSsid); err != nil { + return err + } + } + } + + if o.SsidEmpty != nil { + + // query param ssid__empty + var qrSsidEmpty string + + if o.SsidEmpty != nil { + qrSsidEmpty = *o.SsidEmpty + } + qSsidEmpty := qrSsidEmpty + if qSsidEmpty != "" { + + if err := r.SetQueryParam("ssid__empty", qSsidEmpty); err != nil { + return err + } + } + } + + if o.SsidIc != nil { + + // query param ssid__ic + var qrSsidIc string + + if o.SsidIc != nil { + qrSsidIc = *o.SsidIc + } + qSsidIc := qrSsidIc + if qSsidIc != "" { + + if err := r.SetQueryParam("ssid__ic", qSsidIc); err != nil { + return err + } + } + } + + if o.SsidIe != nil { + + // query param ssid__ie + var qrSsidIe string + + if o.SsidIe != nil { + qrSsidIe = *o.SsidIe + } + qSsidIe := qrSsidIe + if qSsidIe != "" { + + if err := r.SetQueryParam("ssid__ie", qSsidIe); err != nil { + return err + } + } + } + + if o.SsidIew != nil { + + // query param ssid__iew + var qrSsidIew string + + if o.SsidIew != nil { + qrSsidIew = *o.SsidIew + } + qSsidIew := qrSsidIew + if qSsidIew != "" { + + if err := r.SetQueryParam("ssid__iew", qSsidIew); err != nil { + return err + } + } + } + + if o.SsidIsw != nil { + + // query param ssid__isw + var qrSsidIsw string + + if o.SsidIsw != nil { + qrSsidIsw = *o.SsidIsw + } + qSsidIsw := qrSsidIsw + if qSsidIsw != "" { + + if err := r.SetQueryParam("ssid__isw", qSsidIsw); err != nil { + return err + } + } + } + + if o.Ssidn != nil { + + // query param ssid__n + var qrSsidn string + + if o.Ssidn != nil { + qrSsidn = *o.Ssidn + } + qSsidn := qrSsidn + if qSsidn != "" { + + if err := r.SetQueryParam("ssid__n", qSsidn); err != nil { + return err + } + } + } + + if o.SsidNic != nil { + + // query param ssid__nic + var qrSsidNic string + + if o.SsidNic != nil { + qrSsidNic = *o.SsidNic + } + qSsidNic := qrSsidNic + if qSsidNic != "" { + + if err := r.SetQueryParam("ssid__nic", qSsidNic); err != nil { + return err + } + } + } + + if o.SsidNie != nil { + + // query param ssid__nie + var qrSsidNie string + + if o.SsidNie != nil { + qrSsidNie = *o.SsidNie + } + qSsidNie := qrSsidNie + if qSsidNie != "" { + + if err := r.SetQueryParam("ssid__nie", qSsidNie); err != nil { + return err + } + } + } + + if o.SsidNiew != nil { + + // query param ssid__niew + var qrSsidNiew string + + if o.SsidNiew != nil { + qrSsidNiew = *o.SsidNiew + } + qSsidNiew := qrSsidNiew + if qSsidNiew != "" { + + if err := r.SetQueryParam("ssid__niew", qSsidNiew); err != nil { + return err + } + } + } + + if o.SsidNisw != nil { + + // query param ssid__nisw + var qrSsidNisw string + + if o.SsidNisw != nil { + qrSsidNisw = *o.SsidNisw + } + qSsidNisw := qrSsidNisw + if qSsidNisw != "" { + + if err := r.SetQueryParam("ssid__nisw", qSsidNisw); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if o.VlanID != nil { + + // query param vlan_id + var qrVlanID string + + if o.VlanID != nil { + qrVlanID = *o.VlanID + } + qVlanID := qrVlanID + if qVlanID != "" { + + if err := r.SetQueryParam("vlan_id", qVlanID); err != nil { + return err + } + } + } + + if o.VlanIDn != nil { + + // query param vlan_id__n + var qrVlanIDn string + + if o.VlanIDn != nil { + qrVlanIDn = *o.VlanIDn + } + qVlanIDn := qrVlanIDn + if qVlanIDn != "" { + + if err := r.SetQueryParam("vlan_id__n", qVlanIDn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_responses.go new file mode 100644 index 000000000..39f51be6b --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLansListReader is a Reader for the WirelessWirelessLansList structure. +type WirelessWirelessLansListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLansListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansListOK creates a WirelessWirelessLansListOK with default headers values +func NewWirelessWirelessLansListOK() *WirelessWirelessLansListOK { + return &WirelessWirelessLansListOK{} +} + +/* WirelessWirelessLansListOK describes a response with status code 200, with default header values. + +WirelessWirelessLansListOK wireless wireless lans list o k +*/ +type WirelessWirelessLansListOK struct { + Payload *WirelessWirelessLansListOKBody +} + +func (o *WirelessWirelessLansListOK) Error() string { + return fmt.Sprintf("[GET /wireless/wireless-lans/][%d] wirelessWirelessLansListOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLansListOK) GetPayload() *WirelessWirelessLansListOKBody { + return o.Payload +} + +func (o *WirelessWirelessLansListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(WirelessWirelessLansListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*WirelessWirelessLansListOKBody wireless wireless lans list o k body +swagger:model WirelessWirelessLansListOKBody +*/ +type WirelessWirelessLansListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.WirelessLAN `json:"results"` +} + +// Validate validates this wireless wireless lans list o k body +func (o *WirelessWirelessLansListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *WirelessWirelessLansListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("wirelessWirelessLansListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLansListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("wirelessWirelessLansListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLansListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("wirelessWirelessLansListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLansListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("wirelessWirelessLansListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wirelessWirelessLansListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wirelessWirelessLansListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this wireless wireless lans list o k body based on the context it is used +func (o *WirelessWirelessLansListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *WirelessWirelessLansListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wirelessWirelessLansListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wirelessWirelessLansListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *WirelessWirelessLansListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *WirelessWirelessLansListOKBody) UnmarshalBinary(b []byte) error { + var res WirelessWirelessLansListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_parameters.go new file mode 100644 index 000000000..cdb555ee6 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLansPartialUpdateParams creates a new WirelessWirelessLansPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansPartialUpdateParams() *WirelessWirelessLansPartialUpdateParams { + return &WirelessWirelessLansPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansPartialUpdateParamsWithTimeout creates a new WirelessWirelessLansPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansPartialUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansPartialUpdateParams { + return &WirelessWirelessLansPartialUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansPartialUpdateParamsWithContext creates a new WirelessWirelessLansPartialUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansPartialUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLansPartialUpdateParams { + return &WirelessWirelessLansPartialUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansPartialUpdateParamsWithHTTPClient creates a new WirelessWirelessLansPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansPartialUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansPartialUpdateParams { + return &WirelessWirelessLansPartialUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansPartialUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lans partial update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansPartialUpdateParams struct { + + // Data. + Data *models.WritableWirelessLAN + + /* ID. + + A unique integer value identifying this Wireless LAN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansPartialUpdateParams) WithDefaults() *WirelessWirelessLansPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLansPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) WithData(data *models.WritableWirelessLAN) *WirelessWirelessLansPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) SetData(data *models.WritableWirelessLAN) { + o.Data = data +} + +// WithID adds the id to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) WithID(id int64) *WirelessWirelessLansPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lans partial update params +func (o *WirelessWirelessLansPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_responses.go new file mode 100644 index 000000000..5d9d82d89 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLansPartialUpdateReader is a Reader for the WirelessWirelessLansPartialUpdate structure. +type WirelessWirelessLansPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLansPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansPartialUpdateOK creates a WirelessWirelessLansPartialUpdateOK with default headers values +func NewWirelessWirelessLansPartialUpdateOK() *WirelessWirelessLansPartialUpdateOK { + return &WirelessWirelessLansPartialUpdateOK{} +} + +/* WirelessWirelessLansPartialUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLansPartialUpdateOK wireless wireless lans partial update o k +*/ +type WirelessWirelessLansPartialUpdateOK struct { + Payload *models.WirelessLAN +} + +func (o *WirelessWirelessLansPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /wireless/wireless-lans/{id}/][%d] wirelessWirelessLansPartialUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLansPartialUpdateOK) GetPayload() *models.WirelessLAN { + return o.Payload +} + +func (o *WirelessWirelessLansPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_parameters.go new file mode 100644 index 000000000..56391879b --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLansReadParams creates a new WirelessWirelessLansReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansReadParams() *WirelessWirelessLansReadParams { + return &WirelessWirelessLansReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansReadParamsWithTimeout creates a new WirelessWirelessLansReadParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansReadParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansReadParams { + return &WirelessWirelessLansReadParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansReadParamsWithContext creates a new WirelessWirelessLansReadParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansReadParamsWithContext(ctx context.Context) *WirelessWirelessLansReadParams { + return &WirelessWirelessLansReadParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansReadParamsWithHTTPClient creates a new WirelessWirelessLansReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansReadParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansReadParams { + return &WirelessWirelessLansReadParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansReadParams contains all the parameters to send to the API endpoint + for the wireless wireless lans read operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansReadParams struct { + + /* ID. + + A unique integer value identifying this Wireless LAN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansReadParams) WithDefaults() *WirelessWirelessLansReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) WithContext(ctx context.Context) *WirelessWirelessLansReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) WithID(id int64) *WirelessWirelessLansReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lans read params +func (o *WirelessWirelessLansReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_responses.go new file mode 100644 index 000000000..f6ab189a8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLansReadReader is a Reader for the WirelessWirelessLansRead structure. +type WirelessWirelessLansReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLansReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansReadOK creates a WirelessWirelessLansReadOK with default headers values +func NewWirelessWirelessLansReadOK() *WirelessWirelessLansReadOK { + return &WirelessWirelessLansReadOK{} +} + +/* WirelessWirelessLansReadOK describes a response with status code 200, with default header values. + +WirelessWirelessLansReadOK wireless wireless lans read o k +*/ +type WirelessWirelessLansReadOK struct { + Payload *models.WirelessLAN +} + +func (o *WirelessWirelessLansReadOK) Error() string { + return fmt.Sprintf("[GET /wireless/wireless-lans/{id}/][%d] wirelessWirelessLansReadOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLansReadOK) GetPayload() *models.WirelessLAN { + return o.Payload +} + +func (o *WirelessWirelessLansReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_parameters.go new file mode 100644 index 000000000..fa014cf94 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLansUpdateParams creates a new WirelessWirelessLansUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLansUpdateParams() *WirelessWirelessLansUpdateParams { + return &WirelessWirelessLansUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLansUpdateParamsWithTimeout creates a new WirelessWirelessLansUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLansUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLansUpdateParams { + return &WirelessWirelessLansUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLansUpdateParamsWithContext creates a new WirelessWirelessLansUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLansUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLansUpdateParams { + return &WirelessWirelessLansUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLansUpdateParamsWithHTTPClient creates a new WirelessWirelessLansUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLansUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLansUpdateParams { + return &WirelessWirelessLansUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLansUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless lans update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLansUpdateParams struct { + + // Data. + Data *models.WritableWirelessLAN + + /* ID. + + A unique integer value identifying this Wireless LAN. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless lans update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansUpdateParams) WithDefaults() *WirelessWirelessLansUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless lans update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLansUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLansUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLansUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLansUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) WithData(data *models.WritableWirelessLAN) *WirelessWirelessLansUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) SetData(data *models.WritableWirelessLAN) { + o.Data = data +} + +// WithID adds the id to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) WithID(id int64) *WirelessWirelessLansUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless lans update params +func (o *WirelessWirelessLansUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLansUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_responses.go new file mode 100644 index 000000000..a5af0e102 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_lans_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLansUpdateReader is a Reader for the WirelessWirelessLansUpdate structure. +type WirelessWirelessLansUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLansUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLansUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLansUpdateOK creates a WirelessWirelessLansUpdateOK with default headers values +func NewWirelessWirelessLansUpdateOK() *WirelessWirelessLansUpdateOK { + return &WirelessWirelessLansUpdateOK{} +} + +/* WirelessWirelessLansUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLansUpdateOK wireless wireless lans update o k +*/ +type WirelessWirelessLansUpdateOK struct { + Payload *models.WirelessLAN +} + +func (o *WirelessWirelessLansUpdateOK) Error() string { + return fmt.Sprintf("[PUT /wireless/wireless-lans/{id}/][%d] wirelessWirelessLansUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLansUpdateOK) GetPayload() *models.WirelessLAN { + return o.Payload +} + +func (o *WirelessWirelessLansUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_parameters.go new file mode 100644 index 000000000..b3c11225d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_parameters.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewWirelessWirelessLinksBulkDeleteParams creates a new WirelessWirelessLinksBulkDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksBulkDeleteParams() *WirelessWirelessLinksBulkDeleteParams { + return &WirelessWirelessLinksBulkDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksBulkDeleteParamsWithTimeout creates a new WirelessWirelessLinksBulkDeleteParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksBulkDeleteParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksBulkDeleteParams { + return &WirelessWirelessLinksBulkDeleteParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksBulkDeleteParamsWithContext creates a new WirelessWirelessLinksBulkDeleteParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksBulkDeleteParamsWithContext(ctx context.Context) *WirelessWirelessLinksBulkDeleteParams { + return &WirelessWirelessLinksBulkDeleteParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksBulkDeleteParamsWithHTTPClient creates a new WirelessWirelessLinksBulkDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksBulkDeleteParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksBulkDeleteParams { + return &WirelessWirelessLinksBulkDeleteParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksBulkDeleteParams contains all the parameters to send to the API endpoint + for the wireless wireless links bulk delete operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksBulkDeleteParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksBulkDeleteParams) WithDefaults() *WirelessWirelessLinksBulkDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links bulk delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksBulkDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links bulk delete params +func (o *WirelessWirelessLinksBulkDeleteParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksBulkDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links bulk delete params +func (o *WirelessWirelessLinksBulkDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links bulk delete params +func (o *WirelessWirelessLinksBulkDeleteParams) WithContext(ctx context.Context) *WirelessWirelessLinksBulkDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links bulk delete params +func (o *WirelessWirelessLinksBulkDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links bulk delete params +func (o *WirelessWirelessLinksBulkDeleteParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksBulkDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links bulk delete params +func (o *WirelessWirelessLinksBulkDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksBulkDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_responses.go new file mode 100644 index 000000000..b94cb603d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// WirelessWirelessLinksBulkDeleteReader is a Reader for the WirelessWirelessLinksBulkDelete structure. +type WirelessWirelessLinksBulkDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksBulkDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewWirelessWirelessLinksBulkDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksBulkDeleteNoContent creates a WirelessWirelessLinksBulkDeleteNoContent with default headers values +func NewWirelessWirelessLinksBulkDeleteNoContent() *WirelessWirelessLinksBulkDeleteNoContent { + return &WirelessWirelessLinksBulkDeleteNoContent{} +} + +/* WirelessWirelessLinksBulkDeleteNoContent describes a response with status code 204, with default header values. + +WirelessWirelessLinksBulkDeleteNoContent wireless wireless links bulk delete no content +*/ +type WirelessWirelessLinksBulkDeleteNoContent struct { +} + +func (o *WirelessWirelessLinksBulkDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /wireless/wireless-links/][%d] wirelessWirelessLinksBulkDeleteNoContent ", 204) +} + +func (o *WirelessWirelessLinksBulkDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_parameters.go new file mode 100644 index 000000000..4999ec296 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLinksBulkPartialUpdateParams creates a new WirelessWirelessLinksBulkPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksBulkPartialUpdateParams() *WirelessWirelessLinksBulkPartialUpdateParams { + return &WirelessWirelessLinksBulkPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksBulkPartialUpdateParamsWithTimeout creates a new WirelessWirelessLinksBulkPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksBulkPartialUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksBulkPartialUpdateParams { + return &WirelessWirelessLinksBulkPartialUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksBulkPartialUpdateParamsWithContext creates a new WirelessWirelessLinksBulkPartialUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksBulkPartialUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLinksBulkPartialUpdateParams { + return &WirelessWirelessLinksBulkPartialUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksBulkPartialUpdateParamsWithHTTPClient creates a new WirelessWirelessLinksBulkPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksBulkPartialUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksBulkPartialUpdateParams { + return &WirelessWirelessLinksBulkPartialUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksBulkPartialUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless links bulk partial update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksBulkPartialUpdateParams struct { + + // Data. + Data *models.WritableWirelessLink + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksBulkPartialUpdateParams) WithDefaults() *WirelessWirelessLinksBulkPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links bulk partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksBulkPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksBulkPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLinksBulkPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksBulkPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) WithData(data *models.WritableWirelessLink) *WirelessWirelessLinksBulkPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless links bulk partial update params +func (o *WirelessWirelessLinksBulkPartialUpdateParams) SetData(data *models.WritableWirelessLink) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksBulkPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_responses.go new file mode 100644 index 000000000..83a8056ad --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLinksBulkPartialUpdateReader is a Reader for the WirelessWirelessLinksBulkPartialUpdate structure. +type WirelessWirelessLinksBulkPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksBulkPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLinksBulkPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksBulkPartialUpdateOK creates a WirelessWirelessLinksBulkPartialUpdateOK with default headers values +func NewWirelessWirelessLinksBulkPartialUpdateOK() *WirelessWirelessLinksBulkPartialUpdateOK { + return &WirelessWirelessLinksBulkPartialUpdateOK{} +} + +/* WirelessWirelessLinksBulkPartialUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLinksBulkPartialUpdateOK wireless wireless links bulk partial update o k +*/ +type WirelessWirelessLinksBulkPartialUpdateOK struct { + Payload *models.WirelessLink +} + +func (o *WirelessWirelessLinksBulkPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /wireless/wireless-links/][%d] wirelessWirelessLinksBulkPartialUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLinksBulkPartialUpdateOK) GetPayload() *models.WirelessLink { + return o.Payload +} + +func (o *WirelessWirelessLinksBulkPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLink) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_parameters.go new file mode 100644 index 000000000..98d1bdc81 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLinksBulkUpdateParams creates a new WirelessWirelessLinksBulkUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksBulkUpdateParams() *WirelessWirelessLinksBulkUpdateParams { + return &WirelessWirelessLinksBulkUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksBulkUpdateParamsWithTimeout creates a new WirelessWirelessLinksBulkUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksBulkUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksBulkUpdateParams { + return &WirelessWirelessLinksBulkUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksBulkUpdateParamsWithContext creates a new WirelessWirelessLinksBulkUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksBulkUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLinksBulkUpdateParams { + return &WirelessWirelessLinksBulkUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksBulkUpdateParamsWithHTTPClient creates a new WirelessWirelessLinksBulkUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksBulkUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksBulkUpdateParams { + return &WirelessWirelessLinksBulkUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksBulkUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless links bulk update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksBulkUpdateParams struct { + + // Data. + Data *models.WritableWirelessLink + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksBulkUpdateParams) WithDefaults() *WirelessWirelessLinksBulkUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links bulk update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksBulkUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksBulkUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLinksBulkUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksBulkUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) WithData(data *models.WritableWirelessLink) *WirelessWirelessLinksBulkUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless links bulk update params +func (o *WirelessWirelessLinksBulkUpdateParams) SetData(data *models.WritableWirelessLink) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_responses.go new file mode 100644 index 000000000..1fefe22c9 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_bulk_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLinksBulkUpdateReader is a Reader for the WirelessWirelessLinksBulkUpdate structure. +type WirelessWirelessLinksBulkUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksBulkUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLinksBulkUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksBulkUpdateOK creates a WirelessWirelessLinksBulkUpdateOK with default headers values +func NewWirelessWirelessLinksBulkUpdateOK() *WirelessWirelessLinksBulkUpdateOK { + return &WirelessWirelessLinksBulkUpdateOK{} +} + +/* WirelessWirelessLinksBulkUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLinksBulkUpdateOK wireless wireless links bulk update o k +*/ +type WirelessWirelessLinksBulkUpdateOK struct { + Payload *models.WirelessLink +} + +func (o *WirelessWirelessLinksBulkUpdateOK) Error() string { + return fmt.Sprintf("[PUT /wireless/wireless-links/][%d] wirelessWirelessLinksBulkUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLinksBulkUpdateOK) GetPayload() *models.WirelessLink { + return o.Payload +} + +func (o *WirelessWirelessLinksBulkUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLink) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_parameters.go new file mode 100644 index 000000000..9e1043d11 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLinksCreateParams creates a new WirelessWirelessLinksCreateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksCreateParams() *WirelessWirelessLinksCreateParams { + return &WirelessWirelessLinksCreateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksCreateParamsWithTimeout creates a new WirelessWirelessLinksCreateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksCreateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksCreateParams { + return &WirelessWirelessLinksCreateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksCreateParamsWithContext creates a new WirelessWirelessLinksCreateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksCreateParamsWithContext(ctx context.Context) *WirelessWirelessLinksCreateParams { + return &WirelessWirelessLinksCreateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksCreateParamsWithHTTPClient creates a new WirelessWirelessLinksCreateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksCreateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksCreateParams { + return &WirelessWirelessLinksCreateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksCreateParams contains all the parameters to send to the API endpoint + for the wireless wireless links create operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksCreateParams struct { + + // Data. + Data *models.WritableWirelessLink + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksCreateParams) WithDefaults() *WirelessWirelessLinksCreateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links create params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksCreateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) WithContext(ctx context.Context) *WirelessWirelessLinksCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) WithData(data *models.WritableWirelessLink) *WirelessWirelessLinksCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless links create params +func (o *WirelessWirelessLinksCreateParams) SetData(data *models.WritableWirelessLink) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_responses.go new file mode 100644 index 000000000..acd680398 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_create_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLinksCreateReader is a Reader for the WirelessWirelessLinksCreate structure. +type WirelessWirelessLinksCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewWirelessWirelessLinksCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksCreateCreated creates a WirelessWirelessLinksCreateCreated with default headers values +func NewWirelessWirelessLinksCreateCreated() *WirelessWirelessLinksCreateCreated { + return &WirelessWirelessLinksCreateCreated{} +} + +/* WirelessWirelessLinksCreateCreated describes a response with status code 201, with default header values. + +WirelessWirelessLinksCreateCreated wireless wireless links create created +*/ +type WirelessWirelessLinksCreateCreated struct { + Payload *models.WirelessLink +} + +func (o *WirelessWirelessLinksCreateCreated) Error() string { + return fmt.Sprintf("[POST /wireless/wireless-links/][%d] wirelessWirelessLinksCreateCreated %+v", 201, o.Payload) +} +func (o *WirelessWirelessLinksCreateCreated) GetPayload() *models.WirelessLink { + return o.Payload +} + +func (o *WirelessWirelessLinksCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLink) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_parameters.go new file mode 100644 index 000000000..1ed275207 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLinksDeleteParams creates a new WirelessWirelessLinksDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksDeleteParams() *WirelessWirelessLinksDeleteParams { + return &WirelessWirelessLinksDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksDeleteParamsWithTimeout creates a new WirelessWirelessLinksDeleteParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksDeleteParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksDeleteParams { + return &WirelessWirelessLinksDeleteParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksDeleteParamsWithContext creates a new WirelessWirelessLinksDeleteParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksDeleteParamsWithContext(ctx context.Context) *WirelessWirelessLinksDeleteParams { + return &WirelessWirelessLinksDeleteParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksDeleteParamsWithHTTPClient creates a new WirelessWirelessLinksDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksDeleteParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksDeleteParams { + return &WirelessWirelessLinksDeleteParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksDeleteParams contains all the parameters to send to the API endpoint + for the wireless wireless links delete operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksDeleteParams struct { + + /* ID. + + A unique integer value identifying this wireless link. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksDeleteParams) WithDefaults() *WirelessWirelessLinksDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) WithContext(ctx context.Context) *WirelessWirelessLinksDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) WithID(id int64) *WirelessWirelessLinksDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless links delete params +func (o *WirelessWirelessLinksDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_responses.go new file mode 100644 index 000000000..647d6abae --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_delete_responses.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// WirelessWirelessLinksDeleteReader is a Reader for the WirelessWirelessLinksDelete structure. +type WirelessWirelessLinksDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewWirelessWirelessLinksDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksDeleteNoContent creates a WirelessWirelessLinksDeleteNoContent with default headers values +func NewWirelessWirelessLinksDeleteNoContent() *WirelessWirelessLinksDeleteNoContent { + return &WirelessWirelessLinksDeleteNoContent{} +} + +/* WirelessWirelessLinksDeleteNoContent describes a response with status code 204, with default header values. + +WirelessWirelessLinksDeleteNoContent wireless wireless links delete no content +*/ +type WirelessWirelessLinksDeleteNoContent struct { +} + +func (o *WirelessWirelessLinksDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /wireless/wireless-links/{id}/][%d] wirelessWirelessLinksDeleteNoContent ", 204) +} + +func (o *WirelessWirelessLinksDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_parameters.go new file mode 100644 index 000000000..78fa73b21 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_parameters.go @@ -0,0 +1,2257 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLinksListParams creates a new WirelessWirelessLinksListParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksListParams() *WirelessWirelessLinksListParams { + return &WirelessWirelessLinksListParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksListParamsWithTimeout creates a new WirelessWirelessLinksListParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksListParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksListParams { + return &WirelessWirelessLinksListParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksListParamsWithContext creates a new WirelessWirelessLinksListParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksListParamsWithContext(ctx context.Context) *WirelessWirelessLinksListParams { + return &WirelessWirelessLinksListParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksListParamsWithHTTPClient creates a new WirelessWirelessLinksListParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksListParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksListParams { + return &WirelessWirelessLinksListParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksListParams contains all the parameters to send to the API endpoint + for the wireless wireless links list operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksListParams struct { + + // AuthCipher. + AuthCipher *string + + // AuthCiphern. + AuthCiphern *string + + // AuthPsk. + AuthPsk *string + + // AuthPskEmpty. + AuthPskEmpty *string + + // AuthPskIc. + AuthPskIc *string + + // AuthPskIe. + AuthPskIe *string + + // AuthPskIew. + AuthPskIew *string + + // AuthPskIsw. + AuthPskIsw *string + + // AuthPskn. + AuthPskn *string + + // AuthPskNic. + AuthPskNic *string + + // AuthPskNie. + AuthPskNie *string + + // AuthPskNiew. + AuthPskNiew *string + + // AuthPskNisw. + AuthPskNisw *string + + // AuthType. + AuthType *string + + // AuthTypen. + AuthTypen *string + + // Created. + Created *string + + // CreatedGte. + CreatedGte *string + + // CreatedLte. + CreatedLte *string + + // Description. + Description *string + + // DescriptionEmpty. + DescriptionEmpty *string + + // DescriptionIc. + DescriptionIc *string + + // DescriptionIe. + DescriptionIe *string + + // DescriptionIew. + DescriptionIew *string + + // DescriptionIsw. + DescriptionIsw *string + + // Descriptionn. + Descriptionn *string + + // DescriptionNic. + DescriptionNic *string + + // DescriptionNie. + DescriptionNie *string + + // DescriptionNiew. + DescriptionNiew *string + + // DescriptionNisw. + DescriptionNisw *string + + // ID. + ID *string + + // IDGt. + IDGt *string + + // IDGte. + IDGte *string + + // IDLt. + IDLt *string + + // IDLte. + IDLte *string + + // IDn. + IDn *string + + // InterfaceaID. + InterfaceaID *string + + // InterfaceaIDGt. + InterfaceaIDGt *string + + // InterfaceaIDGte. + InterfaceaIDGte *string + + // InterfaceaIDLt. + InterfaceaIDLt *string + + // InterfaceaIDLte. + InterfaceaIDLte *string + + // InterfaceaIDn. + InterfaceaIDn *string + + // InterfacebID. + InterfacebID *string + + // InterfacebIDGt. + InterfacebIDGt *string + + // InterfacebIDGte. + InterfacebIDGte *string + + // InterfacebIDLt. + InterfacebIDLt *string + + // InterfacebIDLte. + InterfacebIDLte *string + + // InterfacebIDn. + InterfacebIDn *string + + // LastUpdated. + LastUpdated *string + + // LastUpdatedGte. + LastUpdatedGte *string + + // LastUpdatedLte. + LastUpdatedLte *string + + /* Limit. + + Number of results to return per page. + */ + Limit *int64 + + /* Offset. + + The initial index from which to return the results. + */ + Offset *int64 + + // Q. + Q *string + + // Ssid. + Ssid *string + + // SsidEmpty. + SsidEmpty *string + + // SsidIc. + SsidIc *string + + // SsidIe. + SsidIe *string + + // SsidIew. + SsidIew *string + + // SsidIsw. + SsidIsw *string + + // Ssidn. + Ssidn *string + + // SsidNic. + SsidNic *string + + // SsidNie. + SsidNie *string + + // SsidNiew. + SsidNiew *string + + // SsidNisw. + SsidNisw *string + + // Status. + Status *string + + // Statusn. + Statusn *string + + // Tag. + Tag *string + + // Tagn. + Tagn *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksListParams) WithDefaults() *WirelessWirelessLinksListParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links list params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksListParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithContext(ctx context.Context) *WirelessWirelessLinksListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthCipher adds the authCipher to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthCipher(authCipher *string) *WirelessWirelessLinksListParams { + o.SetAuthCipher(authCipher) + return o +} + +// SetAuthCipher adds the authCipher to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthCipher(authCipher *string) { + o.AuthCipher = authCipher +} + +// WithAuthCiphern adds the authCiphern to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthCiphern(authCiphern *string) *WirelessWirelessLinksListParams { + o.SetAuthCiphern(authCiphern) + return o +} + +// SetAuthCiphern adds the authCipherN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthCiphern(authCiphern *string) { + o.AuthCiphern = authCiphern +} + +// WithAuthPsk adds the authPsk to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPsk(authPsk *string) *WirelessWirelessLinksListParams { + o.SetAuthPsk(authPsk) + return o +} + +// SetAuthPsk adds the authPsk to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPsk(authPsk *string) { + o.AuthPsk = authPsk +} + +// WithAuthPskEmpty adds the authPskEmpty to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskEmpty(authPskEmpty *string) *WirelessWirelessLinksListParams { + o.SetAuthPskEmpty(authPskEmpty) + return o +} + +// SetAuthPskEmpty adds the authPskEmpty to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskEmpty(authPskEmpty *string) { + o.AuthPskEmpty = authPskEmpty +} + +// WithAuthPskIc adds the authPskIc to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskIc(authPskIc *string) *WirelessWirelessLinksListParams { + o.SetAuthPskIc(authPskIc) + return o +} + +// SetAuthPskIc adds the authPskIc to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskIc(authPskIc *string) { + o.AuthPskIc = authPskIc +} + +// WithAuthPskIe adds the authPskIe to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskIe(authPskIe *string) *WirelessWirelessLinksListParams { + o.SetAuthPskIe(authPskIe) + return o +} + +// SetAuthPskIe adds the authPskIe to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskIe(authPskIe *string) { + o.AuthPskIe = authPskIe +} + +// WithAuthPskIew adds the authPskIew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskIew(authPskIew *string) *WirelessWirelessLinksListParams { + o.SetAuthPskIew(authPskIew) + return o +} + +// SetAuthPskIew adds the authPskIew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskIew(authPskIew *string) { + o.AuthPskIew = authPskIew +} + +// WithAuthPskIsw adds the authPskIsw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskIsw(authPskIsw *string) *WirelessWirelessLinksListParams { + o.SetAuthPskIsw(authPskIsw) + return o +} + +// SetAuthPskIsw adds the authPskIsw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskIsw(authPskIsw *string) { + o.AuthPskIsw = authPskIsw +} + +// WithAuthPskn adds the authPskn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskn(authPskn *string) *WirelessWirelessLinksListParams { + o.SetAuthPskn(authPskn) + return o +} + +// SetAuthPskn adds the authPskN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskn(authPskn *string) { + o.AuthPskn = authPskn +} + +// WithAuthPskNic adds the authPskNic to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskNic(authPskNic *string) *WirelessWirelessLinksListParams { + o.SetAuthPskNic(authPskNic) + return o +} + +// SetAuthPskNic adds the authPskNic to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskNic(authPskNic *string) { + o.AuthPskNic = authPskNic +} + +// WithAuthPskNie adds the authPskNie to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskNie(authPskNie *string) *WirelessWirelessLinksListParams { + o.SetAuthPskNie(authPskNie) + return o +} + +// SetAuthPskNie adds the authPskNie to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskNie(authPskNie *string) { + o.AuthPskNie = authPskNie +} + +// WithAuthPskNiew adds the authPskNiew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskNiew(authPskNiew *string) *WirelessWirelessLinksListParams { + o.SetAuthPskNiew(authPskNiew) + return o +} + +// SetAuthPskNiew adds the authPskNiew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskNiew(authPskNiew *string) { + o.AuthPskNiew = authPskNiew +} + +// WithAuthPskNisw adds the authPskNisw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthPskNisw(authPskNisw *string) *WirelessWirelessLinksListParams { + o.SetAuthPskNisw(authPskNisw) + return o +} + +// SetAuthPskNisw adds the authPskNisw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthPskNisw(authPskNisw *string) { + o.AuthPskNisw = authPskNisw +} + +// WithAuthType adds the authType to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthType(authType *string) *WirelessWirelessLinksListParams { + o.SetAuthType(authType) + return o +} + +// SetAuthType adds the authType to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthType(authType *string) { + o.AuthType = authType +} + +// WithAuthTypen adds the authTypen to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithAuthTypen(authTypen *string) *WirelessWirelessLinksListParams { + o.SetAuthTypen(authTypen) + return o +} + +// SetAuthTypen adds the authTypeN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetAuthTypen(authTypen *string) { + o.AuthTypen = authTypen +} + +// WithCreated adds the created to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithCreated(created *string) *WirelessWirelessLinksListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetCreated(created *string) { + o.Created = created +} + +// WithCreatedGte adds the createdGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithCreatedGte(createdGte *string) *WirelessWirelessLinksListParams { + o.SetCreatedGte(createdGte) + return o +} + +// SetCreatedGte adds the createdGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetCreatedGte(createdGte *string) { + o.CreatedGte = createdGte +} + +// WithCreatedLte adds the createdLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithCreatedLte(createdLte *string) *WirelessWirelessLinksListParams { + o.SetCreatedLte(createdLte) + return o +} + +// SetCreatedLte adds the createdLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetCreatedLte(createdLte *string) { + o.CreatedLte = createdLte +} + +// WithDescription adds the description to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescription(description *string) *WirelessWirelessLinksListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDescriptionEmpty adds the descriptionEmpty to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionEmpty(descriptionEmpty *string) *WirelessWirelessLinksListParams { + o.SetDescriptionEmpty(descriptionEmpty) + return o +} + +// SetDescriptionEmpty adds the descriptionEmpty to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionEmpty(descriptionEmpty *string) { + o.DescriptionEmpty = descriptionEmpty +} + +// WithDescriptionIc adds the descriptionIc to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionIc(descriptionIc *string) *WirelessWirelessLinksListParams { + o.SetDescriptionIc(descriptionIc) + return o +} + +// SetDescriptionIc adds the descriptionIc to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionIc(descriptionIc *string) { + o.DescriptionIc = descriptionIc +} + +// WithDescriptionIe adds the descriptionIe to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionIe(descriptionIe *string) *WirelessWirelessLinksListParams { + o.SetDescriptionIe(descriptionIe) + return o +} + +// SetDescriptionIe adds the descriptionIe to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionIe(descriptionIe *string) { + o.DescriptionIe = descriptionIe +} + +// WithDescriptionIew adds the descriptionIew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionIew(descriptionIew *string) *WirelessWirelessLinksListParams { + o.SetDescriptionIew(descriptionIew) + return o +} + +// SetDescriptionIew adds the descriptionIew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionIew(descriptionIew *string) { + o.DescriptionIew = descriptionIew +} + +// WithDescriptionIsw adds the descriptionIsw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionIsw(descriptionIsw *string) *WirelessWirelessLinksListParams { + o.SetDescriptionIsw(descriptionIsw) + return o +} + +// SetDescriptionIsw adds the descriptionIsw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionIsw(descriptionIsw *string) { + o.DescriptionIsw = descriptionIsw +} + +// WithDescriptionn adds the descriptionn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionn(descriptionn *string) *WirelessWirelessLinksListParams { + o.SetDescriptionn(descriptionn) + return o +} + +// SetDescriptionn adds the descriptionN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionn(descriptionn *string) { + o.Descriptionn = descriptionn +} + +// WithDescriptionNic adds the descriptionNic to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionNic(descriptionNic *string) *WirelessWirelessLinksListParams { + o.SetDescriptionNic(descriptionNic) + return o +} + +// SetDescriptionNic adds the descriptionNic to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionNic(descriptionNic *string) { + o.DescriptionNic = descriptionNic +} + +// WithDescriptionNie adds the descriptionNie to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionNie(descriptionNie *string) *WirelessWirelessLinksListParams { + o.SetDescriptionNie(descriptionNie) + return o +} + +// SetDescriptionNie adds the descriptionNie to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionNie(descriptionNie *string) { + o.DescriptionNie = descriptionNie +} + +// WithDescriptionNiew adds the descriptionNiew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionNiew(descriptionNiew *string) *WirelessWirelessLinksListParams { + o.SetDescriptionNiew(descriptionNiew) + return o +} + +// SetDescriptionNiew adds the descriptionNiew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionNiew(descriptionNiew *string) { + o.DescriptionNiew = descriptionNiew +} + +// WithDescriptionNisw adds the descriptionNisw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithDescriptionNisw(descriptionNisw *string) *WirelessWirelessLinksListParams { + o.SetDescriptionNisw(descriptionNisw) + return o +} + +// SetDescriptionNisw adds the descriptionNisw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetDescriptionNisw(descriptionNisw *string) { + o.DescriptionNisw = descriptionNisw +} + +// WithID adds the id to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithID(id *string) *WirelessWirelessLinksListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetID(id *string) { + o.ID = id +} + +// WithIDGt adds the iDGt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithIDGt(iDGt *string) *WirelessWirelessLinksListParams { + o.SetIDGt(iDGt) + return o +} + +// SetIDGt adds the idGt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetIDGt(iDGt *string) { + o.IDGt = iDGt +} + +// WithIDGte adds the iDGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithIDGte(iDGte *string) *WirelessWirelessLinksListParams { + o.SetIDGte(iDGte) + return o +} + +// SetIDGte adds the idGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetIDGte(iDGte *string) { + o.IDGte = iDGte +} + +// WithIDLt adds the iDLt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithIDLt(iDLt *string) *WirelessWirelessLinksListParams { + o.SetIDLt(iDLt) + return o +} + +// SetIDLt adds the idLt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetIDLt(iDLt *string) { + o.IDLt = iDLt +} + +// WithIDLte adds the iDLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithIDLte(iDLte *string) *WirelessWirelessLinksListParams { + o.SetIDLte(iDLte) + return o +} + +// SetIDLte adds the idLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetIDLte(iDLte *string) { + o.IDLte = iDLte +} + +// WithIDn adds the iDn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithIDn(iDn *string) *WirelessWirelessLinksListParams { + o.SetIDn(iDn) + return o +} + +// SetIDn adds the idN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetIDn(iDn *string) { + o.IDn = iDn +} + +// WithInterfaceaID adds the interfaceaID to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfaceaID(interfaceaID *string) *WirelessWirelessLinksListParams { + o.SetInterfaceaID(interfaceaID) + return o +} + +// SetInterfaceaID adds the interfaceAId to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfaceaID(interfaceaID *string) { + o.InterfaceaID = interfaceaID +} + +// WithInterfaceaIDGt adds the interfaceaIDGt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfaceaIDGt(interfaceaIDGt *string) *WirelessWirelessLinksListParams { + o.SetInterfaceaIDGt(interfaceaIDGt) + return o +} + +// SetInterfaceaIDGt adds the interfaceAIdGt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfaceaIDGt(interfaceaIDGt *string) { + o.InterfaceaIDGt = interfaceaIDGt +} + +// WithInterfaceaIDGte adds the interfaceaIDGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfaceaIDGte(interfaceaIDGte *string) *WirelessWirelessLinksListParams { + o.SetInterfaceaIDGte(interfaceaIDGte) + return o +} + +// SetInterfaceaIDGte adds the interfaceAIdGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfaceaIDGte(interfaceaIDGte *string) { + o.InterfaceaIDGte = interfaceaIDGte +} + +// WithInterfaceaIDLt adds the interfaceaIDLt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfaceaIDLt(interfaceaIDLt *string) *WirelessWirelessLinksListParams { + o.SetInterfaceaIDLt(interfaceaIDLt) + return o +} + +// SetInterfaceaIDLt adds the interfaceAIdLt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfaceaIDLt(interfaceaIDLt *string) { + o.InterfaceaIDLt = interfaceaIDLt +} + +// WithInterfaceaIDLte adds the interfaceaIDLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfaceaIDLte(interfaceaIDLte *string) *WirelessWirelessLinksListParams { + o.SetInterfaceaIDLte(interfaceaIDLte) + return o +} + +// SetInterfaceaIDLte adds the interfaceAIdLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfaceaIDLte(interfaceaIDLte *string) { + o.InterfaceaIDLte = interfaceaIDLte +} + +// WithInterfaceaIDn adds the interfaceaIDn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfaceaIDn(interfaceaIDn *string) *WirelessWirelessLinksListParams { + o.SetInterfaceaIDn(interfaceaIDn) + return o +} + +// SetInterfaceaIDn adds the interfaceAIdN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfaceaIDn(interfaceaIDn *string) { + o.InterfaceaIDn = interfaceaIDn +} + +// WithInterfacebID adds the interfacebID to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfacebID(interfacebID *string) *WirelessWirelessLinksListParams { + o.SetInterfacebID(interfacebID) + return o +} + +// SetInterfacebID adds the interfaceBId to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfacebID(interfacebID *string) { + o.InterfacebID = interfacebID +} + +// WithInterfacebIDGt adds the interfacebIDGt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfacebIDGt(interfacebIDGt *string) *WirelessWirelessLinksListParams { + o.SetInterfacebIDGt(interfacebIDGt) + return o +} + +// SetInterfacebIDGt adds the interfaceBIdGt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfacebIDGt(interfacebIDGt *string) { + o.InterfacebIDGt = interfacebIDGt +} + +// WithInterfacebIDGte adds the interfacebIDGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfacebIDGte(interfacebIDGte *string) *WirelessWirelessLinksListParams { + o.SetInterfacebIDGte(interfacebIDGte) + return o +} + +// SetInterfacebIDGte adds the interfaceBIdGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfacebIDGte(interfacebIDGte *string) { + o.InterfacebIDGte = interfacebIDGte +} + +// WithInterfacebIDLt adds the interfacebIDLt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfacebIDLt(interfacebIDLt *string) *WirelessWirelessLinksListParams { + o.SetInterfacebIDLt(interfacebIDLt) + return o +} + +// SetInterfacebIDLt adds the interfaceBIdLt to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfacebIDLt(interfacebIDLt *string) { + o.InterfacebIDLt = interfacebIDLt +} + +// WithInterfacebIDLte adds the interfacebIDLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfacebIDLte(interfacebIDLte *string) *WirelessWirelessLinksListParams { + o.SetInterfacebIDLte(interfacebIDLte) + return o +} + +// SetInterfacebIDLte adds the interfaceBIdLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfacebIDLte(interfacebIDLte *string) { + o.InterfacebIDLte = interfacebIDLte +} + +// WithInterfacebIDn adds the interfacebIDn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithInterfacebIDn(interfacebIDn *string) *WirelessWirelessLinksListParams { + o.SetInterfacebIDn(interfacebIDn) + return o +} + +// SetInterfacebIDn adds the interfaceBIdN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetInterfacebIDn(interfacebIDn *string) { + o.InterfacebIDn = interfacebIDn +} + +// WithLastUpdated adds the lastUpdated to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithLastUpdated(lastUpdated *string) *WirelessWirelessLinksListParams { + o.SetLastUpdated(lastUpdated) + return o +} + +// SetLastUpdated adds the lastUpdated to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetLastUpdated(lastUpdated *string) { + o.LastUpdated = lastUpdated +} + +// WithLastUpdatedGte adds the lastUpdatedGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithLastUpdatedGte(lastUpdatedGte *string) *WirelessWirelessLinksListParams { + o.SetLastUpdatedGte(lastUpdatedGte) + return o +} + +// SetLastUpdatedGte adds the lastUpdatedGte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetLastUpdatedGte(lastUpdatedGte *string) { + o.LastUpdatedGte = lastUpdatedGte +} + +// WithLastUpdatedLte adds the lastUpdatedLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithLastUpdatedLte(lastUpdatedLte *string) *WirelessWirelessLinksListParams { + o.SetLastUpdatedLte(lastUpdatedLte) + return o +} + +// SetLastUpdatedLte adds the lastUpdatedLte to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetLastUpdatedLte(lastUpdatedLte *string) { + o.LastUpdatedLte = lastUpdatedLte +} + +// WithLimit adds the limit to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithLimit(limit *int64) *WirelessWirelessLinksListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithOffset(offset *int64) *WirelessWirelessLinksListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithQ(q *string) *WirelessWirelessLinksListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetQ(q *string) { + o.Q = q +} + +// WithSsid adds the ssid to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsid(ssid *string) *WirelessWirelessLinksListParams { + o.SetSsid(ssid) + return o +} + +// SetSsid adds the ssid to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsid(ssid *string) { + o.Ssid = ssid +} + +// WithSsidEmpty adds the ssidEmpty to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidEmpty(ssidEmpty *string) *WirelessWirelessLinksListParams { + o.SetSsidEmpty(ssidEmpty) + return o +} + +// SetSsidEmpty adds the ssidEmpty to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidEmpty(ssidEmpty *string) { + o.SsidEmpty = ssidEmpty +} + +// WithSsidIc adds the ssidIc to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidIc(ssidIc *string) *WirelessWirelessLinksListParams { + o.SetSsidIc(ssidIc) + return o +} + +// SetSsidIc adds the ssidIc to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidIc(ssidIc *string) { + o.SsidIc = ssidIc +} + +// WithSsidIe adds the ssidIe to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidIe(ssidIe *string) *WirelessWirelessLinksListParams { + o.SetSsidIe(ssidIe) + return o +} + +// SetSsidIe adds the ssidIe to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidIe(ssidIe *string) { + o.SsidIe = ssidIe +} + +// WithSsidIew adds the ssidIew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidIew(ssidIew *string) *WirelessWirelessLinksListParams { + o.SetSsidIew(ssidIew) + return o +} + +// SetSsidIew adds the ssidIew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidIew(ssidIew *string) { + o.SsidIew = ssidIew +} + +// WithSsidIsw adds the ssidIsw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidIsw(ssidIsw *string) *WirelessWirelessLinksListParams { + o.SetSsidIsw(ssidIsw) + return o +} + +// SetSsidIsw adds the ssidIsw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidIsw(ssidIsw *string) { + o.SsidIsw = ssidIsw +} + +// WithSsidn adds the ssidn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidn(ssidn *string) *WirelessWirelessLinksListParams { + o.SetSsidn(ssidn) + return o +} + +// SetSsidn adds the ssidN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidn(ssidn *string) { + o.Ssidn = ssidn +} + +// WithSsidNic adds the ssidNic to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidNic(ssidNic *string) *WirelessWirelessLinksListParams { + o.SetSsidNic(ssidNic) + return o +} + +// SetSsidNic adds the ssidNic to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidNic(ssidNic *string) { + o.SsidNic = ssidNic +} + +// WithSsidNie adds the ssidNie to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidNie(ssidNie *string) *WirelessWirelessLinksListParams { + o.SetSsidNie(ssidNie) + return o +} + +// SetSsidNie adds the ssidNie to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidNie(ssidNie *string) { + o.SsidNie = ssidNie +} + +// WithSsidNiew adds the ssidNiew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidNiew(ssidNiew *string) *WirelessWirelessLinksListParams { + o.SetSsidNiew(ssidNiew) + return o +} + +// SetSsidNiew adds the ssidNiew to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidNiew(ssidNiew *string) { + o.SsidNiew = ssidNiew +} + +// WithSsidNisw adds the ssidNisw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithSsidNisw(ssidNisw *string) *WirelessWirelessLinksListParams { + o.SetSsidNisw(ssidNisw) + return o +} + +// SetSsidNisw adds the ssidNisw to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetSsidNisw(ssidNisw *string) { + o.SsidNisw = ssidNisw +} + +// WithStatus adds the status to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithStatus(status *string) *WirelessWirelessLinksListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetStatus(status *string) { + o.Status = status +} + +// WithStatusn adds the statusn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithStatusn(statusn *string) *WirelessWirelessLinksListParams { + o.SetStatusn(statusn) + return o +} + +// SetStatusn adds the statusN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetStatusn(statusn *string) { + o.Statusn = statusn +} + +// WithTag adds the tag to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithTag(tag *string) *WirelessWirelessLinksListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithTagn adds the tagn to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) WithTagn(tagn *string) *WirelessWirelessLinksListParams { + o.SetTagn(tagn) + return o +} + +// SetTagn adds the tagN to the wireless wireless links list params +func (o *WirelessWirelessLinksListParams) SetTagn(tagn *string) { + o.Tagn = tagn +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AuthCipher != nil { + + // query param auth_cipher + var qrAuthCipher string + + if o.AuthCipher != nil { + qrAuthCipher = *o.AuthCipher + } + qAuthCipher := qrAuthCipher + if qAuthCipher != "" { + + if err := r.SetQueryParam("auth_cipher", qAuthCipher); err != nil { + return err + } + } + } + + if o.AuthCiphern != nil { + + // query param auth_cipher__n + var qrAuthCiphern string + + if o.AuthCiphern != nil { + qrAuthCiphern = *o.AuthCiphern + } + qAuthCiphern := qrAuthCiphern + if qAuthCiphern != "" { + + if err := r.SetQueryParam("auth_cipher__n", qAuthCiphern); err != nil { + return err + } + } + } + + if o.AuthPsk != nil { + + // query param auth_psk + var qrAuthPsk string + + if o.AuthPsk != nil { + qrAuthPsk = *o.AuthPsk + } + qAuthPsk := qrAuthPsk + if qAuthPsk != "" { + + if err := r.SetQueryParam("auth_psk", qAuthPsk); err != nil { + return err + } + } + } + + if o.AuthPskEmpty != nil { + + // query param auth_psk__empty + var qrAuthPskEmpty string + + if o.AuthPskEmpty != nil { + qrAuthPskEmpty = *o.AuthPskEmpty + } + qAuthPskEmpty := qrAuthPskEmpty + if qAuthPskEmpty != "" { + + if err := r.SetQueryParam("auth_psk__empty", qAuthPskEmpty); err != nil { + return err + } + } + } + + if o.AuthPskIc != nil { + + // query param auth_psk__ic + var qrAuthPskIc string + + if o.AuthPskIc != nil { + qrAuthPskIc = *o.AuthPskIc + } + qAuthPskIc := qrAuthPskIc + if qAuthPskIc != "" { + + if err := r.SetQueryParam("auth_psk__ic", qAuthPskIc); err != nil { + return err + } + } + } + + if o.AuthPskIe != nil { + + // query param auth_psk__ie + var qrAuthPskIe string + + if o.AuthPskIe != nil { + qrAuthPskIe = *o.AuthPskIe + } + qAuthPskIe := qrAuthPskIe + if qAuthPskIe != "" { + + if err := r.SetQueryParam("auth_psk__ie", qAuthPskIe); err != nil { + return err + } + } + } + + if o.AuthPskIew != nil { + + // query param auth_psk__iew + var qrAuthPskIew string + + if o.AuthPskIew != nil { + qrAuthPskIew = *o.AuthPskIew + } + qAuthPskIew := qrAuthPskIew + if qAuthPskIew != "" { + + if err := r.SetQueryParam("auth_psk__iew", qAuthPskIew); err != nil { + return err + } + } + } + + if o.AuthPskIsw != nil { + + // query param auth_psk__isw + var qrAuthPskIsw string + + if o.AuthPskIsw != nil { + qrAuthPskIsw = *o.AuthPskIsw + } + qAuthPskIsw := qrAuthPskIsw + if qAuthPskIsw != "" { + + if err := r.SetQueryParam("auth_psk__isw", qAuthPskIsw); err != nil { + return err + } + } + } + + if o.AuthPskn != nil { + + // query param auth_psk__n + var qrAuthPskn string + + if o.AuthPskn != nil { + qrAuthPskn = *o.AuthPskn + } + qAuthPskn := qrAuthPskn + if qAuthPskn != "" { + + if err := r.SetQueryParam("auth_psk__n", qAuthPskn); err != nil { + return err + } + } + } + + if o.AuthPskNic != nil { + + // query param auth_psk__nic + var qrAuthPskNic string + + if o.AuthPskNic != nil { + qrAuthPskNic = *o.AuthPskNic + } + qAuthPskNic := qrAuthPskNic + if qAuthPskNic != "" { + + if err := r.SetQueryParam("auth_psk__nic", qAuthPskNic); err != nil { + return err + } + } + } + + if o.AuthPskNie != nil { + + // query param auth_psk__nie + var qrAuthPskNie string + + if o.AuthPskNie != nil { + qrAuthPskNie = *o.AuthPskNie + } + qAuthPskNie := qrAuthPskNie + if qAuthPskNie != "" { + + if err := r.SetQueryParam("auth_psk__nie", qAuthPskNie); err != nil { + return err + } + } + } + + if o.AuthPskNiew != nil { + + // query param auth_psk__niew + var qrAuthPskNiew string + + if o.AuthPskNiew != nil { + qrAuthPskNiew = *o.AuthPskNiew + } + qAuthPskNiew := qrAuthPskNiew + if qAuthPskNiew != "" { + + if err := r.SetQueryParam("auth_psk__niew", qAuthPskNiew); err != nil { + return err + } + } + } + + if o.AuthPskNisw != nil { + + // query param auth_psk__nisw + var qrAuthPskNisw string + + if o.AuthPskNisw != nil { + qrAuthPskNisw = *o.AuthPskNisw + } + qAuthPskNisw := qrAuthPskNisw + if qAuthPskNisw != "" { + + if err := r.SetQueryParam("auth_psk__nisw", qAuthPskNisw); err != nil { + return err + } + } + } + + if o.AuthType != nil { + + // query param auth_type + var qrAuthType string + + if o.AuthType != nil { + qrAuthType = *o.AuthType + } + qAuthType := qrAuthType + if qAuthType != "" { + + if err := r.SetQueryParam("auth_type", qAuthType); err != nil { + return err + } + } + } + + if o.AuthTypen != nil { + + // query param auth_type__n + var qrAuthTypen string + + if o.AuthTypen != nil { + qrAuthTypen = *o.AuthTypen + } + qAuthTypen := qrAuthTypen + if qAuthTypen != "" { + + if err := r.SetQueryParam("auth_type__n", qAuthTypen); err != nil { + return err + } + } + } + + if o.Created != nil { + + // query param created + var qrCreated string + + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + } + + if o.CreatedGte != nil { + + // query param created__gte + var qrCreatedGte string + + if o.CreatedGte != nil { + qrCreatedGte = *o.CreatedGte + } + qCreatedGte := qrCreatedGte + if qCreatedGte != "" { + + if err := r.SetQueryParam("created__gte", qCreatedGte); err != nil { + return err + } + } + } + + if o.CreatedLte != nil { + + // query param created__lte + var qrCreatedLte string + + if o.CreatedLte != nil { + qrCreatedLte = *o.CreatedLte + } + qCreatedLte := qrCreatedLte + if qCreatedLte != "" { + + if err := r.SetQueryParam("created__lte", qCreatedLte); err != nil { + return err + } + } + } + + if o.Description != nil { + + // query param description + var qrDescription string + + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + } + + if o.DescriptionEmpty != nil { + + // query param description__empty + var qrDescriptionEmpty string + + if o.DescriptionEmpty != nil { + qrDescriptionEmpty = *o.DescriptionEmpty + } + qDescriptionEmpty := qrDescriptionEmpty + if qDescriptionEmpty != "" { + + if err := r.SetQueryParam("description__empty", qDescriptionEmpty); err != nil { + return err + } + } + } + + if o.DescriptionIc != nil { + + // query param description__ic + var qrDescriptionIc string + + if o.DescriptionIc != nil { + qrDescriptionIc = *o.DescriptionIc + } + qDescriptionIc := qrDescriptionIc + if qDescriptionIc != "" { + + if err := r.SetQueryParam("description__ic", qDescriptionIc); err != nil { + return err + } + } + } + + if o.DescriptionIe != nil { + + // query param description__ie + var qrDescriptionIe string + + if o.DescriptionIe != nil { + qrDescriptionIe = *o.DescriptionIe + } + qDescriptionIe := qrDescriptionIe + if qDescriptionIe != "" { + + if err := r.SetQueryParam("description__ie", qDescriptionIe); err != nil { + return err + } + } + } + + if o.DescriptionIew != nil { + + // query param description__iew + var qrDescriptionIew string + + if o.DescriptionIew != nil { + qrDescriptionIew = *o.DescriptionIew + } + qDescriptionIew := qrDescriptionIew + if qDescriptionIew != "" { + + if err := r.SetQueryParam("description__iew", qDescriptionIew); err != nil { + return err + } + } + } + + if o.DescriptionIsw != nil { + + // query param description__isw + var qrDescriptionIsw string + + if o.DescriptionIsw != nil { + qrDescriptionIsw = *o.DescriptionIsw + } + qDescriptionIsw := qrDescriptionIsw + if qDescriptionIsw != "" { + + if err := r.SetQueryParam("description__isw", qDescriptionIsw); err != nil { + return err + } + } + } + + if o.Descriptionn != nil { + + // query param description__n + var qrDescriptionn string + + if o.Descriptionn != nil { + qrDescriptionn = *o.Descriptionn + } + qDescriptionn := qrDescriptionn + if qDescriptionn != "" { + + if err := r.SetQueryParam("description__n", qDescriptionn); err != nil { + return err + } + } + } + + if o.DescriptionNic != nil { + + // query param description__nic + var qrDescriptionNic string + + if o.DescriptionNic != nil { + qrDescriptionNic = *o.DescriptionNic + } + qDescriptionNic := qrDescriptionNic + if qDescriptionNic != "" { + + if err := r.SetQueryParam("description__nic", qDescriptionNic); err != nil { + return err + } + } + } + + if o.DescriptionNie != nil { + + // query param description__nie + var qrDescriptionNie string + + if o.DescriptionNie != nil { + qrDescriptionNie = *o.DescriptionNie + } + qDescriptionNie := qrDescriptionNie + if qDescriptionNie != "" { + + if err := r.SetQueryParam("description__nie", qDescriptionNie); err != nil { + return err + } + } + } + + if o.DescriptionNiew != nil { + + // query param description__niew + var qrDescriptionNiew string + + if o.DescriptionNiew != nil { + qrDescriptionNiew = *o.DescriptionNiew + } + qDescriptionNiew := qrDescriptionNiew + if qDescriptionNiew != "" { + + if err := r.SetQueryParam("description__niew", qDescriptionNiew); err != nil { + return err + } + } + } + + if o.DescriptionNisw != nil { + + // query param description__nisw + var qrDescriptionNisw string + + if o.DescriptionNisw != nil { + qrDescriptionNisw = *o.DescriptionNisw + } + qDescriptionNisw := qrDescriptionNisw + if qDescriptionNisw != "" { + + if err := r.SetQueryParam("description__nisw", qDescriptionNisw); err != nil { + return err + } + } + } + + if o.ID != nil { + + // query param id + var qrID string + + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + } + + if o.IDGt != nil { + + // query param id__gt + var qrIDGt string + + if o.IDGt != nil { + qrIDGt = *o.IDGt + } + qIDGt := qrIDGt + if qIDGt != "" { + + if err := r.SetQueryParam("id__gt", qIDGt); err != nil { + return err + } + } + } + + if o.IDGte != nil { + + // query param id__gte + var qrIDGte string + + if o.IDGte != nil { + qrIDGte = *o.IDGte + } + qIDGte := qrIDGte + if qIDGte != "" { + + if err := r.SetQueryParam("id__gte", qIDGte); err != nil { + return err + } + } + } + + if o.IDLt != nil { + + // query param id__lt + var qrIDLt string + + if o.IDLt != nil { + qrIDLt = *o.IDLt + } + qIDLt := qrIDLt + if qIDLt != "" { + + if err := r.SetQueryParam("id__lt", qIDLt); err != nil { + return err + } + } + } + + if o.IDLte != nil { + + // query param id__lte + var qrIDLte string + + if o.IDLte != nil { + qrIDLte = *o.IDLte + } + qIDLte := qrIDLte + if qIDLte != "" { + + if err := r.SetQueryParam("id__lte", qIDLte); err != nil { + return err + } + } + } + + if o.IDn != nil { + + // query param id__n + var qrIDn string + + if o.IDn != nil { + qrIDn = *o.IDn + } + qIDn := qrIDn + if qIDn != "" { + + if err := r.SetQueryParam("id__n", qIDn); err != nil { + return err + } + } + } + + if o.InterfaceaID != nil { + + // query param interface_a_id + var qrInterfaceaID string + + if o.InterfaceaID != nil { + qrInterfaceaID = *o.InterfaceaID + } + qInterfaceaID := qrInterfaceaID + if qInterfaceaID != "" { + + if err := r.SetQueryParam("interface_a_id", qInterfaceaID); err != nil { + return err + } + } + } + + if o.InterfaceaIDGt != nil { + + // query param interface_a_id__gt + var qrInterfaceaIDGt string + + if o.InterfaceaIDGt != nil { + qrInterfaceaIDGt = *o.InterfaceaIDGt + } + qInterfaceaIDGt := qrInterfaceaIDGt + if qInterfaceaIDGt != "" { + + if err := r.SetQueryParam("interface_a_id__gt", qInterfaceaIDGt); err != nil { + return err + } + } + } + + if o.InterfaceaIDGte != nil { + + // query param interface_a_id__gte + var qrInterfaceaIDGte string + + if o.InterfaceaIDGte != nil { + qrInterfaceaIDGte = *o.InterfaceaIDGte + } + qInterfaceaIDGte := qrInterfaceaIDGte + if qInterfaceaIDGte != "" { + + if err := r.SetQueryParam("interface_a_id__gte", qInterfaceaIDGte); err != nil { + return err + } + } + } + + if o.InterfaceaIDLt != nil { + + // query param interface_a_id__lt + var qrInterfaceaIDLt string + + if o.InterfaceaIDLt != nil { + qrInterfaceaIDLt = *o.InterfaceaIDLt + } + qInterfaceaIDLt := qrInterfaceaIDLt + if qInterfaceaIDLt != "" { + + if err := r.SetQueryParam("interface_a_id__lt", qInterfaceaIDLt); err != nil { + return err + } + } + } + + if o.InterfaceaIDLte != nil { + + // query param interface_a_id__lte + var qrInterfaceaIDLte string + + if o.InterfaceaIDLte != nil { + qrInterfaceaIDLte = *o.InterfaceaIDLte + } + qInterfaceaIDLte := qrInterfaceaIDLte + if qInterfaceaIDLte != "" { + + if err := r.SetQueryParam("interface_a_id__lte", qInterfaceaIDLte); err != nil { + return err + } + } + } + + if o.InterfaceaIDn != nil { + + // query param interface_a_id__n + var qrInterfaceaIDn string + + if o.InterfaceaIDn != nil { + qrInterfaceaIDn = *o.InterfaceaIDn + } + qInterfaceaIDn := qrInterfaceaIDn + if qInterfaceaIDn != "" { + + if err := r.SetQueryParam("interface_a_id__n", qInterfaceaIDn); err != nil { + return err + } + } + } + + if o.InterfacebID != nil { + + // query param interface_b_id + var qrInterfacebID string + + if o.InterfacebID != nil { + qrInterfacebID = *o.InterfacebID + } + qInterfacebID := qrInterfacebID + if qInterfacebID != "" { + + if err := r.SetQueryParam("interface_b_id", qInterfacebID); err != nil { + return err + } + } + } + + if o.InterfacebIDGt != nil { + + // query param interface_b_id__gt + var qrInterfacebIDGt string + + if o.InterfacebIDGt != nil { + qrInterfacebIDGt = *o.InterfacebIDGt + } + qInterfacebIDGt := qrInterfacebIDGt + if qInterfacebIDGt != "" { + + if err := r.SetQueryParam("interface_b_id__gt", qInterfacebIDGt); err != nil { + return err + } + } + } + + if o.InterfacebIDGte != nil { + + // query param interface_b_id__gte + var qrInterfacebIDGte string + + if o.InterfacebIDGte != nil { + qrInterfacebIDGte = *o.InterfacebIDGte + } + qInterfacebIDGte := qrInterfacebIDGte + if qInterfacebIDGte != "" { + + if err := r.SetQueryParam("interface_b_id__gte", qInterfacebIDGte); err != nil { + return err + } + } + } + + if o.InterfacebIDLt != nil { + + // query param interface_b_id__lt + var qrInterfacebIDLt string + + if o.InterfacebIDLt != nil { + qrInterfacebIDLt = *o.InterfacebIDLt + } + qInterfacebIDLt := qrInterfacebIDLt + if qInterfacebIDLt != "" { + + if err := r.SetQueryParam("interface_b_id__lt", qInterfacebIDLt); err != nil { + return err + } + } + } + + if o.InterfacebIDLte != nil { + + // query param interface_b_id__lte + var qrInterfacebIDLte string + + if o.InterfacebIDLte != nil { + qrInterfacebIDLte = *o.InterfacebIDLte + } + qInterfacebIDLte := qrInterfacebIDLte + if qInterfacebIDLte != "" { + + if err := r.SetQueryParam("interface_b_id__lte", qInterfacebIDLte); err != nil { + return err + } + } + } + + if o.InterfacebIDn != nil { + + // query param interface_b_id__n + var qrInterfacebIDn string + + if o.InterfacebIDn != nil { + qrInterfacebIDn = *o.InterfacebIDn + } + qInterfacebIDn := qrInterfacebIDn + if qInterfacebIDn != "" { + + if err := r.SetQueryParam("interface_b_id__n", qInterfacebIDn); err != nil { + return err + } + } + } + + if o.LastUpdated != nil { + + // query param last_updated + var qrLastUpdated string + + if o.LastUpdated != nil { + qrLastUpdated = *o.LastUpdated + } + qLastUpdated := qrLastUpdated + if qLastUpdated != "" { + + if err := r.SetQueryParam("last_updated", qLastUpdated); err != nil { + return err + } + } + } + + if o.LastUpdatedGte != nil { + + // query param last_updated__gte + var qrLastUpdatedGte string + + if o.LastUpdatedGte != nil { + qrLastUpdatedGte = *o.LastUpdatedGte + } + qLastUpdatedGte := qrLastUpdatedGte + if qLastUpdatedGte != "" { + + if err := r.SetQueryParam("last_updated__gte", qLastUpdatedGte); err != nil { + return err + } + } + } + + if o.LastUpdatedLte != nil { + + // query param last_updated__lte + var qrLastUpdatedLte string + + if o.LastUpdatedLte != nil { + qrLastUpdatedLte = *o.LastUpdatedLte + } + qLastUpdatedLte := qrLastUpdatedLte + if qLastUpdatedLte != "" { + + if err := r.SetQueryParam("last_updated__lte", qLastUpdatedLte); err != nil { + return err + } + } + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + } + + if o.Q != nil { + + // query param q + var qrQ string + + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + } + + if o.Ssid != nil { + + // query param ssid + var qrSsid string + + if o.Ssid != nil { + qrSsid = *o.Ssid + } + qSsid := qrSsid + if qSsid != "" { + + if err := r.SetQueryParam("ssid", qSsid); err != nil { + return err + } + } + } + + if o.SsidEmpty != nil { + + // query param ssid__empty + var qrSsidEmpty string + + if o.SsidEmpty != nil { + qrSsidEmpty = *o.SsidEmpty + } + qSsidEmpty := qrSsidEmpty + if qSsidEmpty != "" { + + if err := r.SetQueryParam("ssid__empty", qSsidEmpty); err != nil { + return err + } + } + } + + if o.SsidIc != nil { + + // query param ssid__ic + var qrSsidIc string + + if o.SsidIc != nil { + qrSsidIc = *o.SsidIc + } + qSsidIc := qrSsidIc + if qSsidIc != "" { + + if err := r.SetQueryParam("ssid__ic", qSsidIc); err != nil { + return err + } + } + } + + if o.SsidIe != nil { + + // query param ssid__ie + var qrSsidIe string + + if o.SsidIe != nil { + qrSsidIe = *o.SsidIe + } + qSsidIe := qrSsidIe + if qSsidIe != "" { + + if err := r.SetQueryParam("ssid__ie", qSsidIe); err != nil { + return err + } + } + } + + if o.SsidIew != nil { + + // query param ssid__iew + var qrSsidIew string + + if o.SsidIew != nil { + qrSsidIew = *o.SsidIew + } + qSsidIew := qrSsidIew + if qSsidIew != "" { + + if err := r.SetQueryParam("ssid__iew", qSsidIew); err != nil { + return err + } + } + } + + if o.SsidIsw != nil { + + // query param ssid__isw + var qrSsidIsw string + + if o.SsidIsw != nil { + qrSsidIsw = *o.SsidIsw + } + qSsidIsw := qrSsidIsw + if qSsidIsw != "" { + + if err := r.SetQueryParam("ssid__isw", qSsidIsw); err != nil { + return err + } + } + } + + if o.Ssidn != nil { + + // query param ssid__n + var qrSsidn string + + if o.Ssidn != nil { + qrSsidn = *o.Ssidn + } + qSsidn := qrSsidn + if qSsidn != "" { + + if err := r.SetQueryParam("ssid__n", qSsidn); err != nil { + return err + } + } + } + + if o.SsidNic != nil { + + // query param ssid__nic + var qrSsidNic string + + if o.SsidNic != nil { + qrSsidNic = *o.SsidNic + } + qSsidNic := qrSsidNic + if qSsidNic != "" { + + if err := r.SetQueryParam("ssid__nic", qSsidNic); err != nil { + return err + } + } + } + + if o.SsidNie != nil { + + // query param ssid__nie + var qrSsidNie string + + if o.SsidNie != nil { + qrSsidNie = *o.SsidNie + } + qSsidNie := qrSsidNie + if qSsidNie != "" { + + if err := r.SetQueryParam("ssid__nie", qSsidNie); err != nil { + return err + } + } + } + + if o.SsidNiew != nil { + + // query param ssid__niew + var qrSsidNiew string + + if o.SsidNiew != nil { + qrSsidNiew = *o.SsidNiew + } + qSsidNiew := qrSsidNiew + if qSsidNiew != "" { + + if err := r.SetQueryParam("ssid__niew", qSsidNiew); err != nil { + return err + } + } + } + + if o.SsidNisw != nil { + + // query param ssid__nisw + var qrSsidNisw string + + if o.SsidNisw != nil { + qrSsidNisw = *o.SsidNisw + } + qSsidNisw := qrSsidNisw + if qSsidNisw != "" { + + if err := r.SetQueryParam("ssid__nisw", qSsidNisw); err != nil { + return err + } + } + } + + if o.Status != nil { + + // query param status + var qrStatus string + + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + } + + if o.Statusn != nil { + + // query param status__n + var qrStatusn string + + if o.Statusn != nil { + qrStatusn = *o.Statusn + } + qStatusn := qrStatusn + if qStatusn != "" { + + if err := r.SetQueryParam("status__n", qStatusn); err != nil { + return err + } + } + } + + if o.Tag != nil { + + // query param tag + var qrTag string + + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + } + + if o.Tagn != nil { + + // query param tag__n + var qrTagn string + + if o.Tagn != nil { + qrTagn = *o.Tagn + } + qTagn := qrTagn + if qTagn != "" { + + if err := r.SetQueryParam("tag__n", qTagn); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_responses.go new file mode 100644 index 000000000..1e0de2ed8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_list_responses.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLinksListReader is a Reader for the WirelessWirelessLinksList structure. +type WirelessWirelessLinksListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLinksListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksListOK creates a WirelessWirelessLinksListOK with default headers values +func NewWirelessWirelessLinksListOK() *WirelessWirelessLinksListOK { + return &WirelessWirelessLinksListOK{} +} + +/* WirelessWirelessLinksListOK describes a response with status code 200, with default header values. + +WirelessWirelessLinksListOK wireless wireless links list o k +*/ +type WirelessWirelessLinksListOK struct { + Payload *WirelessWirelessLinksListOKBody +} + +func (o *WirelessWirelessLinksListOK) Error() string { + return fmt.Sprintf("[GET /wireless/wireless-links/][%d] wirelessWirelessLinksListOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLinksListOK) GetPayload() *WirelessWirelessLinksListOKBody { + return o.Payload +} + +func (o *WirelessWirelessLinksListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(WirelessWirelessLinksListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*WirelessWirelessLinksListOKBody wireless wireless links list o k body +swagger:model WirelessWirelessLinksListOKBody +*/ +type WirelessWirelessLinksListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.WirelessLink `json:"results"` +} + +// Validate validates this wireless wireless links list o k body +func (o *WirelessWirelessLinksListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *WirelessWirelessLinksListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("wirelessWirelessLinksListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLinksListOKBody) validateNext(formats strfmt.Registry) error { + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("wirelessWirelessLinksListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLinksListOKBody) validatePrevious(formats strfmt.Registry) error { + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("wirelessWirelessLinksListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *WirelessWirelessLinksListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("wirelessWirelessLinksListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wirelessWirelessLinksListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wirelessWirelessLinksListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this wireless wireless links list o k body based on the context it is used +func (o *WirelessWirelessLinksListOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateResults(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *WirelessWirelessLinksListOKBody) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Results); i++ { + + if o.Results[i] != nil { + if err := o.Results[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wirelessWirelessLinksListOK" + "." + "results" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wirelessWirelessLinksListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *WirelessWirelessLinksListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *WirelessWirelessLinksListOKBody) UnmarshalBinary(b []byte) error { + var res WirelessWirelessLinksListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_parameters.go new file mode 100644 index 000000000..2e8ed8534 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLinksPartialUpdateParams creates a new WirelessWirelessLinksPartialUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksPartialUpdateParams() *WirelessWirelessLinksPartialUpdateParams { + return &WirelessWirelessLinksPartialUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksPartialUpdateParamsWithTimeout creates a new WirelessWirelessLinksPartialUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksPartialUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksPartialUpdateParams { + return &WirelessWirelessLinksPartialUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksPartialUpdateParamsWithContext creates a new WirelessWirelessLinksPartialUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksPartialUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLinksPartialUpdateParams { + return &WirelessWirelessLinksPartialUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksPartialUpdateParamsWithHTTPClient creates a new WirelessWirelessLinksPartialUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksPartialUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksPartialUpdateParams { + return &WirelessWirelessLinksPartialUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksPartialUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless links partial update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksPartialUpdateParams struct { + + // Data. + Data *models.WritableWirelessLink + + /* ID. + + A unique integer value identifying this wireless link. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksPartialUpdateParams) WithDefaults() *WirelessWirelessLinksPartialUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links partial update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksPartialUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLinksPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) WithData(data *models.WritableWirelessLink) *WirelessWirelessLinksPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) SetData(data *models.WritableWirelessLink) { + o.Data = data +} + +// WithID adds the id to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) WithID(id int64) *WirelessWirelessLinksPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless links partial update params +func (o *WirelessWirelessLinksPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_responses.go new file mode 100644 index 000000000..9a011c053 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_partial_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLinksPartialUpdateReader is a Reader for the WirelessWirelessLinksPartialUpdate structure. +type WirelessWirelessLinksPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLinksPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksPartialUpdateOK creates a WirelessWirelessLinksPartialUpdateOK with default headers values +func NewWirelessWirelessLinksPartialUpdateOK() *WirelessWirelessLinksPartialUpdateOK { + return &WirelessWirelessLinksPartialUpdateOK{} +} + +/* WirelessWirelessLinksPartialUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLinksPartialUpdateOK wireless wireless links partial update o k +*/ +type WirelessWirelessLinksPartialUpdateOK struct { + Payload *models.WirelessLink +} + +func (o *WirelessWirelessLinksPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /wireless/wireless-links/{id}/][%d] wirelessWirelessLinksPartialUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLinksPartialUpdateOK) GetPayload() *models.WirelessLink { + return o.Payload +} + +func (o *WirelessWirelessLinksPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLink) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_parameters.go new file mode 100644 index 000000000..cb4bb8807 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewWirelessWirelessLinksReadParams creates a new WirelessWirelessLinksReadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksReadParams() *WirelessWirelessLinksReadParams { + return &WirelessWirelessLinksReadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksReadParamsWithTimeout creates a new WirelessWirelessLinksReadParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksReadParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksReadParams { + return &WirelessWirelessLinksReadParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksReadParamsWithContext creates a new WirelessWirelessLinksReadParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksReadParamsWithContext(ctx context.Context) *WirelessWirelessLinksReadParams { + return &WirelessWirelessLinksReadParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksReadParamsWithHTTPClient creates a new WirelessWirelessLinksReadParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksReadParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksReadParams { + return &WirelessWirelessLinksReadParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksReadParams contains all the parameters to send to the API endpoint + for the wireless wireless links read operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksReadParams struct { + + /* ID. + + A unique integer value identifying this wireless link. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksReadParams) WithDefaults() *WirelessWirelessLinksReadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links read params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksReadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) WithContext(ctx context.Context) *WirelessWirelessLinksReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) WithID(id int64) *WirelessWirelessLinksReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless links read params +func (o *WirelessWirelessLinksReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_responses.go new file mode 100644 index 000000000..4fa0499ea --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_read_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLinksReadReader is a Reader for the WirelessWirelessLinksRead structure. +type WirelessWirelessLinksReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLinksReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksReadOK creates a WirelessWirelessLinksReadOK with default headers values +func NewWirelessWirelessLinksReadOK() *WirelessWirelessLinksReadOK { + return &WirelessWirelessLinksReadOK{} +} + +/* WirelessWirelessLinksReadOK describes a response with status code 200, with default header values. + +WirelessWirelessLinksReadOK wireless wireless links read o k +*/ +type WirelessWirelessLinksReadOK struct { + Payload *models.WirelessLink +} + +func (o *WirelessWirelessLinksReadOK) Error() string { + return fmt.Sprintf("[GET /wireless/wireless-links/{id}/][%d] wirelessWirelessLinksReadOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLinksReadOK) GetPayload() *models.WirelessLink { + return o.Payload +} + +func (o *WirelessWirelessLinksReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLink) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_parameters.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_parameters.go new file mode 100644 index 000000000..819504d5d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_parameters.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/smutel/go-netbox/netbox/models" +) + +// NewWirelessWirelessLinksUpdateParams creates a new WirelessWirelessLinksUpdateParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewWirelessWirelessLinksUpdateParams() *WirelessWirelessLinksUpdateParams { + return &WirelessWirelessLinksUpdateParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewWirelessWirelessLinksUpdateParamsWithTimeout creates a new WirelessWirelessLinksUpdateParams object +// with the ability to set a timeout on a request. +func NewWirelessWirelessLinksUpdateParamsWithTimeout(timeout time.Duration) *WirelessWirelessLinksUpdateParams { + return &WirelessWirelessLinksUpdateParams{ + timeout: timeout, + } +} + +// NewWirelessWirelessLinksUpdateParamsWithContext creates a new WirelessWirelessLinksUpdateParams object +// with the ability to set a context for a request. +func NewWirelessWirelessLinksUpdateParamsWithContext(ctx context.Context) *WirelessWirelessLinksUpdateParams { + return &WirelessWirelessLinksUpdateParams{ + Context: ctx, + } +} + +// NewWirelessWirelessLinksUpdateParamsWithHTTPClient creates a new WirelessWirelessLinksUpdateParams object +// with the ability to set a custom HTTPClient for a request. +func NewWirelessWirelessLinksUpdateParamsWithHTTPClient(client *http.Client) *WirelessWirelessLinksUpdateParams { + return &WirelessWirelessLinksUpdateParams{ + HTTPClient: client, + } +} + +/* WirelessWirelessLinksUpdateParams contains all the parameters to send to the API endpoint + for the wireless wireless links update operation. + + Typically these are written to a http.Request. +*/ +type WirelessWirelessLinksUpdateParams struct { + + // Data. + Data *models.WritableWirelessLink + + /* ID. + + A unique integer value identifying this wireless link. + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the wireless wireless links update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksUpdateParams) WithDefaults() *WirelessWirelessLinksUpdateParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the wireless wireless links update params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *WirelessWirelessLinksUpdateParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) WithTimeout(timeout time.Duration) *WirelessWirelessLinksUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) WithContext(ctx context.Context) *WirelessWirelessLinksUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) WithHTTPClient(client *http.Client) *WirelessWirelessLinksUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) WithData(data *models.WritableWirelessLink) *WirelessWirelessLinksUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) SetData(data *models.WritableWirelessLink) { + o.Data = data +} + +// WithID adds the id to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) WithID(id int64) *WirelessWirelessLinksUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the wireless wireless links update params +func (o *WirelessWirelessLinksUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *WirelessWirelessLinksUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_responses.go b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_responses.go new file mode 100644 index 000000000..7cfaf7e69 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/client/wireless/wireless_wireless_links_update_responses.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package wireless + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/smutel/go-netbox/netbox/models" +) + +// WirelessWirelessLinksUpdateReader is a Reader for the WirelessWirelessLinksUpdate structure. +type WirelessWirelessLinksUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *WirelessWirelessLinksUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewWirelessWirelessLinksUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewWirelessWirelessLinksUpdateOK creates a WirelessWirelessLinksUpdateOK with default headers values +func NewWirelessWirelessLinksUpdateOK() *WirelessWirelessLinksUpdateOK { + return &WirelessWirelessLinksUpdateOK{} +} + +/* WirelessWirelessLinksUpdateOK describes a response with status code 200, with default header values. + +WirelessWirelessLinksUpdateOK wireless wireless links update o k +*/ +type WirelessWirelessLinksUpdateOK struct { + Payload *models.WirelessLink +} + +func (o *WirelessWirelessLinksUpdateOK) Error() string { + return fmt.Sprintf("[PUT /wireless/wireless-links/{id}/][%d] wirelessWirelessLinksUpdateOK %+v", 200, o.Payload) +} +func (o *WirelessWirelessLinksUpdateOK) GetPayload() *models.WirelessLink { + return o.Payload +} + +func (o *WirelessWirelessLinksUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WirelessLink) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/a_s_n.go b/vendor/github.com/smutel/go-netbox/netbox/models/a_s_n.go new file mode 100644 index 000000000..96b796ece --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/a_s_n.go @@ -0,0 +1,400 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ASN a s n +// +// swagger:model ASN +type ASN struct { + + // ASN + // + // 32-bit autonomous system number + // Required: true + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn *int64 `json:"asn"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // RIR + // Required: true + Rir *int64 `json:"rir"` + + // Site count + // Read Only: true + SiteCount int64 `json:"site_count,omitempty"` + + // tags + Tags []*NestedTag `json:"tags"` + + // tenant + Tenant *NestedTenant `json:"tenant,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this a s n +func (m *ASN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAsn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRir(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ASN) validateAsn(formats strfmt.Registry) error { + + if err := validate.Required("asn", "body", m.Asn); err != nil { + return err + } + + if err := validate.MinimumInt("asn", "body", *m.Asn, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", *m.Asn, 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *ASN) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ASN) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *ASN) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ASN) validateRir(formats strfmt.Registry) error { + + if err := validate.Required("rir", "body", m.Rir); err != nil { + return err + } + + return nil +} + +func (m *ASN) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ASN) validateTenant(formats strfmt.Registry) error { + if swag.IsZero(m.Tenant) { // not required + return nil + } + + if m.Tenant != nil { + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *ASN) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this a s n based on the context it is used +func (m *ASN) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSiteCount(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenant(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ASN) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *ASN) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *ASN) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ASN) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *ASN) contextValidateSiteCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "site_count", "body", int64(m.SiteCount)); err != nil { + return err + } + + return nil +} + +func (m *ASN) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ASN) contextValidateTenant(ctx context.Context, formats strfmt.Registry) error { + + if m.Tenant != nil { + if err := m.Tenant.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *ASN) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ASN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ASN) UnmarshalBinary(b []byte) error { + var res ASN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/cable.go b/vendor/github.com/smutel/go-netbox/netbox/models/cable.go index b434313dd..038df4700 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/cable.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/cable.go @@ -41,6 +41,11 @@ type Cable struct { // Pattern: ^[0-9a-f]{6}$ Color string `json:"color,omitempty"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -56,6 +61,11 @@ type Cable struct { // Max Length: 100 Label string `json:"label,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Length Length *float64 `json:"length,omitempty"` @@ -68,6 +78,9 @@ type Cable struct { // tags Tags []*NestedTag `json:"tags"` + // tenant + Tenant *NestedTenant `json:"tenant,omitempty"` + // Termination a // Read Only: true Terminationa map[string]*string `json:"termination_a,omitempty"` @@ -114,10 +127,18 @@ func (m *Cable) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateLabel(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateLengthUnit(formats); err != nil { res = append(res, err) } @@ -130,6 +151,10 @@ func (m *Cable) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTenant(formats); err != nil { + res = append(res, err) + } + if err := m.validateTerminationaID(formats); err != nil { res = append(res, err) } @@ -176,6 +201,18 @@ func (m *Cable) validateColor(formats strfmt.Registry) error { return nil } +func (m *Cable) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Cable) validateLabel(formats strfmt.Registry) error { if swag.IsZero(m.Label) { // not required return nil @@ -188,6 +225,18 @@ func (m *Cable) validateLabel(formats strfmt.Registry) error { return nil } +func (m *Cable) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Cable) validateLengthUnit(formats strfmt.Registry) error { if swag.IsZero(m.LengthUnit) { // not required return nil @@ -252,6 +301,25 @@ func (m *Cable) validateTags(formats strfmt.Registry) error { return nil } +func (m *Cable) validateTenant(formats strfmt.Registry) error { + if swag.IsZero(m.Tenant) { // not required + return nil + } + + if m.Tenant != nil { + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenant") + } + return err + } + } + + return nil +} + func (m *Cable) validateTerminationaID(formats strfmt.Registry) error { if err := validate.Required("termination_a_id", "body", m.TerminationaID); err != nil { @@ -425,6 +493,10 @@ func (m *Cable) validateURL(formats strfmt.Registry) error { func (m *Cable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -433,6 +505,10 @@ func (m *Cable) ContextValidate(ctx context.Context, formats strfmt.Registry) er res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateLengthUnit(ctx, formats); err != nil { res = append(res, err) } @@ -445,6 +521,10 @@ func (m *Cable) ContextValidate(ctx context.Context, formats strfmt.Registry) er res = append(res, err) } + if err := m.contextValidateTenant(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTerminationa(ctx, formats); err != nil { res = append(res, err) } @@ -463,6 +543,15 @@ func (m *Cable) ContextValidate(ctx context.Context, formats strfmt.Registry) er return nil } +func (m *Cable) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *Cable) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -481,6 +570,15 @@ func (m *Cable) contextValidateID(ctx context.Context, formats strfmt.Registry) return nil } +func (m *Cable) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *Cable) contextValidateLengthUnit(ctx context.Context, formats strfmt.Registry) error { if m.LengthUnit != nil { @@ -533,6 +631,22 @@ func (m *Cable) contextValidateTags(ctx context.Context, formats strfmt.Registry return nil } +func (m *Cable) contextValidateTenant(ctx context.Context, formats strfmt.Registry) error { + + if m.Tenant != nil { + if err := m.Tenant.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenant") + } + return err + } + } + + return nil +} + func (m *Cable) contextValidateTerminationa(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/circuit_termination.go b/vendor/github.com/smutel/go-netbox/netbox/models/circuit_termination.go index 7fea11c85..bd0326d69 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/circuit_termination.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/circuit_termination.go @@ -42,22 +42,15 @@ type CircuitTermination struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // circuit // Required: true Circuit *NestedCircuit `json:"circuit"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Description // Max Length: 200 Description string `json:"description,omitempty"` @@ -70,6 +63,23 @@ type CircuitTermination struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -124,10 +134,18 @@ func (m *CircuitTermination) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validatePortSpeed(formats); err != nil { res = append(res, err) } @@ -205,6 +223,18 @@ func (m *CircuitTermination) validateCircuit(formats strfmt.Registry) error { return nil } +func (m *CircuitTermination) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *CircuitTermination) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required return nil @@ -217,6 +247,18 @@ func (m *CircuitTermination) validateDescription(formats strfmt.Registry) error return nil } +func (m *CircuitTermination) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *CircuitTermination) validatePortSpeed(formats strfmt.Registry) error { if swag.IsZero(m.PortSpeed) { // not required return nil @@ -378,23 +420,31 @@ func (m *CircuitTermination) ContextValidate(ctx context.Context, formats strfmt res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { + if err := m.contextValidateCircuit(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { + if err := m.contextValidateCreated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCircuit(ctx, formats); err != nil { + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDisplay(ctx, formats); err != nil { + if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateID(ctx, formats); err != nil { + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { res = append(res, err) } @@ -441,20 +491,6 @@ func (m *CircuitTermination) contextValidateCable(ctx context.Context, formats s return nil } -func (m *CircuitTermination) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CircuitTermination) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *CircuitTermination) contextValidateCircuit(ctx context.Context, formats strfmt.Registry) error { if m.Circuit != nil { @@ -471,6 +507,15 @@ func (m *CircuitTermination) contextValidateCircuit(ctx context.Context, formats return nil } +func (m *CircuitTermination) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *CircuitTermination) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -489,6 +534,29 @@ func (m *CircuitTermination) contextValidateID(ctx context.Context, formats strf return nil } +func (m *CircuitTermination) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CircuitTermination) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *CircuitTermination) contextValidateProviderNetwork(ctx context.Context, formats strfmt.Registry) error { if m.ProviderNetwork != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/circuit_type.go b/vendor/github.com/smutel/go-netbox/netbox/models/circuit_type.go index 0acaaf8cc..f18913911 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/circuit_type.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/circuit_type.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -76,6 +77,9 @@ type CircuitType struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -106,6 +110,10 @@ func (m *CircuitType) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -190,6 +198,32 @@ func (m *CircuitType) validateSlug(formats strfmt.Registry) error { return nil } +func (m *CircuitType) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *CircuitType) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -226,6 +260,10 @@ func (m *CircuitType) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -281,6 +319,26 @@ func (m *CircuitType) contextValidateLastUpdated(ctx context.Context, formats st return nil } +func (m *CircuitType) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *CircuitType) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/cluster_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/cluster_group.go index afd75ddd2..14a749ee0 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/cluster_group.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/cluster_group.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -76,6 +77,9 @@ type ClusterGroup struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -106,6 +110,10 @@ func (m *ClusterGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -190,6 +198,32 @@ func (m *ClusterGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *ClusterGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *ClusterGroup) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -226,6 +260,10 @@ func (m *ClusterGroup) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -281,6 +319,26 @@ func (m *ClusterGroup) contextValidateLastUpdated(ctx context.Context, formats s return nil } +func (m *ClusterGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *ClusterGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/cluster_type.go b/vendor/github.com/smutel/go-netbox/netbox/models/cluster_type.go index 4f2f71040..854d072b6 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/cluster_type.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/cluster_type.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -76,6 +77,9 @@ type ClusterType struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -106,6 +110,10 @@ func (m *ClusterType) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -190,6 +198,32 @@ func (m *ClusterType) validateSlug(formats strfmt.Registry) error { return nil } +func (m *ClusterType) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *ClusterType) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -226,6 +260,10 @@ func (m *ClusterType) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -281,6 +319,26 @@ func (m *ClusterType) contextValidateLastUpdated(ctx context.Context, formats st return nil } +func (m *ClusterType) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *ClusterType) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/console_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/console_port.go index 21d0a8da8..61f7dc8c1 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/console_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/console_port.go @@ -43,18 +43,6 @@ type ConsolePort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -106,6 +94,18 @@ type ConsolePort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -378,14 +378,6 @@ func (m *ConsolePort) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -418,6 +410,14 @@ func (m *ConsolePort) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSpeed(ctx, formats); err != nil { res = append(res, err) } @@ -465,20 +465,6 @@ func (m *ConsolePort) contextValidateCable(ctx context.Context, formats strfmt.R return nil } -func (m *ConsolePort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *ConsolePort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *ConsolePort) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -554,6 +540,20 @@ func (m *ConsolePort) contextValidateLastUpdated(ctx context.Context, formats st return nil } +func (m *ConsolePort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *ConsolePort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *ConsolePort) contextValidateSpeed(ctx context.Context, formats strfmt.Registry) error { if m.Speed != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/console_server_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/console_server_port.go index 63b73142d..9d1ec0167 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/console_server_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/console_server_port.go @@ -43,18 +43,6 @@ type ConsoleServerPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -106,6 +94,18 @@ type ConsoleServerPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -378,14 +378,6 @@ func (m *ConsoleServerPort) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -418,6 +410,14 @@ func (m *ConsoleServerPort) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateSpeed(ctx, formats); err != nil { res = append(res, err) } @@ -465,20 +465,6 @@ func (m *ConsoleServerPort) contextValidateCable(ctx context.Context, formats st return nil } -func (m *ConsoleServerPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *ConsoleServerPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *ConsoleServerPort) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -554,6 +540,20 @@ func (m *ConsoleServerPort) contextValidateLastUpdated(ctx context.Context, form return nil } +func (m *ConsoleServerPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *ConsoleServerPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *ConsoleServerPort) contextValidateSpeed(ctx context.Context, formats strfmt.Registry) error { if m.Speed != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/contact.go b/vendor/github.com/smutel/go-netbox/netbox/models/contact.go new file mode 100644 index 000000000..1bea8a52f --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/contact.go @@ -0,0 +1,432 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Contact contact +// +// swagger:model Contact +type Contact struct { + + // Address + // Max Length: 200 + Address string `json:"address,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Email + // Max Length: 254 + // Format: email + Email strfmt.Email `json:"email,omitempty"` + + // group + Group *NestedContactGroup `json:"group,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Phone + // Max Length: 50 + Phone string `json:"phone,omitempty"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Title + // Max Length: 100 + Title string `json:"title,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this contact +func (m *Contact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Contact) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := validate.MaxLength("address", "body", m.Address, 200); err != nil { + return err + } + + return nil +} + +func (m *Contact) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Contact) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.MaxLength("email", "body", m.Email.String(), 254); err != nil { + return err + } + + if err := validate.FormatOf("email", "body", "email", m.Email.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Contact) validateGroup(formats strfmt.Registry) error { + if swag.IsZero(m.Group) { // not required + return nil + } + + if m.Group != nil { + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *Contact) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Contact) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *Contact) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.MaxLength("phone", "body", m.Phone, 50); err != nil { + return err + } + + return nil +} + +func (m *Contact) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Contact) validateTitle(formats strfmt.Registry) error { + if swag.IsZero(m.Title) { // not required + return nil + } + + if err := validate.MaxLength("title", "body", m.Title, 100); err != nil { + return err + } + + return nil +} + +func (m *Contact) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this contact based on the context it is used +func (m *Contact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGroup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Contact) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *Contact) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *Contact) contextValidateGroup(ctx context.Context, formats strfmt.Registry) error { + + if m.Group != nil { + if err := m.Group.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *Contact) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *Contact) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *Contact) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Contact) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Contact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Contact) UnmarshalBinary(b []byte) error { + var res Contact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/contact_assignment.go b/vendor/github.com/smutel/go-netbox/netbox/models/contact_assignment.go new file mode 100644 index 000000000..e44ed5426 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/contact_assignment.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ContactAssignment contact assignment +// +// swagger:model ContactAssignment +type ContactAssignment struct { + + // contact + // Required: true + Contact *NestedContact `json:"contact"` + + // Content type + // Required: true + ContentType *string `json:"content_type"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Object + // Read Only: true + Object map[string]*string `json:"object,omitempty"` + + // Object id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + ObjectID *int64 `json:"object_id"` + + // priority + Priority *ContactAssignmentPriority `json:"priority,omitempty"` + + // role + Role *NestedContactRole `json:"role,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this contact assignment +func (m *ContactAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObjectID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriority(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactAssignment) validateContact(formats strfmt.Registry) error { + + if err := validate.Required("contact", "body", m.Contact); err != nil { + return err + } + + if m.Contact != nil { + if err := m.Contact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contact") + } + return err + } + } + + return nil +} + +func (m *ContactAssignment) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("content_type", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) validateObjectID(formats strfmt.Registry) error { + + if err := validate.Required("object_id", "body", m.ObjectID); err != nil { + return err + } + + if err := validate.MinimumInt("object_id", "body", *m.ObjectID, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("object_id", "body", *m.ObjectID, 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) validatePriority(formats strfmt.Registry) error { + if swag.IsZero(m.Priority) { // not required + return nil + } + + if m.Priority != nil { + if err := m.Priority.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("priority") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("priority") + } + return err + } + } + + return nil +} + +func (m *ContactAssignment) validateRole(formats strfmt.Registry) error { + if swag.IsZero(m.Role) { // not required + return nil + } + + if m.Role != nil { + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *ContactAssignment) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this contact assignment based on the context it is used +func (m *ContactAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateObject(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePriority(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRole(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactAssignment) contextValidateContact(ctx context.Context, formats strfmt.Registry) error { + + if m.Contact != nil { + if err := m.Contact.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contact") + } + return err + } + } + + return nil +} + +func (m *ContactAssignment) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *ContactAssignment) contextValidateObject(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *ContactAssignment) contextValidatePriority(ctx context.Context, formats strfmt.Registry) error { + + if m.Priority != nil { + if err := m.Priority.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("priority") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("priority") + } + return err + } + } + + return nil +} + +func (m *ContactAssignment) contextValidateRole(ctx context.Context, formats strfmt.Registry) error { + + if m.Role != nil { + if err := m.Role.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *ContactAssignment) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ContactAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContactAssignment) UnmarshalBinary(b []byte) error { + var res ContactAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ContactAssignmentPriority Priority +// +// swagger:model ContactAssignmentPriority +type ContactAssignmentPriority struct { + + // label + // Required: true + // Enum: [Primary Secondary Tertiary Inactive] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [primary secondary tertiary inactive] + Value *string `json:"value"` +} + +// Validate validates this contact assignment priority +func (m *ContactAssignmentPriority) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var contactAssignmentPriorityTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Primary","Secondary","Tertiary","Inactive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + contactAssignmentPriorityTypeLabelPropEnum = append(contactAssignmentPriorityTypeLabelPropEnum, v) + } +} + +const ( + + // ContactAssignmentPriorityLabelPrimary captures enum value "Primary" + ContactAssignmentPriorityLabelPrimary string = "Primary" + + // ContactAssignmentPriorityLabelSecondary captures enum value "Secondary" + ContactAssignmentPriorityLabelSecondary string = "Secondary" + + // ContactAssignmentPriorityLabelTertiary captures enum value "Tertiary" + ContactAssignmentPriorityLabelTertiary string = "Tertiary" + + // ContactAssignmentPriorityLabelInactive captures enum value "Inactive" + ContactAssignmentPriorityLabelInactive string = "Inactive" +) + +// prop value enum +func (m *ContactAssignmentPriority) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, contactAssignmentPriorityTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ContactAssignmentPriority) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("priority"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("priority"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var contactAssignmentPriorityTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["primary","secondary","tertiary","inactive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + contactAssignmentPriorityTypeValuePropEnum = append(contactAssignmentPriorityTypeValuePropEnum, v) + } +} + +const ( + + // ContactAssignmentPriorityValuePrimary captures enum value "primary" + ContactAssignmentPriorityValuePrimary string = "primary" + + // ContactAssignmentPriorityValueSecondary captures enum value "secondary" + ContactAssignmentPriorityValueSecondary string = "secondary" + + // ContactAssignmentPriorityValueTertiary captures enum value "tertiary" + ContactAssignmentPriorityValueTertiary string = "tertiary" + + // ContactAssignmentPriorityValueInactive captures enum value "inactive" + ContactAssignmentPriorityValueInactive string = "inactive" +) + +// prop value enum +func (m *ContactAssignmentPriority) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, contactAssignmentPriorityTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ContactAssignmentPriority) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("priority"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("priority"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this contact assignment priority based on context it is used +func (m *ContactAssignmentPriority) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ContactAssignmentPriority) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContactAssignmentPriority) UnmarshalBinary(b []byte) error { + var res ContactAssignmentPriority + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/contact_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/contact_group.go new file mode 100644 index 000000000..fe17cc5a5 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/contact_group.go @@ -0,0 +1,430 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ContactGroup contact group +// +// swagger:model ContactGroup +type ContactGroup struct { + + // depth + // Read Only: true + Depth int64 `json:"_depth,omitempty"` + + // Contact count + // Read Only: true + ContactCount int64 `json:"contact_count,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // parent + Parent *NestedContactGroup `json:"parent,omitempty"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this contact group +func (m *ContactGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactGroup) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) validateParent(formats strfmt.Registry) error { + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *ContactGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContactGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this contact group based on the context it is used +func (m *ContactGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContactCount(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactGroup) contextValidateDepth(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "_depth", "body", int64(m.Depth)); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) contextValidateContactCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contact_count", "body", int64(m.ContactCount)); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *ContactGroup) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *ContactGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContactGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ContactGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContactGroup) UnmarshalBinary(b []byte) error { + var res ContactGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/contact_role.go b/vendor/github.com/smutel/go-netbox/netbox/models/contact_role.go new file mode 100644 index 000000000..ee940df79 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/contact_role.go @@ -0,0 +1,350 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ContactRole contact role +// +// swagger:model ContactRole +type ContactRole struct { + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this contact role +func (m *ContactRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactRole) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContactRole) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this contact role based on the context it is used +func (m *ContactRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ContactRole) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *ContactRole) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ContactRole) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ContactRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ContactRole) UnmarshalBinary(b []byte) error { + var res ContactRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/custom_field.go b/vendor/github.com/smutel/go-netbox/netbox/models/custom_field.go index 2a5fbc479..729c3cbdf 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/custom_field.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/custom_field.go @@ -44,6 +44,11 @@ type CustomField struct { // Unique: true ContentTypes []string `json:"content_types"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Default // // Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo"). @@ -70,12 +75,18 @@ type CustomField struct { // Max Length: 50 Label string `json:"label,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Name // // Internal field name // Required: true // Max Length: 50 // Min Length: 1 + // Pattern: ^[a-z0-9_]+$ Name *string `json:"name"` // Required @@ -96,14 +107,14 @@ type CustomField struct { // // Maximum allowed value (for numeric fields) // Maximum: 2.147483647e+09 - // Minimum: 0 + // Minimum: -2.147483648e+09 ValidationMaximum *int64 `json:"validation_maximum,omitempty"` // Minimum value // // Minimum allowed value (for numeric fields) // Maximum: 2.147483647e+09 - // Minimum: 0 + // Minimum: -2.147483648e+09 ValidationMinimum *int64 `json:"validation_minimum,omitempty"` // Validation regex @@ -132,6 +143,10 @@ func (m *CustomField) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { res = append(res, err) } @@ -144,6 +159,10 @@ func (m *CustomField) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -211,6 +230,18 @@ func (m *CustomField) validateContentTypes(formats strfmt.Registry) error { return nil } +func (m *CustomField) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *CustomField) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required return nil @@ -254,6 +285,18 @@ func (m *CustomField) validateLabel(formats strfmt.Registry) error { return nil } +func (m *CustomField) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *CustomField) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -268,6 +311,10 @@ func (m *CustomField) validateName(formats strfmt.Registry) error { return err } + if err := validate.Pattern("name", "body", *m.Name, `^[a-z0-9_]+$`); err != nil { + return err + } + return nil } @@ -308,7 +355,7 @@ func (m *CustomField) validateValidationMaximum(formats strfmt.Registry) error { return nil } - if err := validate.MinimumInt("validation_maximum", "body", *m.ValidationMaximum, 0, false); err != nil { + if err := validate.MinimumInt("validation_maximum", "body", *m.ValidationMaximum, -2.147483648e+09, false); err != nil { return err } @@ -324,7 +371,7 @@ func (m *CustomField) validateValidationMinimum(formats strfmt.Registry) error { return nil } - if err := validate.MinimumInt("validation_minimum", "body", *m.ValidationMinimum, 0, false); err != nil { + if err := validate.MinimumInt("validation_minimum", "body", *m.ValidationMinimum, -2.147483648e+09, false); err != nil { return err } @@ -367,6 +414,10 @@ func (m *CustomField) validateWeight(formats strfmt.Registry) error { func (m *CustomField) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -379,6 +430,10 @@ func (m *CustomField) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateType(ctx, formats); err != nil { res = append(res, err) } @@ -393,6 +448,15 @@ func (m *CustomField) ContextValidate(ctx context.Context, formats strfmt.Regist return nil } +func (m *CustomField) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *CustomField) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -427,6 +491,15 @@ func (m *CustomField) contextValidateID(ctx context.Context, formats strfmt.Regi return nil } +func (m *CustomField) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *CustomField) contextValidateType(ctx context.Context, formats strfmt.Registry) error { if m.Type != nil { @@ -626,12 +699,12 @@ type CustomFieldType struct { // label // Required: true - // Enum: [Text Integer Boolean (true/false) Date URL Selection Multiple selection] + // Enum: [Text Text (long) Integer Boolean (true/false) Date URL JSON Selection Multiple selection] Label *string `json:"label"` // value // Required: true - // Enum: [text integer boolean date url select multiselect] + // Enum: [text longtext integer boolean date url json select multiselect] Value *string `json:"value"` } @@ -657,7 +730,7 @@ var customFieldTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Text","Integer","Boolean (true/false)","Date","URL","Selection","Multiple selection"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Text","Text (long)","Integer","Boolean (true/false)","Date","URL","JSON","Selection","Multiple selection"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -670,6 +743,9 @@ const ( // CustomFieldTypeLabelText captures enum value "Text" CustomFieldTypeLabelText string = "Text" + // CustomFieldTypeLabelTextLong captures enum value "Text (long)" + CustomFieldTypeLabelTextLong string = "Text (long)" + // CustomFieldTypeLabelInteger captures enum value "Integer" CustomFieldTypeLabelInteger string = "Integer" @@ -682,6 +758,9 @@ const ( // CustomFieldTypeLabelURL captures enum value "URL" CustomFieldTypeLabelURL string = "URL" + // CustomFieldTypeLabelJSON captures enum value "JSON" + CustomFieldTypeLabelJSON string = "JSON" + // CustomFieldTypeLabelSelection captures enum value "Selection" CustomFieldTypeLabelSelection string = "Selection" @@ -715,7 +794,7 @@ var customFieldTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["text","integer","boolean","date","url","select","multiselect"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["text","longtext","integer","boolean","date","url","json","select","multiselect"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -728,6 +807,9 @@ const ( // CustomFieldTypeValueText captures enum value "text" CustomFieldTypeValueText string = "text" + // CustomFieldTypeValueLongtext captures enum value "longtext" + CustomFieldTypeValueLongtext string = "longtext" + // CustomFieldTypeValueInteger captures enum value "integer" CustomFieldTypeValueInteger string = "integer" @@ -740,6 +822,9 @@ const ( // CustomFieldTypeValueURL captures enum value "url" CustomFieldTypeValueURL string = "url" + // CustomFieldTypeValueJSON captures enum value "json" + CustomFieldTypeValueJSON string = "json" + // CustomFieldTypeValueSelect captures enum value "select" CustomFieldTypeValueSelect string = "select" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/custom_link.go b/vendor/github.com/smutel/go-netbox/netbox/models/custom_link.go index 39a223a6e..90718de5d 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/custom_link.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/custom_link.go @@ -45,6 +45,11 @@ type CustomLink struct { // Required: true ContentType *string `json:"content_type"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Display // Read Only: true Display string `json:"display,omitempty"` @@ -59,6 +64,11 @@ type CustomLink struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link text // // Jinja2 template code for link text @@ -109,10 +119,18 @@ func (m *CustomLink) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateGroupName(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateLinkText(formats); err != nil { res = append(res, err) } @@ -223,6 +241,18 @@ func (m *CustomLink) validateContentType(formats strfmt.Registry) error { return nil } +func (m *CustomLink) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *CustomLink) validateGroupName(formats strfmt.Registry) error { if swag.IsZero(m.GroupName) { // not required return nil @@ -235,6 +265,18 @@ func (m *CustomLink) validateGroupName(formats strfmt.Registry) error { return nil } +func (m *CustomLink) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *CustomLink) validateLinkText(formats strfmt.Registry) error { if err := validate.Required("link_text", "body", m.LinkText); err != nil { @@ -318,6 +360,10 @@ func (m *CustomLink) validateWeight(formats strfmt.Registry) error { func (m *CustomLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -326,6 +372,10 @@ func (m *CustomLink) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -336,6 +386,15 @@ func (m *CustomLink) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } +func (m *CustomLink) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *CustomLink) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -354,6 +413,15 @@ func (m *CustomLink) contextValidateID(ctx context.Context, formats strfmt.Regis return nil } +func (m *CustomLink) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *CustomLink) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/device.go b/vendor/github.com/smutel/go-netbox/netbox/models/device.go index 4219506af..5a957d0fc 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/device.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/device.go @@ -36,6 +36,9 @@ import ( // swagger:model Device type Device struct { + // airflow + Airflow *DeviceAirflow `json:"airflow,omitempty"` + // Asset tag // // A unique tag used to identify this device @@ -87,8 +90,9 @@ type Device struct { Location *NestedLocation `json:"location,omitempty"` // Name + // Required: true // Max Length: 64 - Name *string `json:"name,omitempty"` + Name *string `json:"name"` // parent device ParentDevice *NestedDevice `json:"parent_device,omitempty"` @@ -97,9 +101,6 @@ type Device struct { Platform *NestedPlatform `json:"platform,omitempty"` // Position (U) - // - // The lowest-numbered unit occupied by the device - // Maximum: 32767 // Minimum: 1 Position *int64 `json:"position,omitempty"` @@ -155,6 +156,10 @@ type Device struct { func (m *Device) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAirflow(formats); err != nil { + res = append(res, err) + } + if err := m.validateAssetTag(formats); err != nil { res = append(res, err) } @@ -261,6 +266,25 @@ func (m *Device) Validate(formats strfmt.Registry) error { return nil } +func (m *Device) validateAirflow(formats strfmt.Registry) error { + if swag.IsZero(m.Airflow) { // not required + return nil + } + + if m.Airflow != nil { + if err := m.Airflow.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("airflow") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("airflow") + } + return err + } + } + + return nil +} + func (m *Device) validateAssetTag(formats strfmt.Registry) error { if swag.IsZero(m.AssetTag) { // not required return nil @@ -395,8 +419,9 @@ func (m *Device) validateLocation(formats strfmt.Registry) error { } func (m *Device) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required - return nil + + if err := validate.Required("name", "body", m.Name); err != nil { + return err } if err := validate.MaxLength("name", "body", *m.Name, 64); err != nil { @@ -453,10 +478,6 @@ func (m *Device) validatePosition(formats strfmt.Registry) error { return err } - if err := validate.MaximumInt("position", "body", *m.Position, 32767, false); err != nil { - return err - } - return nil } @@ -699,6 +720,10 @@ func (m *Device) validateVirtualChassis(formats strfmt.Registry) error { func (m *Device) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateAirflow(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCluster(ctx, formats); err != nil { res = append(res, err) } @@ -789,6 +814,22 @@ func (m *Device) ContextValidate(ctx context.Context, formats strfmt.Registry) e return nil } +func (m *Device) contextValidateAirflow(ctx context.Context, formats strfmt.Registry) error { + + if m.Airflow != nil { + if err := m.Airflow.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("airflow") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("airflow") + } + return err + } + } + + return nil +} + func (m *Device) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { if m.Cluster != nil { @@ -1112,6 +1153,173 @@ func (m *Device) UnmarshalBinary(b []byte) error { return nil } +// DeviceAirflow Airflow +// +// swagger:model DeviceAirflow +type DeviceAirflow struct { + + // label + // Required: true + // Enum: [Front to rear Rear to front Left to right Right to left Side to rear Passive] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [front-to-rear rear-to-front left-to-right right-to-left side-to-rear passive] + Value *string `json:"value"` +} + +// Validate validates this device airflow +func (m *DeviceAirflow) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var deviceAirflowTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Front to rear","Rear to front","Left to right","Right to left","Side to rear","Passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deviceAirflowTypeLabelPropEnum = append(deviceAirflowTypeLabelPropEnum, v) + } +} + +const ( + + // DeviceAirflowLabelFrontToRear captures enum value "Front to rear" + DeviceAirflowLabelFrontToRear string = "Front to rear" + + // DeviceAirflowLabelRearToFront captures enum value "Rear to front" + DeviceAirflowLabelRearToFront string = "Rear to front" + + // DeviceAirflowLabelLeftToRight captures enum value "Left to right" + DeviceAirflowLabelLeftToRight string = "Left to right" + + // DeviceAirflowLabelRightToLeft captures enum value "Right to left" + DeviceAirflowLabelRightToLeft string = "Right to left" + + // DeviceAirflowLabelSideToRear captures enum value "Side to rear" + DeviceAirflowLabelSideToRear string = "Side to rear" + + // DeviceAirflowLabelPassive captures enum value "Passive" + DeviceAirflowLabelPassive string = "Passive" +) + +// prop value enum +func (m *DeviceAirflow) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deviceAirflowTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeviceAirflow) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("airflow"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("airflow"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var deviceAirflowTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["front-to-rear","rear-to-front","left-to-right","right-to-left","side-to-rear","passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deviceAirflowTypeValuePropEnum = append(deviceAirflowTypeValuePropEnum, v) + } +} + +const ( + + // DeviceAirflowValueFrontDashToDashRear captures enum value "front-to-rear" + DeviceAirflowValueFrontDashToDashRear string = "front-to-rear" + + // DeviceAirflowValueRearDashToDashFront captures enum value "rear-to-front" + DeviceAirflowValueRearDashToDashFront string = "rear-to-front" + + // DeviceAirflowValueLeftDashToDashRight captures enum value "left-to-right" + DeviceAirflowValueLeftDashToDashRight string = "left-to-right" + + // DeviceAirflowValueRightDashToDashLeft captures enum value "right-to-left" + DeviceAirflowValueRightDashToDashLeft string = "right-to-left" + + // DeviceAirflowValueSideDashToDashRear captures enum value "side-to-rear" + DeviceAirflowValueSideDashToDashRear string = "side-to-rear" + + // DeviceAirflowValuePassive captures enum value "passive" + DeviceAirflowValuePassive string = "passive" +) + +// prop value enum +func (m *DeviceAirflow) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deviceAirflowTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeviceAirflow) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("airflow"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("airflow"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this device airflow based on context it is used +func (m *DeviceAirflow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceAirflow) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceAirflow) UnmarshalBinary(b []byte) error { + var res DeviceAirflow + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + // DeviceFace Face // // swagger:model DeviceFace diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/device_role.go b/vendor/github.com/smutel/go-netbox/netbox/models/device_role.go index 28df72327..2376b9ee3 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/device_role.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/device_role.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -82,6 +83,9 @@ type DeviceRole struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -125,6 +129,10 @@ func (m *DeviceRole) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -229,6 +237,32 @@ func (m *DeviceRole) validateSlug(formats strfmt.Registry) error { return nil } +func (m *DeviceRole) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DeviceRole) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -265,6 +299,10 @@ func (m *DeviceRole) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -324,6 +362,26 @@ func (m *DeviceRole) contextValidateLastUpdated(ctx context.Context, formats str return nil } +func (m *DeviceRole) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *DeviceRole) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/device_type.go b/vendor/github.com/smutel/go-netbox/netbox/models/device_type.go index 7df52e9d5..3fdf27d98 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/device_type.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/device_type.go @@ -36,6 +36,9 @@ import ( // swagger:model DeviceType type DeviceType struct { + // airflow + Airflow *DeviceTypeAirflow `json:"airflow,omitempty"` + // Comments Comments string `json:"comments,omitempty"` @@ -123,6 +126,10 @@ type DeviceType struct { func (m *DeviceType) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAirflow(formats); err != nil { + res = append(res, err) + } + if err := m.validateCreated(formats); err != nil { res = append(res, err) } @@ -177,6 +184,25 @@ func (m *DeviceType) Validate(formats strfmt.Registry) error { return nil } +func (m *DeviceType) validateAirflow(formats strfmt.Registry) error { + if swag.IsZero(m.Airflow) { // not required + return nil + } + + if m.Airflow != nil { + if err := m.Airflow.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("airflow") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("airflow") + } + return err + } + } + + return nil +} + func (m *DeviceType) validateCreated(formats strfmt.Registry) error { if swag.IsZero(m.Created) { // not required return nil @@ -372,6 +398,10 @@ func (m *DeviceType) validateURL(formats strfmt.Registry) error { func (m *DeviceType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateAirflow(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCreated(ctx, formats); err != nil { res = append(res, err) } @@ -422,6 +452,22 @@ func (m *DeviceType) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } +func (m *DeviceType) contextValidateAirflow(ctx context.Context, formats strfmt.Registry) error { + + if m.Airflow != nil { + if err := m.Airflow.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("airflow") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("airflow") + } + return err + } + } + + return nil +} + func (m *DeviceType) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { @@ -564,6 +610,173 @@ func (m *DeviceType) UnmarshalBinary(b []byte) error { return nil } +// DeviceTypeAirflow Airflow +// +// swagger:model DeviceTypeAirflow +type DeviceTypeAirflow struct { + + // label + // Required: true + // Enum: [Front to rear Rear to front Left to right Right to left Side to rear Passive] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [front-to-rear rear-to-front left-to-right right-to-left side-to-rear passive] + Value *string `json:"value"` +} + +// Validate validates this device type airflow +func (m *DeviceTypeAirflow) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var deviceTypeAirflowTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Front to rear","Rear to front","Left to right","Right to left","Side to rear","Passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deviceTypeAirflowTypeLabelPropEnum = append(deviceTypeAirflowTypeLabelPropEnum, v) + } +} + +const ( + + // DeviceTypeAirflowLabelFrontToRear captures enum value "Front to rear" + DeviceTypeAirflowLabelFrontToRear string = "Front to rear" + + // DeviceTypeAirflowLabelRearToFront captures enum value "Rear to front" + DeviceTypeAirflowLabelRearToFront string = "Rear to front" + + // DeviceTypeAirflowLabelLeftToRight captures enum value "Left to right" + DeviceTypeAirflowLabelLeftToRight string = "Left to right" + + // DeviceTypeAirflowLabelRightToLeft captures enum value "Right to left" + DeviceTypeAirflowLabelRightToLeft string = "Right to left" + + // DeviceTypeAirflowLabelSideToRear captures enum value "Side to rear" + DeviceTypeAirflowLabelSideToRear string = "Side to rear" + + // DeviceTypeAirflowLabelPassive captures enum value "Passive" + DeviceTypeAirflowLabelPassive string = "Passive" +) + +// prop value enum +func (m *DeviceTypeAirflow) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deviceTypeAirflowTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeviceTypeAirflow) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("airflow"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("airflow"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var deviceTypeAirflowTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["front-to-rear","rear-to-front","left-to-right","right-to-left","side-to-rear","passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deviceTypeAirflowTypeValuePropEnum = append(deviceTypeAirflowTypeValuePropEnum, v) + } +} + +const ( + + // DeviceTypeAirflowValueFrontDashToDashRear captures enum value "front-to-rear" + DeviceTypeAirflowValueFrontDashToDashRear string = "front-to-rear" + + // DeviceTypeAirflowValueRearDashToDashFront captures enum value "rear-to-front" + DeviceTypeAirflowValueRearDashToDashFront string = "rear-to-front" + + // DeviceTypeAirflowValueLeftDashToDashRight captures enum value "left-to-right" + DeviceTypeAirflowValueLeftDashToDashRight string = "left-to-right" + + // DeviceTypeAirflowValueRightDashToDashLeft captures enum value "right-to-left" + DeviceTypeAirflowValueRightDashToDashLeft string = "right-to-left" + + // DeviceTypeAirflowValueSideDashToDashRear captures enum value "side-to-rear" + DeviceTypeAirflowValueSideDashToDashRear string = "side-to-rear" + + // DeviceTypeAirflowValuePassive captures enum value "passive" + DeviceTypeAirflowValuePassive string = "passive" +) + +// prop value enum +func (m *DeviceTypeAirflow) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deviceTypeAirflowTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeviceTypeAirflow) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("airflow"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("airflow"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this device type airflow based on context it is used +func (m *DeviceTypeAirflow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceTypeAirflow) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceTypeAirflow) UnmarshalBinary(b []byte) error { + var res DeviceTypeAirflow + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + // DeviceTypeSubdeviceRole Subdevice role // // swagger:model DeviceTypeSubdeviceRole diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/device_with_config_context.go b/vendor/github.com/smutel/go-netbox/netbox/models/device_with_config_context.go index 4016f59e2..ff3984fe3 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/device_with_config_context.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/device_with_config_context.go @@ -36,6 +36,9 @@ import ( // swagger:model DeviceWithConfigContext type DeviceWithConfigContext struct { + // airflow + Airflow *DeviceWithConfigContextAirflow `json:"airflow,omitempty"` + // Asset tag // // A unique tag used to identify this device @@ -91,8 +94,9 @@ type DeviceWithConfigContext struct { Location *NestedLocation `json:"location,omitempty"` // Name + // Required: true // Max Length: 64 - Name *string `json:"name,omitempty"` + Name *string `json:"name"` // parent device ParentDevice *NestedDevice `json:"parent_device,omitempty"` @@ -101,9 +105,6 @@ type DeviceWithConfigContext struct { Platform *NestedPlatform `json:"platform,omitempty"` // Position (U) - // - // The lowest-numbered unit occupied by the device - // Maximum: 32767 // Minimum: 1 Position *int64 `json:"position,omitempty"` @@ -159,6 +160,10 @@ type DeviceWithConfigContext struct { func (m *DeviceWithConfigContext) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAirflow(formats); err != nil { + res = append(res, err) + } + if err := m.validateAssetTag(formats); err != nil { res = append(res, err) } @@ -265,6 +270,25 @@ func (m *DeviceWithConfigContext) Validate(formats strfmt.Registry) error { return nil } +func (m *DeviceWithConfigContext) validateAirflow(formats strfmt.Registry) error { + if swag.IsZero(m.Airflow) { // not required + return nil + } + + if m.Airflow != nil { + if err := m.Airflow.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("airflow") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("airflow") + } + return err + } + } + + return nil +} + func (m *DeviceWithConfigContext) validateAssetTag(formats strfmt.Registry) error { if swag.IsZero(m.AssetTag) { // not required return nil @@ -399,8 +423,9 @@ func (m *DeviceWithConfigContext) validateLocation(formats strfmt.Registry) erro } func (m *DeviceWithConfigContext) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required - return nil + + if err := validate.Required("name", "body", m.Name); err != nil { + return err } if err := validate.MaxLength("name", "body", *m.Name, 64); err != nil { @@ -457,10 +482,6 @@ func (m *DeviceWithConfigContext) validatePosition(formats strfmt.Registry) erro return err } - if err := validate.MaximumInt("position", "body", *m.Position, 32767, false); err != nil { - return err - } - return nil } @@ -703,6 +724,10 @@ func (m *DeviceWithConfigContext) validateVirtualChassis(formats strfmt.Registry func (m *DeviceWithConfigContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateAirflow(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCluster(ctx, formats); err != nil { res = append(res, err) } @@ -793,6 +818,22 @@ func (m *DeviceWithConfigContext) ContextValidate(ctx context.Context, formats s return nil } +func (m *DeviceWithConfigContext) contextValidateAirflow(ctx context.Context, formats strfmt.Registry) error { + + if m.Airflow != nil { + if err := m.Airflow.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("airflow") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("airflow") + } + return err + } + } + + return nil +} + func (m *DeviceWithConfigContext) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { if m.Cluster != nil { @@ -1116,6 +1157,173 @@ func (m *DeviceWithConfigContext) UnmarshalBinary(b []byte) error { return nil } +// DeviceWithConfigContextAirflow Airflow +// +// swagger:model DeviceWithConfigContextAirflow +type DeviceWithConfigContextAirflow struct { + + // label + // Required: true + // Enum: [Front to rear Rear to front Left to right Right to left Side to rear Passive] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [front-to-rear rear-to-front left-to-right right-to-left side-to-rear passive] + Value *string `json:"value"` +} + +// Validate validates this device with config context airflow +func (m *DeviceWithConfigContextAirflow) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var deviceWithConfigContextAirflowTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Front to rear","Rear to front","Left to right","Right to left","Side to rear","Passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deviceWithConfigContextAirflowTypeLabelPropEnum = append(deviceWithConfigContextAirflowTypeLabelPropEnum, v) + } +} + +const ( + + // DeviceWithConfigContextAirflowLabelFrontToRear captures enum value "Front to rear" + DeviceWithConfigContextAirflowLabelFrontToRear string = "Front to rear" + + // DeviceWithConfigContextAirflowLabelRearToFront captures enum value "Rear to front" + DeviceWithConfigContextAirflowLabelRearToFront string = "Rear to front" + + // DeviceWithConfigContextAirflowLabelLeftToRight captures enum value "Left to right" + DeviceWithConfigContextAirflowLabelLeftToRight string = "Left to right" + + // DeviceWithConfigContextAirflowLabelRightToLeft captures enum value "Right to left" + DeviceWithConfigContextAirflowLabelRightToLeft string = "Right to left" + + // DeviceWithConfigContextAirflowLabelSideToRear captures enum value "Side to rear" + DeviceWithConfigContextAirflowLabelSideToRear string = "Side to rear" + + // DeviceWithConfigContextAirflowLabelPassive captures enum value "Passive" + DeviceWithConfigContextAirflowLabelPassive string = "Passive" +) + +// prop value enum +func (m *DeviceWithConfigContextAirflow) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deviceWithConfigContextAirflowTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeviceWithConfigContextAirflow) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("airflow"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("airflow"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var deviceWithConfigContextAirflowTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["front-to-rear","rear-to-front","left-to-right","right-to-left","side-to-rear","passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deviceWithConfigContextAirflowTypeValuePropEnum = append(deviceWithConfigContextAirflowTypeValuePropEnum, v) + } +} + +const ( + + // DeviceWithConfigContextAirflowValueFrontDashToDashRear captures enum value "front-to-rear" + DeviceWithConfigContextAirflowValueFrontDashToDashRear string = "front-to-rear" + + // DeviceWithConfigContextAirflowValueRearDashToDashFront captures enum value "rear-to-front" + DeviceWithConfigContextAirflowValueRearDashToDashFront string = "rear-to-front" + + // DeviceWithConfigContextAirflowValueLeftDashToDashRight captures enum value "left-to-right" + DeviceWithConfigContextAirflowValueLeftDashToDashRight string = "left-to-right" + + // DeviceWithConfigContextAirflowValueRightDashToDashLeft captures enum value "right-to-left" + DeviceWithConfigContextAirflowValueRightDashToDashLeft string = "right-to-left" + + // DeviceWithConfigContextAirflowValueSideDashToDashRear captures enum value "side-to-rear" + DeviceWithConfigContextAirflowValueSideDashToDashRear string = "side-to-rear" + + // DeviceWithConfigContextAirflowValuePassive captures enum value "passive" + DeviceWithConfigContextAirflowValuePassive string = "passive" +) + +// prop value enum +func (m *DeviceWithConfigContextAirflow) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deviceWithConfigContextAirflowTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeviceWithConfigContextAirflow) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("airflow"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("airflow"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this device with config context airflow based on context it is used +func (m *DeviceWithConfigContextAirflow) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceWithConfigContextAirflow) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceWithConfigContextAirflow) UnmarshalBinary(b []byte) error { + var res DeviceWithConfigContextAirflow + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + // DeviceWithConfigContextFace Face // // swagger:model DeviceWithConfigContextFace diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/export_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/export_template.go index 2133cdf2f..1addd5cc8 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/export_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/export_template.go @@ -43,6 +43,11 @@ type ExportTemplate struct { // Required: true ContentType *string `json:"content_type"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Description // Max Length: 200 Description string `json:"description,omitempty"` @@ -61,6 +66,11 @@ type ExportTemplate struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // MIME type // // Defaults to text/plain @@ -94,6 +104,10 @@ func (m *ExportTemplate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { res = append(res, err) } @@ -102,6 +116,10 @@ func (m *ExportTemplate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateMimeType(formats); err != nil { res = append(res, err) } @@ -133,6 +151,18 @@ func (m *ExportTemplate) validateContentType(formats strfmt.Registry) error { return nil } +func (m *ExportTemplate) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *ExportTemplate) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required return nil @@ -157,6 +187,18 @@ func (m *ExportTemplate) validateFileExtension(formats strfmt.Registry) error { return nil } +func (m *ExportTemplate) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *ExportTemplate) validateMimeType(formats strfmt.Registry) error { if swag.IsZero(m.MimeType) { // not required return nil @@ -215,6 +257,10 @@ func (m *ExportTemplate) validateURL(formats strfmt.Registry) error { func (m *ExportTemplate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -223,6 +269,10 @@ func (m *ExportTemplate) ContextValidate(ctx context.Context, formats strfmt.Reg res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -233,6 +283,15 @@ func (m *ExportTemplate) ContextValidate(ctx context.Context, formats strfmt.Reg return nil } +func (m *ExportTemplate) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *ExportTemplate) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -251,6 +310,15 @@ func (m *ExportTemplate) contextValidateID(ctx context.Context, formats strfmt.R return nil } +func (m *ExportTemplate) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *ExportTemplate) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group.go new file mode 100644 index 000000000..ba3aa248d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group.go @@ -0,0 +1,518 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FHRPGroup f h r p group +// +// swagger:model FHRPGroup +type FHRPGroup struct { + + // Authentication key + // Max Length: 255 + AuthKey string `json:"auth_key,omitempty"` + + // Authentication type + // Enum: [plaintext md5] + AuthType string `json:"auth_type,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Group ID + // Required: true + // Maximum: 32767 + // Minimum: 0 + GroupID *int64 `json:"group_id"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // ip addresses + // Read Only: true + IPAddresses []*NestedIPAddress `json:"ip_addresses"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Protocol + // Required: true + // Enum: [vrrp2 vrrp3 carp clusterxl hsrp glbp other] + Protocol *string `json:"protocol"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this f h r p group +func (m *FHRPGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroupID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIPAddresses(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProtocol(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FHRPGroup) validateAuthKey(formats strfmt.Registry) error { + if swag.IsZero(m.AuthKey) { // not required + return nil + } + + if err := validate.MaxLength("auth_key", "body", m.AuthKey, 255); err != nil { + return err + } + + return nil +} + +var fHRPGroupTypeAuthTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["plaintext","md5"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + fHRPGroupTypeAuthTypePropEnum = append(fHRPGroupTypeAuthTypePropEnum, v) + } +} + +const ( + + // FHRPGroupAuthTypePlaintext captures enum value "plaintext" + FHRPGroupAuthTypePlaintext string = "plaintext" + + // FHRPGroupAuthTypeMd5 captures enum value "md5" + FHRPGroupAuthTypeMd5 string = "md5" +) + +// prop value enum +func (m *FHRPGroup) validateAuthTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, fHRPGroupTypeAuthTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *FHRPGroup) validateAuthType(formats strfmt.Registry) error { + if swag.IsZero(m.AuthType) { // not required + return nil + } + + // value enum + if err := m.validateAuthTypeEnum("auth_type", "body", m.AuthType); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) validateGroupID(formats strfmt.Registry) error { + + if err := validate.Required("group_id", "body", m.GroupID); err != nil { + return err + } + + if err := validate.MinimumInt("group_id", "body", *m.GroupID, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("group_id", "body", *m.GroupID, 32767, false); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) validateIPAddresses(formats strfmt.Registry) error { + if swag.IsZero(m.IPAddresses) { // not required + return nil + } + + for i := 0; i < len(m.IPAddresses); i++ { + if swag.IsZero(m.IPAddresses[i]) { // not required + continue + } + + if m.IPAddresses[i] != nil { + if err := m.IPAddresses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ip_addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ip_addresses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FHRPGroup) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +var fHRPGroupTypeProtocolPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["vrrp2","vrrp3","carp","clusterxl","hsrp","glbp","other"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + fHRPGroupTypeProtocolPropEnum = append(fHRPGroupTypeProtocolPropEnum, v) + } +} + +const ( + + // FHRPGroupProtocolVrrp2 captures enum value "vrrp2" + FHRPGroupProtocolVrrp2 string = "vrrp2" + + // FHRPGroupProtocolVrrp3 captures enum value "vrrp3" + FHRPGroupProtocolVrrp3 string = "vrrp3" + + // FHRPGroupProtocolCarp captures enum value "carp" + FHRPGroupProtocolCarp string = "carp" + + // FHRPGroupProtocolClusterxl captures enum value "clusterxl" + FHRPGroupProtocolClusterxl string = "clusterxl" + + // FHRPGroupProtocolHsrp captures enum value "hsrp" + FHRPGroupProtocolHsrp string = "hsrp" + + // FHRPGroupProtocolGlbp captures enum value "glbp" + FHRPGroupProtocolGlbp string = "glbp" + + // FHRPGroupProtocolOther captures enum value "other" + FHRPGroupProtocolOther string = "other" +) + +// prop value enum +func (m *FHRPGroup) validateProtocolEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, fHRPGroupTypeProtocolPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *FHRPGroup) validateProtocol(formats strfmt.Registry) error { + + if err := validate.Required("protocol", "body", m.Protocol); err != nil { + return err + } + + // value enum + if err := m.validateProtocolEnum("protocol", "body", *m.Protocol); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FHRPGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this f h r p group based on the context it is used +func (m *FHRPGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIPAddresses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FHRPGroup) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) contextValidateIPAddresses(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ip_addresses", "body", []*NestedIPAddress(m.IPAddresses)); err != nil { + return err + } + + for i := 0; i < len(m.IPAddresses); i++ { + + if m.IPAddresses[i] != nil { + if err := m.IPAddresses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ip_addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ip_addresses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FHRPGroup) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *FHRPGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FHRPGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FHRPGroup) UnmarshalBinary(b []byte) error { + var res FHRPGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group_assignment.go b/vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group_assignment.go new file mode 100644 index 000000000..19aaf6b5d --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/f_h_r_p_group_assignment.go @@ -0,0 +1,342 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FHRPGroupAssignment f h r p group assignment +// +// swagger:model FHRPGroupAssignment +type FHRPGroupAssignment struct { + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // group + // Required: true + Group *NestedFHRPGroup `json:"group"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface + // Read Only: true + Interface map[string]*string `json:"interface,omitempty"` + + // Interface id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + InterfaceID *int64 `json:"interface_id"` + + // Interface type + // Required: true + InterfaceType *string `json:"interface_type"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Priority + // Required: true + // Maximum: 255 + // Minimum: 0 + Priority *int64 `json:"priority"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this f h r p group assignment +func (m *FHRPGroupAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfaceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfaceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriority(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FHRPGroupAssignment) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + if m.Group != nil { + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *FHRPGroupAssignment) validateInterfaceID(formats strfmt.Registry) error { + + if err := validate.Required("interface_id", "body", m.InterfaceID); err != nil { + return err + } + + if err := validate.MinimumInt("interface_id", "body", *m.InterfaceID, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("interface_id", "body", *m.InterfaceID, 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) validateInterfaceType(formats strfmt.Registry) error { + + if err := validate.Required("interface_type", "body", m.InterfaceType); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) validatePriority(formats strfmt.Registry) error { + + if err := validate.Required("priority", "body", m.Priority); err != nil { + return err + } + + if err := validate.MinimumInt("priority", "body", *m.Priority, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("priority", "body", *m.Priority, 255, false); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this f h r p group assignment based on the context it is used +func (m *FHRPGroupAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGroup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInterface(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FHRPGroupAssignment) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) contextValidateGroup(ctx context.Context, formats strfmt.Registry) error { + + if m.Group != nil { + if err := m.Group.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *FHRPGroupAssignment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) contextValidateInterface(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *FHRPGroupAssignment) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *FHRPGroupAssignment) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FHRPGroupAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FHRPGroupAssignment) UnmarshalBinary(b []byte) error { + var res FHRPGroupAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/front_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/front_port.go index 667992448..e3e1f336f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/front_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/front_port.go @@ -43,18 +43,6 @@ type FrontPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Color // Max Length: 6 // Pattern: ^[0-9a-f]{6}$ @@ -95,6 +83,18 @@ type FrontPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -416,31 +416,31 @@ func (m *FrontPort) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { + if err := m.contextValidateCreated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { + if err := m.contextValidateDevice(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCreated(ctx, formats); err != nil { + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDevice(ctx, formats); err != nil { + if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDisplay(ctx, formats); err != nil { + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateID(ctx, formats); err != nil { + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { res = append(res, err) } @@ -491,20 +491,6 @@ func (m *FrontPort) contextValidateCable(ctx context.Context, formats strfmt.Reg return nil } -func (m *FrontPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *FrontPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *FrontPort) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { @@ -557,6 +543,20 @@ func (m *FrontPort) contextValidateLastUpdated(ctx context.Context, formats strf return nil } +func (m *FrontPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *FrontPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *FrontPort) contextValidateRearPort(ctx context.Context, formats strfmt.Registry) error { if m.RearPort != nil { @@ -643,12 +643,12 @@ type FrontPortType struct { // label // Required: true - // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/APC LSH LSH/APC MPO MTRJ SC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] + // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/PC LC/UPC LC/APC LSH LSH/PC LSH/UPC LSH/APC MPO MTRJ SC SC/PC SC/UPC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] Label *string `json:"label"` // value // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Value *string `json:"value"` } @@ -674,7 +674,7 @@ var frontPortTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/APC","LSH","LSH/APC","MPO","MTRJ","SC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/PC","LC/UPC","LC/APC","LSH","LSH/PC","LSH/UPC","LSH/APC","MPO","MTRJ","SC","SC/PC","SC/UPC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -744,12 +744,24 @@ const ( // FrontPortTypeLabelLC captures enum value "LC" FrontPortTypeLabelLC string = "LC" + // FrontPortTypeLabelLCPC captures enum value "LC/PC" + FrontPortTypeLabelLCPC string = "LC/PC" + + // FrontPortTypeLabelLCUPC captures enum value "LC/UPC" + FrontPortTypeLabelLCUPC string = "LC/UPC" + // FrontPortTypeLabelLCAPC captures enum value "LC/APC" FrontPortTypeLabelLCAPC string = "LC/APC" // FrontPortTypeLabelLSH captures enum value "LSH" FrontPortTypeLabelLSH string = "LSH" + // FrontPortTypeLabelLSHPC captures enum value "LSH/PC" + FrontPortTypeLabelLSHPC string = "LSH/PC" + + // FrontPortTypeLabelLSHUPC captures enum value "LSH/UPC" + FrontPortTypeLabelLSHUPC string = "LSH/UPC" + // FrontPortTypeLabelLSHAPC captures enum value "LSH/APC" FrontPortTypeLabelLSHAPC string = "LSH/APC" @@ -762,6 +774,12 @@ const ( // FrontPortTypeLabelSC captures enum value "SC" FrontPortTypeLabelSC string = "SC" + // FrontPortTypeLabelSCPC captures enum value "SC/PC" + FrontPortTypeLabelSCPC string = "SC/PC" + + // FrontPortTypeLabelSCUPC captures enum value "SC/UPC" + FrontPortTypeLabelSCUPC string = "SC/UPC" + // FrontPortTypeLabelSCAPC captures enum value "SC/APC" FrontPortTypeLabelSCAPC string = "SC/APC" @@ -819,7 +837,7 @@ var frontPortTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -889,12 +907,24 @@ const ( // FrontPortTypeValueLc captures enum value "lc" FrontPortTypeValueLc string = "lc" + // FrontPortTypeValueLcDashPc captures enum value "lc-pc" + FrontPortTypeValueLcDashPc string = "lc-pc" + + // FrontPortTypeValueLcDashUpc captures enum value "lc-upc" + FrontPortTypeValueLcDashUpc string = "lc-upc" + // FrontPortTypeValueLcDashApc captures enum value "lc-apc" FrontPortTypeValueLcDashApc string = "lc-apc" // FrontPortTypeValueLsh captures enum value "lsh" FrontPortTypeValueLsh string = "lsh" + // FrontPortTypeValueLshDashPc captures enum value "lsh-pc" + FrontPortTypeValueLshDashPc string = "lsh-pc" + + // FrontPortTypeValueLshDashUpc captures enum value "lsh-upc" + FrontPortTypeValueLshDashUpc string = "lsh-upc" + // FrontPortTypeValueLshDashApc captures enum value "lsh-apc" FrontPortTypeValueLshDashApc string = "lsh-apc" @@ -907,6 +937,12 @@ const ( // FrontPortTypeValueSc captures enum value "sc" FrontPortTypeValueSc string = "sc" + // FrontPortTypeValueScDashPc captures enum value "sc-pc" + FrontPortTypeValueScDashPc string = "sc-pc" + + // FrontPortTypeValueScDashUpc captures enum value "sc-upc" + FrontPortTypeValueScDashUpc string = "sc-upc" + // FrontPortTypeValueScDashApc captures enum value "sc-apc" FrontPortTypeValueScDashApc string = "sc-apc" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/front_port_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/front_port_template.go index 4bbe46148..f1b3344e9 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/front_port_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/front_port_template.go @@ -480,12 +480,12 @@ type FrontPortTemplateType struct { // label // Required: true - // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/APC LSH LSH/APC MPO MTRJ SC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] + // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/PC LC/UPC LC/APC LSH LSH/PC LSH/UPC LSH/APC MPO MTRJ SC SC/PC SC/UPC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] Label *string `json:"label"` // value // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Value *string `json:"value"` } @@ -511,7 +511,7 @@ var frontPortTemplateTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/APC","LSH","LSH/APC","MPO","MTRJ","SC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/PC","LC/UPC","LC/APC","LSH","LSH/PC","LSH/UPC","LSH/APC","MPO","MTRJ","SC","SC/PC","SC/UPC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -581,12 +581,24 @@ const ( // FrontPortTemplateTypeLabelLC captures enum value "LC" FrontPortTemplateTypeLabelLC string = "LC" + // FrontPortTemplateTypeLabelLCPC captures enum value "LC/PC" + FrontPortTemplateTypeLabelLCPC string = "LC/PC" + + // FrontPortTemplateTypeLabelLCUPC captures enum value "LC/UPC" + FrontPortTemplateTypeLabelLCUPC string = "LC/UPC" + // FrontPortTemplateTypeLabelLCAPC captures enum value "LC/APC" FrontPortTemplateTypeLabelLCAPC string = "LC/APC" // FrontPortTemplateTypeLabelLSH captures enum value "LSH" FrontPortTemplateTypeLabelLSH string = "LSH" + // FrontPortTemplateTypeLabelLSHPC captures enum value "LSH/PC" + FrontPortTemplateTypeLabelLSHPC string = "LSH/PC" + + // FrontPortTemplateTypeLabelLSHUPC captures enum value "LSH/UPC" + FrontPortTemplateTypeLabelLSHUPC string = "LSH/UPC" + // FrontPortTemplateTypeLabelLSHAPC captures enum value "LSH/APC" FrontPortTemplateTypeLabelLSHAPC string = "LSH/APC" @@ -599,6 +611,12 @@ const ( // FrontPortTemplateTypeLabelSC captures enum value "SC" FrontPortTemplateTypeLabelSC string = "SC" + // FrontPortTemplateTypeLabelSCPC captures enum value "SC/PC" + FrontPortTemplateTypeLabelSCPC string = "SC/PC" + + // FrontPortTemplateTypeLabelSCUPC captures enum value "SC/UPC" + FrontPortTemplateTypeLabelSCUPC string = "SC/UPC" + // FrontPortTemplateTypeLabelSCAPC captures enum value "SC/APC" FrontPortTemplateTypeLabelSCAPC string = "SC/APC" @@ -656,7 +674,7 @@ var frontPortTemplateTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -726,12 +744,24 @@ const ( // FrontPortTemplateTypeValueLc captures enum value "lc" FrontPortTemplateTypeValueLc string = "lc" + // FrontPortTemplateTypeValueLcDashPc captures enum value "lc-pc" + FrontPortTemplateTypeValueLcDashPc string = "lc-pc" + + // FrontPortTemplateTypeValueLcDashUpc captures enum value "lc-upc" + FrontPortTemplateTypeValueLcDashUpc string = "lc-upc" + // FrontPortTemplateTypeValueLcDashApc captures enum value "lc-apc" FrontPortTemplateTypeValueLcDashApc string = "lc-apc" // FrontPortTemplateTypeValueLsh captures enum value "lsh" FrontPortTemplateTypeValueLsh string = "lsh" + // FrontPortTemplateTypeValueLshDashPc captures enum value "lsh-pc" + FrontPortTemplateTypeValueLshDashPc string = "lsh-pc" + + // FrontPortTemplateTypeValueLshDashUpc captures enum value "lsh-upc" + FrontPortTemplateTypeValueLshDashUpc string = "lsh-upc" + // FrontPortTemplateTypeValueLshDashApc captures enum value "lsh-apc" FrontPortTemplateTypeValueLshDashApc string = "lsh-apc" @@ -744,6 +774,12 @@ const ( // FrontPortTemplateTypeValueSc captures enum value "sc" FrontPortTemplateTypeValueSc string = "sc" + // FrontPortTemplateTypeValueScDashPc captures enum value "sc-pc" + FrontPortTemplateTypeValueScDashPc string = "sc-pc" + + // FrontPortTemplateTypeValueScDashUpc captures enum value "sc-upc" + FrontPortTemplateTypeValueScDashUpc string = "sc-upc" + // FrontPortTemplateTypeValueScDashApc captures enum value "sc-apc" FrontPortTemplateTypeValueScDashApc string = "sc-apc" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/image_attachment.go b/vendor/github.com/smutel/go-netbox/netbox/models/image_attachment.go index 76b8447e7..a26006903 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/image_attachment.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/image_attachment.go @@ -68,6 +68,11 @@ type ImageAttachment struct { // Minimum: 0 ImageWidth *int64 `json:"image_width"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Name // Max Length: 50 Name string `json:"name,omitempty"` @@ -112,6 +117,10 @@ func (m *ImageAttachment) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -197,6 +206,18 @@ func (m *ImageAttachment) validateImageWidth(formats strfmt.Registry) error { return nil } +func (m *ImageAttachment) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *ImageAttachment) validateName(formats strfmt.Registry) error { if swag.IsZero(m.Name) { // not required return nil @@ -258,6 +279,10 @@ func (m *ImageAttachment) ContextValidate(ctx context.Context, formats strfmt.Re res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateParent(ctx, formats); err != nil { res = append(res, err) } @@ -308,6 +333,15 @@ func (m *ImageAttachment) contextValidateImage(ctx context.Context, formats strf return nil } +func (m *ImageAttachment) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *ImageAttachment) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/interface.go b/vendor/github.com/smutel/go-netbox/netbox/models/interface.go index 59fd86e79..357d9f16a 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/interface.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/interface.go @@ -40,21 +40,12 @@ type Interface struct { // Read Only: true Occupied *bool `json:"_occupied,omitempty"` + // bridge + Bridge *NestedInterface `json:"bridge,omitempty"` + // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -71,6 +62,10 @@ type Interface struct { // Read Only: true ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + // Count fhrp groups + // Read Only: true + CountFhrpGroups int64 `json:"count_fhrp_groups,omitempty"` + // Count ipaddresses // Read Only: true CountIpaddresses int64 `json:"count_ipaddresses,omitempty"` @@ -116,6 +111,18 @@ type Interface struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // MAC Address MacAddress *string `json:"mac_address,omitempty"` @@ -146,6 +153,18 @@ type Interface struct { // parent Parent *NestedInterface `json:"parent,omitempty"` + // rf channel + RfChannel *InterfaceRfChannel `json:"rf_channel,omitempty"` + + // Channel frequency (MHz) + RfChannelFrequency *float64 `json:"rf_channel_frequency,omitempty"` + + // Channel width (MHz) + RfChannelWidth *float64 `json:"rf_channel_width,omitempty"` + + // rf role + RfRole *InterfaceRfRole `json:"rf_role,omitempty"` + // tagged vlans // Unique: true TaggedVlans []*NestedVLAN `json:"tagged_vlans"` @@ -153,6 +172,11 @@ type Interface struct { // tags Tags []*NestedTag `json:"tags"` + // Transmit power (dBm) + // Maximum: 127 + // Minimum: 0 + TxPower *int64 `json:"tx_power,omitempty"` + // type // Required: true Type *InterfaceType `json:"type"` @@ -164,12 +188,28 @@ type Interface struct { // Read Only: true // Format: uri URL strfmt.URI `json:"url,omitempty"` + + // wireless lans + // Unique: true + WirelessLans []*NestedWirelessLAN `json:"wireless_lans"` + + // wireless link + WirelessLink *NestedWirelessLink `json:"wireless_link,omitempty"` + + // WWN + // + // 64-bit World Wide Name + Wwn *string `json:"wwn,omitempty"` } // Validate validates this interface func (m *Interface) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBridge(formats); err != nil { + res = append(res, err) + } + if err := m.validateCable(formats); err != nil { res = append(res, err) } @@ -214,6 +254,14 @@ func (m *Interface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateRfChannel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRfRole(formats); err != nil { + res = append(res, err) + } + if err := m.validateTaggedVlans(formats); err != nil { res = append(res, err) } @@ -222,6 +270,10 @@ func (m *Interface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTxPower(formats); err != nil { + res = append(res, err) + } + if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -234,12 +286,39 @@ func (m *Interface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateWirelessLans(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWirelessLink(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +func (m *Interface) validateBridge(formats strfmt.Registry) error { + if swag.IsZero(m.Bridge) { // not required + return nil + } + + if m.Bridge != nil { + if err := m.Bridge.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bridge") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bridge") + } + return err + } + } + + return nil +} + func (m *Interface) validateCable(formats strfmt.Registry) error { if swag.IsZero(m.Cable) { // not required return nil @@ -417,6 +496,44 @@ func (m *Interface) validateParent(formats strfmt.Registry) error { return nil } +func (m *Interface) validateRfChannel(formats strfmt.Registry) error { + if swag.IsZero(m.RfChannel) { // not required + return nil + } + + if m.RfChannel != nil { + if err := m.RfChannel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rf_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rf_channel") + } + return err + } + } + + return nil +} + +func (m *Interface) validateRfRole(formats strfmt.Registry) error { + if swag.IsZero(m.RfRole) { // not required + return nil + } + + if m.RfRole != nil { + if err := m.RfRole.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rf_role") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rf_role") + } + return err + } + } + + return nil +} + func (m *Interface) validateTaggedVlans(formats strfmt.Registry) error { if swag.IsZero(m.TaggedVlans) { // not required return nil @@ -473,6 +590,22 @@ func (m *Interface) validateTags(formats strfmt.Registry) error { return nil } +func (m *Interface) validateTxPower(formats strfmt.Registry) error { + if swag.IsZero(m.TxPower) { // not required + return nil + } + + if err := validate.MinimumInt("tx_power", "body", *m.TxPower, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("tx_power", "body", *m.TxPower, 127, false); err != nil { + return err + } + + return nil +} + func (m *Interface) validateType(formats strfmt.Registry) error { if err := validate.Required("type", "body", m.Type); err != nil { @@ -524,6 +657,55 @@ func (m *Interface) validateURL(formats strfmt.Registry) error { return nil } +func (m *Interface) validateWirelessLans(formats strfmt.Registry) error { + if swag.IsZero(m.WirelessLans) { // not required + return nil + } + + if err := validate.UniqueItems("wireless_lans", "body", m.WirelessLans); err != nil { + return err + } + + for i := 0; i < len(m.WirelessLans); i++ { + if swag.IsZero(m.WirelessLans[i]) { // not required + continue + } + + if m.WirelessLans[i] != nil { + if err := m.WirelessLans[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wireless_lans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wireless_lans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Interface) validateWirelessLink(formats strfmt.Registry) error { + if swag.IsZero(m.WirelessLink) { // not required + return nil + } + + if m.WirelessLink != nil { + if err := m.WirelessLink.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wireless_link") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wireless_link") + } + return err + } + } + + return nil +} + // ContextValidate validate this interface based on the context it is used func (m *Interface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -532,15 +714,11 @@ func (m *Interface) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } - if err := m.contextValidateCable(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeer(ctx, formats); err != nil { + if err := m.contextValidateBridge(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { + if err := m.contextValidateCable(ctx, formats); err != nil { res = append(res, err) } @@ -556,6 +734,10 @@ func (m *Interface) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateCountFhrpGroups(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCountIpaddresses(ctx, formats); err != nil { res = append(res, err) } @@ -584,6 +766,14 @@ func (m *Interface) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateMode(ctx, formats); err != nil { res = append(res, err) } @@ -592,6 +782,14 @@ func (m *Interface) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateRfChannel(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRfRole(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTaggedVlans(ctx, formats); err != nil { res = append(res, err) } @@ -612,6 +810,14 @@ func (m *Interface) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateWirelessLans(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWirelessLink(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -627,6 +833,22 @@ func (m *Interface) contextValidateOccupied(ctx context.Context, formats strfmt. return nil } +func (m *Interface) contextValidateBridge(ctx context.Context, formats strfmt.Registry) error { + + if m.Bridge != nil { + if err := m.Bridge.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bridge") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bridge") + } + return err + } + } + + return nil +} + func (m *Interface) contextValidateCable(ctx context.Context, formats strfmt.Registry) error { if m.Cable != nil { @@ -643,37 +865,32 @@ func (m *Interface) contextValidateCable(ctx context.Context, formats strfmt.Reg return nil } -func (m *Interface) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { +func (m *Interface) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil } -func (m *Interface) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { +func (m *Interface) contextValidateConnectedEndpointReachable(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoint_reachable", "body", m.ConnectedEndpointReachable); err != nil { return err } return nil } -func (m *Interface) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *Interface) contextValidateConnectedEndpointReachable(ctx context.Context, formats strfmt.Registry) error { +func (m *Interface) contextValidateConnectedEndpointType(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoint_reachable", "body", m.ConnectedEndpointReachable); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoint_type", "body", string(m.ConnectedEndpointType)); err != nil { return err } return nil } -func (m *Interface) contextValidateConnectedEndpointType(ctx context.Context, formats strfmt.Registry) error { +func (m *Interface) contextValidateCountFhrpGroups(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoint_type", "body", string(m.ConnectedEndpointType)); err != nil { + if err := validate.ReadOnly(ctx, "count_fhrp_groups", "body", int64(m.CountFhrpGroups)); err != nil { return err } @@ -757,6 +974,20 @@ func (m *Interface) contextValidateLastUpdated(ctx context.Context, formats strf return nil } +func (m *Interface) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *Interface) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *Interface) contextValidateMode(ctx context.Context, formats strfmt.Registry) error { if m.Mode != nil { @@ -789,6 +1020,38 @@ func (m *Interface) contextValidateParent(ctx context.Context, formats strfmt.Re return nil } +func (m *Interface) contextValidateRfChannel(ctx context.Context, formats strfmt.Registry) error { + + if m.RfChannel != nil { + if err := m.RfChannel.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rf_channel") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rf_channel") + } + return err + } + } + + return nil +} + +func (m *Interface) contextValidateRfRole(ctx context.Context, formats strfmt.Registry) error { + + if m.RfRole != nil { + if err := m.RfRole.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rf_role") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("rf_role") + } + return err + } + } + + return nil +} + func (m *Interface) contextValidateTaggedVlans(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.TaggedVlans); i++ { @@ -870,6 +1133,42 @@ func (m *Interface) contextValidateURL(ctx context.Context, formats strfmt.Regis return nil } +func (m *Interface) contextValidateWirelessLans(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.WirelessLans); i++ { + + if m.WirelessLans[i] != nil { + if err := m.WirelessLans[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wireless_lans" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wireless_lans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Interface) contextValidateWirelessLink(ctx context.Context, formats strfmt.Registry) error { + + if m.WirelessLink != nil { + if err := m.WirelessLink.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("wireless_link") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("wireless_link") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *Interface) MarshalBinary() ([]byte, error) { if m == nil { @@ -1037,24 +1336,24 @@ func (m *InterfaceMode) UnmarshalBinary(b []byte) error { return nil } -// InterfaceType Type +// InterfaceRfChannel Rf channel // -// swagger:model InterfaceType -type InterfaceType struct { +// swagger:model InterfaceRfChannel +type InterfaceRfChannel struct { // label // Required: true - // Enum: [Virtual Link Aggregation Group (LAG) 100BASE-TX (10/100ME) 1000BASE-T (1GE) 2.5GBASE-T (2.5GE) 5GBASE-T (5GE) 10GBASE-T (10GE) 10GBASE-CX4 (10GE) GBIC (1GE) SFP (1GE) SFP+ (10GE) XFP (10GE) XENPAK (10GE) X2 (10GE) SFP28 (25GE) SFP56 (50GE) QSFP+ (40GE) QSFP28 (50GE) CFP (100GE) CFP2 (100GE) CFP2 (200GE) CFP4 (100GE) Cisco CPAK (100GE) QSFP28 (100GE) QSFP56 (200GE) QSFP-DD (400GE) OSFP (400GE) IEEE 802.11a IEEE 802.11b/g IEEE 802.11n IEEE 802.11ac IEEE 802.11ad IEEE 802.11ax IEEE 802.15.1 (Bluetooth) GSM CDMA LTE OC-3/STM-1 OC-12/STM-4 OC-48/STM-16 OC-192/STM-64 OC-768/STM-256 OC-1920/STM-640 OC-3840/STM-1234 SFP (1GFC) SFP (2GFC) SFP (4GFC) SFP+ (8GFC) SFP+ (16GFC) SFP28 (32GFC) QSFP+ (64GFC) QSFP28 (128GFC) SDR (2 Gbps) DDR (4 Gbps) QDR (8 Gbps) FDR10 (10 Gbps) FDR (13.5 Gbps) EDR (25 Gbps) HDR (50 Gbps) NDR (100 Gbps) XDR (250 Gbps) T1 (1.544 Mbps) E1 (2.048 Mbps) T3 (45 Mbps) E3 (34 Mbps) xDSL Cisco StackWise Cisco StackWise Plus Cisco FlexStack Cisco FlexStack Plus Juniper VCP Extreme SummitStack Extreme SummitStack-128 Extreme SummitStack-256 Extreme SummitStack-512 Other] + // Enum: [1 (2412 MHz) 2 (2417 MHz) 3 (2422 MHz) 4 (2427 MHz) 5 (2432 MHz) 6 (2437 MHz) 7 (2442 MHz) 8 (2447 MHz) 9 (2452 MHz) 10 (2457 MHz) 11 (2462 MHz) 12 (2467 MHz) 13 (2472 MHz) 32 (5160/20 MHz) 34 (5170/40 MHz) 36 (5180/20 MHz) 38 (5190/40 MHz) 40 (5200/20 MHz) 42 (5210/80 MHz) 44 (5220/20 MHz) 46 (5230/40 MHz) 48 (5240/20 MHz) 50 (5250/160 MHz) 52 (5260/20 MHz) 54 (5270/40 MHz) 56 (5280/20 MHz) 58 (5290/80 MHz) 60 (5300/20 MHz) 62 (5310/40 MHz) 64 (5320/20 MHz) 100 (5500/20 MHz) 102 (5510/40 MHz) 104 (5520/20 MHz) 106 (5530/80 MHz) 108 (5540/20 MHz) 110 (5550/40 MHz) 112 (5560/20 MHz) 114 (5570/160 MHz) 116 (5580/20 MHz) 118 (5590/40 MHz) 120 (5600/20 MHz) 122 (5610/80 MHz) 124 (5620/20 MHz) 126 (5630/40 MHz) 128 (5640/20 MHz) 132 (5660/20 MHz) 134 (5670/40 MHz) 136 (5680/20 MHz) 138 (5690/80 MHz) 140 (5700/20 MHz) 142 (5710/40 MHz) 144 (5720/20 MHz) 149 (5745/20 MHz) 151 (5755/40 MHz) 153 (5765/20 MHz) 155 (5775/80 MHz) 157 (5785/20 MHz) 159 (5795/40 MHz) 161 (5805/20 MHz) 163 (5815/160 MHz) 165 (5825/20 MHz) 167 (5835/40 MHz) 169 (5845/20 MHz) 171 (5855/80 MHz) 173 (5865/20 MHz) 175 (5875/40 MHz) 177 (5885/20 MHz) 1 (5955/20 MHz) 3 (5965/40 MHz) 5 (5975/20 MHz) 7 (5985/80 MHz) 9 (5995/20 MHz) 11 (6005/40 MHz) 13 (6015/20 MHz) 15 (6025/160 MHz) 17 (6035/20 MHz) 19 (6045/40 MHz) 21 (6055/20 MHz) 23 (6065/80 MHz) 25 (6075/20 MHz) 27 (6085/40 MHz) 29 (6095/20 MHz) 31 (6105/320 MHz) 33 (6115/20 MHz) 35 (6125/40 MHz) 37 (6135/20 MHz) 39 (6145/80 MHz) 41 (6155/20 MHz) 43 (6165/40 MHz) 45 (6175/20 MHz) 47 (6185/160 MHz) 49 (6195/20 MHz) 51 (6205/40 MHz) 53 (6215/20 MHz) 55 (6225/80 MHz) 57 (6235/20 MHz) 59 (6245/40 MHz) 61 (6255/20 MHz) 65 (6275/20 MHz) 67 (6285/40 MHz) 69 (6295/20 MHz) 71 (6305/80 MHz) 73 (6315/20 MHz) 75 (6325/40 MHz) 77 (6335/20 MHz) 79 (6345/160 MHz) 81 (6355/20 MHz) 83 (6365/40 MHz) 85 (6375/20 MHz) 87 (6385/80 MHz) 89 (6395/20 MHz) 91 (6405/40 MHz) 93 (6415/20 MHz) 95 (6425/320 MHz) 97 (6435/20 MHz) 99 (6445/40 MHz) 101 (6455/20 MHz) 103 (6465/80 MHz) 105 (6475/20 MHz) 107 (6485/40 MHz) 109 (6495/20 MHz) 111 (6505/160 MHz) 113 (6515/20 MHz) 115 (6525/40 MHz) 117 (6535/20 MHz) 119 (6545/80 MHz) 121 (6555/20 MHz) 123 (6565/40 MHz) 125 (6575/20 MHz) 129 (6595/20 MHz) 131 (6605/40 MHz) 133 (6615/20 MHz) 135 (6625/80 MHz) 137 (6635/20 MHz) 139 (6645/40 MHz) 141 (6655/20 MHz) 143 (6665/160 MHz) 145 (6675/20 MHz) 147 (6685/40 MHz) 149 (6695/20 MHz) 151 (6705/80 MHz) 153 (6715/20 MHz) 155 (6725/40 MHz) 157 (6735/20 MHz) 159 (6745/320 MHz) 161 (6755/20 MHz) 163 (6765/40 MHz) 165 (6775/20 MHz) 167 (6785/80 MHz) 169 (6795/20 MHz) 171 (6805/40 MHz) 173 (6815/20 MHz) 175 (6825/160 MHz) 177 (6835/20 MHz) 179 (6845/40 MHz) 181 (6855/20 MHz) 183 (6865/80 MHz) 185 (6875/20 MHz) 187 (6885/40 MHz) 189 (6895/20 MHz) 193 (6915/20 MHz) 195 (6925/40 MHz) 197 (6935/20 MHz) 199 (6945/80 MHz) 201 (6955/20 MHz) 203 (6965/40 MHz) 205 (6975/20 MHz) 207 (6985/160 MHz) 209 (6995/20 MHz) 211 (7005/40 MHz) 213 (7015/20 MHz) 215 (7025/80 MHz) 217 (7035/20 MHz) 219 (7045/40 MHz) 221 (7055/20 MHz) 225 (7075/20 MHz) 227 (7085/40 MHz) 229 (7095/20 MHz) 233 (7115/20 MHz) 1 (58.32/2.16 GHz) 2 (60.48/2.16 GHz) 3 (62.64/2.16 GHz) 4 (64.80/2.16 GHz) 5 (66.96/2.16 GHz) 6 (69.12/2.16 GHz) 9 (59.40/4.32 GHz) 10 (61.56/4.32 GHz) 11 (63.72/4.32 GHz) 12 (65.88/4.32 GHz) 13 (68.04/4.32 GHz) 17 (60.48/6.48 GHz) 18 (62.64/6.48 GHz) 19 (64.80/6.48 GHz) 20 (66.96/6.48 GHz) 25 (61.56/8.64 GHz) 26 (63.72/8.64 GHz) 27 (65.88/8.64 GHz)] Label *string `json:"label"` // value // Required: true - // Enum: [virtual lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-sfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] + // Enum: [2.4g-1-2412-22 2.4g-2-2417-22 2.4g-3-2422-22 2.4g-4-2427-22 2.4g-5-2432-22 2.4g-6-2437-22 2.4g-7-2442-22 2.4g-8-2447-22 2.4g-9-2452-22 2.4g-10-2457-22 2.4g-11-2462-22 2.4g-12-2467-22 2.4g-13-2472-22 5g-32-5160-20 5g-34-5170-40 5g-36-5180-20 5g-38-5190-40 5g-40-5200-20 5g-42-5210-80 5g-44-5220-20 5g-46-5230-40 5g-48-5240-20 5g-50-5250-160 5g-52-5260-20 5g-54-5270-40 5g-56-5280-20 5g-58-5290-80 5g-60-5300-20 5g-62-5310-40 5g-64-5320-20 5g-100-5500-20 5g-102-5510-40 5g-104-5520-20 5g-106-5530-80 5g-108-5540-20 5g-110-5550-40 5g-112-5560-20 5g-114-5570-160 5g-116-5580-20 5g-118-5590-40 5g-120-5600-20 5g-122-5610-80 5g-124-5620-20 5g-126-5630-40 5g-128-5640-20 5g-132-5660-20 5g-134-5670-40 5g-136-5680-20 5g-138-5690-80 5g-140-5700-20 5g-142-5710-40 5g-144-5720-20 5g-149-5745-20 5g-151-5755-40 5g-153-5765-20 5g-155-5775-80 5g-157-5785-20 5g-159-5795-40 5g-161-5805-20 5g-163-5815-160 5g-165-5825-20 5g-167-5835-40 5g-169-5845-20 5g-171-5855-80 5g-173-5865-20 5g-175-5875-40 5g-177-5885-20 6g-1-5955-20 6g-3-5965-40 6g-5-5975-20 6g-7-5985-80 6g-9-5995-20 6g-11-6005-40 6g-13-6015-20 6g-15-6025-160 6g-17-6035-20 6g-19-6045-40 6g-21-6055-20 6g-23-6065-80 6g-25-6075-20 6g-27-6085-40 6g-29-6095-20 6g-31-6105-320 6g-33-6115-20 6g-35-6125-40 6g-37-6135-20 6g-39-6145-80 6g-41-6155-20 6g-43-6165-40 6g-45-6175-20 6g-47-6185-160 6g-49-6195-20 6g-51-6205-40 6g-53-6215-20 6g-55-6225-80 6g-57-6235-20 6g-59-6245-40 6g-61-6255-20 6g-65-6275-20 6g-67-6285-40 6g-69-6295-20 6g-71-6305-80 6g-73-6315-20 6g-75-6325-40 6g-77-6335-20 6g-79-6345-160 6g-81-6355-20 6g-83-6365-40 6g-85-6375-20 6g-87-6385-80 6g-89-6395-20 6g-91-6405-40 6g-93-6415-20 6g-95-6425-320 6g-97-6435-20 6g-99-6445-40 6g-101-6455-20 6g-103-6465-80 6g-105-6475-20 6g-107-6485-40 6g-109-6495-20 6g-111-6505-160 6g-113-6515-20 6g-115-6525-40 6g-117-6535-20 6g-119-6545-80 6g-121-6555-20 6g-123-6565-40 6g-125-6575-20 6g-129-6595-20 6g-131-6605-40 6g-133-6615-20 6g-135-6625-80 6g-137-6635-20 6g-139-6645-40 6g-141-6655-20 6g-143-6665-160 6g-145-6675-20 6g-147-6685-40 6g-149-6695-20 6g-151-6705-80 6g-153-6715-20 6g-155-6725-40 6g-157-6735-20 6g-159-6745-320 6g-161-6755-20 6g-163-6765-40 6g-165-6775-20 6g-167-6785-80 6g-169-6795-20 6g-171-6805-40 6g-173-6815-20 6g-175-6825-160 6g-177-6835-20 6g-179-6845-40 6g-181-6855-20 6g-183-6865-80 6g-185-6875-20 6g-187-6885-40 6g-189-6895-20 6g-193-6915-20 6g-195-6925-40 6g-197-6935-20 6g-199-6945-80 6g-201-6955-20 6g-203-6965-40 6g-205-6975-20 6g-207-6985-160 6g-209-6995-20 6g-211-7005-40 6g-213-7015-20 6g-215-7025-80 6g-217-7035-20 6g-219-7045-40 6g-221-7055-20 6g-225-7075-20 6g-227-7085-40 6g-229-7095-20 6g-233-7115-20 60g-1-58320-2160 60g-2-60480-2160 60g-3-62640-2160 60g-4-64800-2160 60g-5-66960-2160 60g-6-69120-2160 60g-9-59400-4320 60g-10-61560-4320 60g-11-63720-4320 60g-12-65880-4320 60g-13-68040-4320 60g-17-60480-6480 60g-18-62640-6480 60g-19-64800-6480 60g-20-66960-6480 60g-25-61560-6480 60g-26-63720-6480 60g-27-65880-6480] Value *string `json:"value"` } -// Validate validates this interface type -func (m *InterfaceType) Validate(formats strfmt.Registry) error { +// Validate validates this interface rf channel +func (m *InterfaceRfChannel) Validate(formats strfmt.Registry) error { var res []error if err := m.validateLabel(formats); err != nil { @@ -1071,34 +1370,1493 @@ func (m *InterfaceType) Validate(formats strfmt.Registry) error { return nil } -var interfaceTypeTypeLabelPropEnum []interface{} +var interfaceRfChannelTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Virtual","Link Aggregation Group (LAG)","100BASE-TX (10/100ME)","1000BASE-T (1GE)","2.5GBASE-T (2.5GE)","5GBASE-T (5GE)","10GBASE-T (10GE)","10GBASE-CX4 (10GE)","GBIC (1GE)","SFP (1GE)","SFP+ (10GE)","XFP (10GE)","XENPAK (10GE)","X2 (10GE)","SFP28 (25GE)","SFP56 (50GE)","QSFP+ (40GE)","QSFP28 (50GE)","CFP (100GE)","CFP2 (100GE)","CFP2 (200GE)","CFP4 (100GE)","Cisco CPAK (100GE)","QSFP28 (100GE)","QSFP56 (200GE)","QSFP-DD (400GE)","OSFP (400GE)","IEEE 802.11a","IEEE 802.11b/g","IEEE 802.11n","IEEE 802.11ac","IEEE 802.11ad","IEEE 802.11ax","IEEE 802.15.1 (Bluetooth)","GSM","CDMA","LTE","OC-3/STM-1","OC-12/STM-4","OC-48/STM-16","OC-192/STM-64","OC-768/STM-256","OC-1920/STM-640","OC-3840/STM-1234","SFP (1GFC)","SFP (2GFC)","SFP (4GFC)","SFP+ (8GFC)","SFP+ (16GFC)","SFP28 (32GFC)","QSFP+ (64GFC)","QSFP28 (128GFC)","SDR (2 Gbps)","DDR (4 Gbps)","QDR (8 Gbps)","FDR10 (10 Gbps)","FDR (13.5 Gbps)","EDR (25 Gbps)","HDR (50 Gbps)","NDR (100 Gbps)","XDR (250 Gbps)","T1 (1.544 Mbps)","E1 (2.048 Mbps)","T3 (45 Mbps)","E3 (34 Mbps)","xDSL","Cisco StackWise","Cisco StackWise Plus","Cisco FlexStack","Cisco FlexStack Plus","Juniper VCP","Extreme SummitStack","Extreme SummitStack-128","Extreme SummitStack-256","Extreme SummitStack-512","Other"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["1 (2412 MHz)","2 (2417 MHz)","3 (2422 MHz)","4 (2427 MHz)","5 (2432 MHz)","6 (2437 MHz)","7 (2442 MHz)","8 (2447 MHz)","9 (2452 MHz)","10 (2457 MHz)","11 (2462 MHz)","12 (2467 MHz)","13 (2472 MHz)","32 (5160/20 MHz)","34 (5170/40 MHz)","36 (5180/20 MHz)","38 (5190/40 MHz)","40 (5200/20 MHz)","42 (5210/80 MHz)","44 (5220/20 MHz)","46 (5230/40 MHz)","48 (5240/20 MHz)","50 (5250/160 MHz)","52 (5260/20 MHz)","54 (5270/40 MHz)","56 (5280/20 MHz)","58 (5290/80 MHz)","60 (5300/20 MHz)","62 (5310/40 MHz)","64 (5320/20 MHz)","100 (5500/20 MHz)","102 (5510/40 MHz)","104 (5520/20 MHz)","106 (5530/80 MHz)","108 (5540/20 MHz)","110 (5550/40 MHz)","112 (5560/20 MHz)","114 (5570/160 MHz)","116 (5580/20 MHz)","118 (5590/40 MHz)","120 (5600/20 MHz)","122 (5610/80 MHz)","124 (5620/20 MHz)","126 (5630/40 MHz)","128 (5640/20 MHz)","132 (5660/20 MHz)","134 (5670/40 MHz)","136 (5680/20 MHz)","138 (5690/80 MHz)","140 (5700/20 MHz)","142 (5710/40 MHz)","144 (5720/20 MHz)","149 (5745/20 MHz)","151 (5755/40 MHz)","153 (5765/20 MHz)","155 (5775/80 MHz)","157 (5785/20 MHz)","159 (5795/40 MHz)","161 (5805/20 MHz)","163 (5815/160 MHz)","165 (5825/20 MHz)","167 (5835/40 MHz)","169 (5845/20 MHz)","171 (5855/80 MHz)","173 (5865/20 MHz)","175 (5875/40 MHz)","177 (5885/20 MHz)","1 (5955/20 MHz)","3 (5965/40 MHz)","5 (5975/20 MHz)","7 (5985/80 MHz)","9 (5995/20 MHz)","11 (6005/40 MHz)","13 (6015/20 MHz)","15 (6025/160 MHz)","17 (6035/20 MHz)","19 (6045/40 MHz)","21 (6055/20 MHz)","23 (6065/80 MHz)","25 (6075/20 MHz)","27 (6085/40 MHz)","29 (6095/20 MHz)","31 (6105/320 MHz)","33 (6115/20 MHz)","35 (6125/40 MHz)","37 (6135/20 MHz)","39 (6145/80 MHz)","41 (6155/20 MHz)","43 (6165/40 MHz)","45 (6175/20 MHz)","47 (6185/160 MHz)","49 (6195/20 MHz)","51 (6205/40 MHz)","53 (6215/20 MHz)","55 (6225/80 MHz)","57 (6235/20 MHz)","59 (6245/40 MHz)","61 (6255/20 MHz)","65 (6275/20 MHz)","67 (6285/40 MHz)","69 (6295/20 MHz)","71 (6305/80 MHz)","73 (6315/20 MHz)","75 (6325/40 MHz)","77 (6335/20 MHz)","79 (6345/160 MHz)","81 (6355/20 MHz)","83 (6365/40 MHz)","85 (6375/20 MHz)","87 (6385/80 MHz)","89 (6395/20 MHz)","91 (6405/40 MHz)","93 (6415/20 MHz)","95 (6425/320 MHz)","97 (6435/20 MHz)","99 (6445/40 MHz)","101 (6455/20 MHz)","103 (6465/80 MHz)","105 (6475/20 MHz)","107 (6485/40 MHz)","109 (6495/20 MHz)","111 (6505/160 MHz)","113 (6515/20 MHz)","115 (6525/40 MHz)","117 (6535/20 MHz)","119 (6545/80 MHz)","121 (6555/20 MHz)","123 (6565/40 MHz)","125 (6575/20 MHz)","129 (6595/20 MHz)","131 (6605/40 MHz)","133 (6615/20 MHz)","135 (6625/80 MHz)","137 (6635/20 MHz)","139 (6645/40 MHz)","141 (6655/20 MHz)","143 (6665/160 MHz)","145 (6675/20 MHz)","147 (6685/40 MHz)","149 (6695/20 MHz)","151 (6705/80 MHz)","153 (6715/20 MHz)","155 (6725/40 MHz)","157 (6735/20 MHz)","159 (6745/320 MHz)","161 (6755/20 MHz)","163 (6765/40 MHz)","165 (6775/20 MHz)","167 (6785/80 MHz)","169 (6795/20 MHz)","171 (6805/40 MHz)","173 (6815/20 MHz)","175 (6825/160 MHz)","177 (6835/20 MHz)","179 (6845/40 MHz)","181 (6855/20 MHz)","183 (6865/80 MHz)","185 (6875/20 MHz)","187 (6885/40 MHz)","189 (6895/20 MHz)","193 (6915/20 MHz)","195 (6925/40 MHz)","197 (6935/20 MHz)","199 (6945/80 MHz)","201 (6955/20 MHz)","203 (6965/40 MHz)","205 (6975/20 MHz)","207 (6985/160 MHz)","209 (6995/20 MHz)","211 (7005/40 MHz)","213 (7015/20 MHz)","215 (7025/80 MHz)","217 (7035/20 MHz)","219 (7045/40 MHz)","221 (7055/20 MHz)","225 (7075/20 MHz)","227 (7085/40 MHz)","229 (7095/20 MHz)","233 (7115/20 MHz)","1 (58.32/2.16 GHz)","2 (60.48/2.16 GHz)","3 (62.64/2.16 GHz)","4 (64.80/2.16 GHz)","5 (66.96/2.16 GHz)","6 (69.12/2.16 GHz)","9 (59.40/4.32 GHz)","10 (61.56/4.32 GHz)","11 (63.72/4.32 GHz)","12 (65.88/4.32 GHz)","13 (68.04/4.32 GHz)","17 (60.48/6.48 GHz)","18 (62.64/6.48 GHz)","19 (64.80/6.48 GHz)","20 (66.96/6.48 GHz)","25 (61.56/8.64 GHz)","26 (63.72/8.64 GHz)","27 (65.88/8.64 GHz)"]`), &res); err != nil { panic(err) } for _, v := range res { - interfaceTypeTypeLabelPropEnum = append(interfaceTypeTypeLabelPropEnum, v) + interfaceRfChannelTypeLabelPropEnum = append(interfaceRfChannelTypeLabelPropEnum, v) } } const ( - // InterfaceTypeLabelVirtual captures enum value "Virtual" - InterfaceTypeLabelVirtual string = "Virtual" + // InterfaceRfChannelLabelNr12412MHz captures enum value "1 (2412 MHz)" + InterfaceRfChannelLabelNr12412MHz string = "1 (2412 MHz)" - // InterfaceTypeLabelLinkAggregationGroupLAG captures enum value "Link Aggregation Group (LAG)" - InterfaceTypeLabelLinkAggregationGroupLAG string = "Link Aggregation Group (LAG)" + // InterfaceRfChannelLabelNr22417MHz captures enum value "2 (2417 MHz)" + InterfaceRfChannelLabelNr22417MHz string = "2 (2417 MHz)" - // InterfaceTypeLabelNr100BASEDashTX10100ME captures enum value "100BASE-TX (10/100ME)" - InterfaceTypeLabelNr100BASEDashTX10100ME string = "100BASE-TX (10/100ME)" + // InterfaceRfChannelLabelNr32422MHz captures enum value "3 (2422 MHz)" + InterfaceRfChannelLabelNr32422MHz string = "3 (2422 MHz)" - // InterfaceTypeLabelNr1000BASEDashT1GE captures enum value "1000BASE-T (1GE)" - InterfaceTypeLabelNr1000BASEDashT1GE string = "1000BASE-T (1GE)" + // InterfaceRfChannelLabelNr42427MHz captures enum value "4 (2427 MHz)" + InterfaceRfChannelLabelNr42427MHz string = "4 (2427 MHz)" - // InterfaceTypeLabelNr2Dot5GBASEDashT2Dot5GE captures enum value "2.5GBASE-T (2.5GE)" - InterfaceTypeLabelNr2Dot5GBASEDashT2Dot5GE string = "2.5GBASE-T (2.5GE)" + // InterfaceRfChannelLabelNr52432MHz captures enum value "5 (2432 MHz)" + InterfaceRfChannelLabelNr52432MHz string = "5 (2432 MHz)" + + // InterfaceRfChannelLabelNr62437MHz captures enum value "6 (2437 MHz)" + InterfaceRfChannelLabelNr62437MHz string = "6 (2437 MHz)" + + // InterfaceRfChannelLabelNr72442MHz captures enum value "7 (2442 MHz)" + InterfaceRfChannelLabelNr72442MHz string = "7 (2442 MHz)" + + // InterfaceRfChannelLabelNr82447MHz captures enum value "8 (2447 MHz)" + InterfaceRfChannelLabelNr82447MHz string = "8 (2447 MHz)" + + // InterfaceRfChannelLabelNr92452MHz captures enum value "9 (2452 MHz)" + InterfaceRfChannelLabelNr92452MHz string = "9 (2452 MHz)" + + // InterfaceRfChannelLabelNr102457MHz captures enum value "10 (2457 MHz)" + InterfaceRfChannelLabelNr102457MHz string = "10 (2457 MHz)" + + // InterfaceRfChannelLabelNr112462MHz captures enum value "11 (2462 MHz)" + InterfaceRfChannelLabelNr112462MHz string = "11 (2462 MHz)" + + // InterfaceRfChannelLabelNr122467MHz captures enum value "12 (2467 MHz)" + InterfaceRfChannelLabelNr122467MHz string = "12 (2467 MHz)" + + // InterfaceRfChannelLabelNr132472MHz captures enum value "13 (2472 MHz)" + InterfaceRfChannelLabelNr132472MHz string = "13 (2472 MHz)" + + // InterfaceRfChannelLabelNr32516020MHz captures enum value "32 (5160/20 MHz)" + InterfaceRfChannelLabelNr32516020MHz string = "32 (5160/20 MHz)" + + // InterfaceRfChannelLabelNr34517040MHz captures enum value "34 (5170/40 MHz)" + InterfaceRfChannelLabelNr34517040MHz string = "34 (5170/40 MHz)" + + // InterfaceRfChannelLabelNr36518020MHz captures enum value "36 (5180/20 MHz)" + InterfaceRfChannelLabelNr36518020MHz string = "36 (5180/20 MHz)" + + // InterfaceRfChannelLabelNr38519040MHz captures enum value "38 (5190/40 MHz)" + InterfaceRfChannelLabelNr38519040MHz string = "38 (5190/40 MHz)" + + // InterfaceRfChannelLabelNr40520020MHz captures enum value "40 (5200/20 MHz)" + InterfaceRfChannelLabelNr40520020MHz string = "40 (5200/20 MHz)" + + // InterfaceRfChannelLabelNr42521080MHz captures enum value "42 (5210/80 MHz)" + InterfaceRfChannelLabelNr42521080MHz string = "42 (5210/80 MHz)" + + // InterfaceRfChannelLabelNr44522020MHz captures enum value "44 (5220/20 MHz)" + InterfaceRfChannelLabelNr44522020MHz string = "44 (5220/20 MHz)" + + // InterfaceRfChannelLabelNr46523040MHz captures enum value "46 (5230/40 MHz)" + InterfaceRfChannelLabelNr46523040MHz string = "46 (5230/40 MHz)" + + // InterfaceRfChannelLabelNr48524020MHz captures enum value "48 (5240/20 MHz)" + InterfaceRfChannelLabelNr48524020MHz string = "48 (5240/20 MHz)" + + // InterfaceRfChannelLabelNr505250160MHz captures enum value "50 (5250/160 MHz)" + InterfaceRfChannelLabelNr505250160MHz string = "50 (5250/160 MHz)" + + // InterfaceRfChannelLabelNr52526020MHz captures enum value "52 (5260/20 MHz)" + InterfaceRfChannelLabelNr52526020MHz string = "52 (5260/20 MHz)" + + // InterfaceRfChannelLabelNr54527040MHz captures enum value "54 (5270/40 MHz)" + InterfaceRfChannelLabelNr54527040MHz string = "54 (5270/40 MHz)" + + // InterfaceRfChannelLabelNr56528020MHz captures enum value "56 (5280/20 MHz)" + InterfaceRfChannelLabelNr56528020MHz string = "56 (5280/20 MHz)" + + // InterfaceRfChannelLabelNr58529080MHz captures enum value "58 (5290/80 MHz)" + InterfaceRfChannelLabelNr58529080MHz string = "58 (5290/80 MHz)" + + // InterfaceRfChannelLabelNr60530020MHz captures enum value "60 (5300/20 MHz)" + InterfaceRfChannelLabelNr60530020MHz string = "60 (5300/20 MHz)" + + // InterfaceRfChannelLabelNr62531040MHz captures enum value "62 (5310/40 MHz)" + InterfaceRfChannelLabelNr62531040MHz string = "62 (5310/40 MHz)" + + // InterfaceRfChannelLabelNr64532020MHz captures enum value "64 (5320/20 MHz)" + InterfaceRfChannelLabelNr64532020MHz string = "64 (5320/20 MHz)" + + // InterfaceRfChannelLabelNr100550020MHz captures enum value "100 (5500/20 MHz)" + InterfaceRfChannelLabelNr100550020MHz string = "100 (5500/20 MHz)" + + // InterfaceRfChannelLabelNr102551040MHz captures enum value "102 (5510/40 MHz)" + InterfaceRfChannelLabelNr102551040MHz string = "102 (5510/40 MHz)" + + // InterfaceRfChannelLabelNr104552020MHz captures enum value "104 (5520/20 MHz)" + InterfaceRfChannelLabelNr104552020MHz string = "104 (5520/20 MHz)" + + // InterfaceRfChannelLabelNr106553080MHz captures enum value "106 (5530/80 MHz)" + InterfaceRfChannelLabelNr106553080MHz string = "106 (5530/80 MHz)" + + // InterfaceRfChannelLabelNr108554020MHz captures enum value "108 (5540/20 MHz)" + InterfaceRfChannelLabelNr108554020MHz string = "108 (5540/20 MHz)" + + // InterfaceRfChannelLabelNr110555040MHz captures enum value "110 (5550/40 MHz)" + InterfaceRfChannelLabelNr110555040MHz string = "110 (5550/40 MHz)" + + // InterfaceRfChannelLabelNr112556020MHz captures enum value "112 (5560/20 MHz)" + InterfaceRfChannelLabelNr112556020MHz string = "112 (5560/20 MHz)" + + // InterfaceRfChannelLabelNr1145570160MHz captures enum value "114 (5570/160 MHz)" + InterfaceRfChannelLabelNr1145570160MHz string = "114 (5570/160 MHz)" + + // InterfaceRfChannelLabelNr116558020MHz captures enum value "116 (5580/20 MHz)" + InterfaceRfChannelLabelNr116558020MHz string = "116 (5580/20 MHz)" + + // InterfaceRfChannelLabelNr118559040MHz captures enum value "118 (5590/40 MHz)" + InterfaceRfChannelLabelNr118559040MHz string = "118 (5590/40 MHz)" + + // InterfaceRfChannelLabelNr120560020MHz captures enum value "120 (5600/20 MHz)" + InterfaceRfChannelLabelNr120560020MHz string = "120 (5600/20 MHz)" + + // InterfaceRfChannelLabelNr122561080MHz captures enum value "122 (5610/80 MHz)" + InterfaceRfChannelLabelNr122561080MHz string = "122 (5610/80 MHz)" + + // InterfaceRfChannelLabelNr124562020MHz captures enum value "124 (5620/20 MHz)" + InterfaceRfChannelLabelNr124562020MHz string = "124 (5620/20 MHz)" + + // InterfaceRfChannelLabelNr126563040MHz captures enum value "126 (5630/40 MHz)" + InterfaceRfChannelLabelNr126563040MHz string = "126 (5630/40 MHz)" + + // InterfaceRfChannelLabelNr128564020MHz captures enum value "128 (5640/20 MHz)" + InterfaceRfChannelLabelNr128564020MHz string = "128 (5640/20 MHz)" + + // InterfaceRfChannelLabelNr132566020MHz captures enum value "132 (5660/20 MHz)" + InterfaceRfChannelLabelNr132566020MHz string = "132 (5660/20 MHz)" + + // InterfaceRfChannelLabelNr134567040MHz captures enum value "134 (5670/40 MHz)" + InterfaceRfChannelLabelNr134567040MHz string = "134 (5670/40 MHz)" + + // InterfaceRfChannelLabelNr136568020MHz captures enum value "136 (5680/20 MHz)" + InterfaceRfChannelLabelNr136568020MHz string = "136 (5680/20 MHz)" + + // InterfaceRfChannelLabelNr138569080MHz captures enum value "138 (5690/80 MHz)" + InterfaceRfChannelLabelNr138569080MHz string = "138 (5690/80 MHz)" + + // InterfaceRfChannelLabelNr140570020MHz captures enum value "140 (5700/20 MHz)" + InterfaceRfChannelLabelNr140570020MHz string = "140 (5700/20 MHz)" + + // InterfaceRfChannelLabelNr142571040MHz captures enum value "142 (5710/40 MHz)" + InterfaceRfChannelLabelNr142571040MHz string = "142 (5710/40 MHz)" + + // InterfaceRfChannelLabelNr144572020MHz captures enum value "144 (5720/20 MHz)" + InterfaceRfChannelLabelNr144572020MHz string = "144 (5720/20 MHz)" + + // InterfaceRfChannelLabelNr149574520MHz captures enum value "149 (5745/20 MHz)" + InterfaceRfChannelLabelNr149574520MHz string = "149 (5745/20 MHz)" + + // InterfaceRfChannelLabelNr151575540MHz captures enum value "151 (5755/40 MHz)" + InterfaceRfChannelLabelNr151575540MHz string = "151 (5755/40 MHz)" + + // InterfaceRfChannelLabelNr153576520MHz captures enum value "153 (5765/20 MHz)" + InterfaceRfChannelLabelNr153576520MHz string = "153 (5765/20 MHz)" + + // InterfaceRfChannelLabelNr155577580MHz captures enum value "155 (5775/80 MHz)" + InterfaceRfChannelLabelNr155577580MHz string = "155 (5775/80 MHz)" + + // InterfaceRfChannelLabelNr157578520MHz captures enum value "157 (5785/20 MHz)" + InterfaceRfChannelLabelNr157578520MHz string = "157 (5785/20 MHz)" + + // InterfaceRfChannelLabelNr159579540MHz captures enum value "159 (5795/40 MHz)" + InterfaceRfChannelLabelNr159579540MHz string = "159 (5795/40 MHz)" + + // InterfaceRfChannelLabelNr161580520MHz captures enum value "161 (5805/20 MHz)" + InterfaceRfChannelLabelNr161580520MHz string = "161 (5805/20 MHz)" + + // InterfaceRfChannelLabelNr1635815160MHz captures enum value "163 (5815/160 MHz)" + InterfaceRfChannelLabelNr1635815160MHz string = "163 (5815/160 MHz)" + + // InterfaceRfChannelLabelNr165582520MHz captures enum value "165 (5825/20 MHz)" + InterfaceRfChannelLabelNr165582520MHz string = "165 (5825/20 MHz)" + + // InterfaceRfChannelLabelNr167583540MHz captures enum value "167 (5835/40 MHz)" + InterfaceRfChannelLabelNr167583540MHz string = "167 (5835/40 MHz)" + + // InterfaceRfChannelLabelNr169584520MHz captures enum value "169 (5845/20 MHz)" + InterfaceRfChannelLabelNr169584520MHz string = "169 (5845/20 MHz)" + + // InterfaceRfChannelLabelNr171585580MHz captures enum value "171 (5855/80 MHz)" + InterfaceRfChannelLabelNr171585580MHz string = "171 (5855/80 MHz)" + + // InterfaceRfChannelLabelNr173586520MHz captures enum value "173 (5865/20 MHz)" + InterfaceRfChannelLabelNr173586520MHz string = "173 (5865/20 MHz)" + + // InterfaceRfChannelLabelNr175587540MHz captures enum value "175 (5875/40 MHz)" + InterfaceRfChannelLabelNr175587540MHz string = "175 (5875/40 MHz)" + + // InterfaceRfChannelLabelNr177588520MHz captures enum value "177 (5885/20 MHz)" + InterfaceRfChannelLabelNr177588520MHz string = "177 (5885/20 MHz)" + + // InterfaceRfChannelLabelNr1595520MHz captures enum value "1 (5955/20 MHz)" + InterfaceRfChannelLabelNr1595520MHz string = "1 (5955/20 MHz)" + + // InterfaceRfChannelLabelNr3596540MHz captures enum value "3 (5965/40 MHz)" + InterfaceRfChannelLabelNr3596540MHz string = "3 (5965/40 MHz)" + + // InterfaceRfChannelLabelNr5597520MHz captures enum value "5 (5975/20 MHz)" + InterfaceRfChannelLabelNr5597520MHz string = "5 (5975/20 MHz)" + + // InterfaceRfChannelLabelNr7598580MHz captures enum value "7 (5985/80 MHz)" + InterfaceRfChannelLabelNr7598580MHz string = "7 (5985/80 MHz)" + + // InterfaceRfChannelLabelNr9599520MHz captures enum value "9 (5995/20 MHz)" + InterfaceRfChannelLabelNr9599520MHz string = "9 (5995/20 MHz)" + + // InterfaceRfChannelLabelNr11600540MHz captures enum value "11 (6005/40 MHz)" + InterfaceRfChannelLabelNr11600540MHz string = "11 (6005/40 MHz)" + + // InterfaceRfChannelLabelNr13601520MHz captures enum value "13 (6015/20 MHz)" + InterfaceRfChannelLabelNr13601520MHz string = "13 (6015/20 MHz)" + + // InterfaceRfChannelLabelNr156025160MHz captures enum value "15 (6025/160 MHz)" + InterfaceRfChannelLabelNr156025160MHz string = "15 (6025/160 MHz)" + + // InterfaceRfChannelLabelNr17603520MHz captures enum value "17 (6035/20 MHz)" + InterfaceRfChannelLabelNr17603520MHz string = "17 (6035/20 MHz)" + + // InterfaceRfChannelLabelNr19604540MHz captures enum value "19 (6045/40 MHz)" + InterfaceRfChannelLabelNr19604540MHz string = "19 (6045/40 MHz)" + + // InterfaceRfChannelLabelNr21605520MHz captures enum value "21 (6055/20 MHz)" + InterfaceRfChannelLabelNr21605520MHz string = "21 (6055/20 MHz)" + + // InterfaceRfChannelLabelNr23606580MHz captures enum value "23 (6065/80 MHz)" + InterfaceRfChannelLabelNr23606580MHz string = "23 (6065/80 MHz)" + + // InterfaceRfChannelLabelNr25607520MHz captures enum value "25 (6075/20 MHz)" + InterfaceRfChannelLabelNr25607520MHz string = "25 (6075/20 MHz)" + + // InterfaceRfChannelLabelNr27608540MHz captures enum value "27 (6085/40 MHz)" + InterfaceRfChannelLabelNr27608540MHz string = "27 (6085/40 MHz)" + + // InterfaceRfChannelLabelNr29609520MHz captures enum value "29 (6095/20 MHz)" + InterfaceRfChannelLabelNr29609520MHz string = "29 (6095/20 MHz)" + + // InterfaceRfChannelLabelNr316105320MHz captures enum value "31 (6105/320 MHz)" + InterfaceRfChannelLabelNr316105320MHz string = "31 (6105/320 MHz)" + + // InterfaceRfChannelLabelNr33611520MHz captures enum value "33 (6115/20 MHz)" + InterfaceRfChannelLabelNr33611520MHz string = "33 (6115/20 MHz)" + + // InterfaceRfChannelLabelNr35612540MHz captures enum value "35 (6125/40 MHz)" + InterfaceRfChannelLabelNr35612540MHz string = "35 (6125/40 MHz)" + + // InterfaceRfChannelLabelNr37613520MHz captures enum value "37 (6135/20 MHz)" + InterfaceRfChannelLabelNr37613520MHz string = "37 (6135/20 MHz)" + + // InterfaceRfChannelLabelNr39614580MHz captures enum value "39 (6145/80 MHz)" + InterfaceRfChannelLabelNr39614580MHz string = "39 (6145/80 MHz)" + + // InterfaceRfChannelLabelNr41615520MHz captures enum value "41 (6155/20 MHz)" + InterfaceRfChannelLabelNr41615520MHz string = "41 (6155/20 MHz)" + + // InterfaceRfChannelLabelNr43616540MHz captures enum value "43 (6165/40 MHz)" + InterfaceRfChannelLabelNr43616540MHz string = "43 (6165/40 MHz)" + + // InterfaceRfChannelLabelNr45617520MHz captures enum value "45 (6175/20 MHz)" + InterfaceRfChannelLabelNr45617520MHz string = "45 (6175/20 MHz)" + + // InterfaceRfChannelLabelNr476185160MHz captures enum value "47 (6185/160 MHz)" + InterfaceRfChannelLabelNr476185160MHz string = "47 (6185/160 MHz)" + + // InterfaceRfChannelLabelNr49619520MHz captures enum value "49 (6195/20 MHz)" + InterfaceRfChannelLabelNr49619520MHz string = "49 (6195/20 MHz)" + + // InterfaceRfChannelLabelNr51620540MHz captures enum value "51 (6205/40 MHz)" + InterfaceRfChannelLabelNr51620540MHz string = "51 (6205/40 MHz)" + + // InterfaceRfChannelLabelNr53621520MHz captures enum value "53 (6215/20 MHz)" + InterfaceRfChannelLabelNr53621520MHz string = "53 (6215/20 MHz)" + + // InterfaceRfChannelLabelNr55622580MHz captures enum value "55 (6225/80 MHz)" + InterfaceRfChannelLabelNr55622580MHz string = "55 (6225/80 MHz)" + + // InterfaceRfChannelLabelNr57623520MHz captures enum value "57 (6235/20 MHz)" + InterfaceRfChannelLabelNr57623520MHz string = "57 (6235/20 MHz)" + + // InterfaceRfChannelLabelNr59624540MHz captures enum value "59 (6245/40 MHz)" + InterfaceRfChannelLabelNr59624540MHz string = "59 (6245/40 MHz)" + + // InterfaceRfChannelLabelNr61625520MHz captures enum value "61 (6255/20 MHz)" + InterfaceRfChannelLabelNr61625520MHz string = "61 (6255/20 MHz)" + + // InterfaceRfChannelLabelNr65627520MHz captures enum value "65 (6275/20 MHz)" + InterfaceRfChannelLabelNr65627520MHz string = "65 (6275/20 MHz)" + + // InterfaceRfChannelLabelNr67628540MHz captures enum value "67 (6285/40 MHz)" + InterfaceRfChannelLabelNr67628540MHz string = "67 (6285/40 MHz)" + + // InterfaceRfChannelLabelNr69629520MHz captures enum value "69 (6295/20 MHz)" + InterfaceRfChannelLabelNr69629520MHz string = "69 (6295/20 MHz)" + + // InterfaceRfChannelLabelNr71630580MHz captures enum value "71 (6305/80 MHz)" + InterfaceRfChannelLabelNr71630580MHz string = "71 (6305/80 MHz)" + + // InterfaceRfChannelLabelNr73631520MHz captures enum value "73 (6315/20 MHz)" + InterfaceRfChannelLabelNr73631520MHz string = "73 (6315/20 MHz)" + + // InterfaceRfChannelLabelNr75632540MHz captures enum value "75 (6325/40 MHz)" + InterfaceRfChannelLabelNr75632540MHz string = "75 (6325/40 MHz)" + + // InterfaceRfChannelLabelNr77633520MHz captures enum value "77 (6335/20 MHz)" + InterfaceRfChannelLabelNr77633520MHz string = "77 (6335/20 MHz)" + + // InterfaceRfChannelLabelNr796345160MHz captures enum value "79 (6345/160 MHz)" + InterfaceRfChannelLabelNr796345160MHz string = "79 (6345/160 MHz)" + + // InterfaceRfChannelLabelNr81635520MHz captures enum value "81 (6355/20 MHz)" + InterfaceRfChannelLabelNr81635520MHz string = "81 (6355/20 MHz)" + + // InterfaceRfChannelLabelNr83636540MHz captures enum value "83 (6365/40 MHz)" + InterfaceRfChannelLabelNr83636540MHz string = "83 (6365/40 MHz)" + + // InterfaceRfChannelLabelNr85637520MHz captures enum value "85 (6375/20 MHz)" + InterfaceRfChannelLabelNr85637520MHz string = "85 (6375/20 MHz)" + + // InterfaceRfChannelLabelNr87638580MHz captures enum value "87 (6385/80 MHz)" + InterfaceRfChannelLabelNr87638580MHz string = "87 (6385/80 MHz)" + + // InterfaceRfChannelLabelNr89639520MHz captures enum value "89 (6395/20 MHz)" + InterfaceRfChannelLabelNr89639520MHz string = "89 (6395/20 MHz)" + + // InterfaceRfChannelLabelNr91640540MHz captures enum value "91 (6405/40 MHz)" + InterfaceRfChannelLabelNr91640540MHz string = "91 (6405/40 MHz)" + + // InterfaceRfChannelLabelNr93641520MHz captures enum value "93 (6415/20 MHz)" + InterfaceRfChannelLabelNr93641520MHz string = "93 (6415/20 MHz)" + + // InterfaceRfChannelLabelNr956425320MHz captures enum value "95 (6425/320 MHz)" + InterfaceRfChannelLabelNr956425320MHz string = "95 (6425/320 MHz)" + + // InterfaceRfChannelLabelNr97643520MHz captures enum value "97 (6435/20 MHz)" + InterfaceRfChannelLabelNr97643520MHz string = "97 (6435/20 MHz)" + + // InterfaceRfChannelLabelNr99644540MHz captures enum value "99 (6445/40 MHz)" + InterfaceRfChannelLabelNr99644540MHz string = "99 (6445/40 MHz)" + + // InterfaceRfChannelLabelNr101645520MHz captures enum value "101 (6455/20 MHz)" + InterfaceRfChannelLabelNr101645520MHz string = "101 (6455/20 MHz)" + + // InterfaceRfChannelLabelNr103646580MHz captures enum value "103 (6465/80 MHz)" + InterfaceRfChannelLabelNr103646580MHz string = "103 (6465/80 MHz)" + + // InterfaceRfChannelLabelNr105647520MHz captures enum value "105 (6475/20 MHz)" + InterfaceRfChannelLabelNr105647520MHz string = "105 (6475/20 MHz)" + + // InterfaceRfChannelLabelNr107648540MHz captures enum value "107 (6485/40 MHz)" + InterfaceRfChannelLabelNr107648540MHz string = "107 (6485/40 MHz)" + + // InterfaceRfChannelLabelNr109649520MHz captures enum value "109 (6495/20 MHz)" + InterfaceRfChannelLabelNr109649520MHz string = "109 (6495/20 MHz)" + + // InterfaceRfChannelLabelNr1116505160MHz captures enum value "111 (6505/160 MHz)" + InterfaceRfChannelLabelNr1116505160MHz string = "111 (6505/160 MHz)" + + // InterfaceRfChannelLabelNr113651520MHz captures enum value "113 (6515/20 MHz)" + InterfaceRfChannelLabelNr113651520MHz string = "113 (6515/20 MHz)" + + // InterfaceRfChannelLabelNr115652540MHz captures enum value "115 (6525/40 MHz)" + InterfaceRfChannelLabelNr115652540MHz string = "115 (6525/40 MHz)" + + // InterfaceRfChannelLabelNr117653520MHz captures enum value "117 (6535/20 MHz)" + InterfaceRfChannelLabelNr117653520MHz string = "117 (6535/20 MHz)" + + // InterfaceRfChannelLabelNr119654580MHz captures enum value "119 (6545/80 MHz)" + InterfaceRfChannelLabelNr119654580MHz string = "119 (6545/80 MHz)" + + // InterfaceRfChannelLabelNr121655520MHz captures enum value "121 (6555/20 MHz)" + InterfaceRfChannelLabelNr121655520MHz string = "121 (6555/20 MHz)" + + // InterfaceRfChannelLabelNr123656540MHz captures enum value "123 (6565/40 MHz)" + InterfaceRfChannelLabelNr123656540MHz string = "123 (6565/40 MHz)" + + // InterfaceRfChannelLabelNr125657520MHz captures enum value "125 (6575/20 MHz)" + InterfaceRfChannelLabelNr125657520MHz string = "125 (6575/20 MHz)" + + // InterfaceRfChannelLabelNr129659520MHz captures enum value "129 (6595/20 MHz)" + InterfaceRfChannelLabelNr129659520MHz string = "129 (6595/20 MHz)" + + // InterfaceRfChannelLabelNr131660540MHz captures enum value "131 (6605/40 MHz)" + InterfaceRfChannelLabelNr131660540MHz string = "131 (6605/40 MHz)" + + // InterfaceRfChannelLabelNr133661520MHz captures enum value "133 (6615/20 MHz)" + InterfaceRfChannelLabelNr133661520MHz string = "133 (6615/20 MHz)" + + // InterfaceRfChannelLabelNr135662580MHz captures enum value "135 (6625/80 MHz)" + InterfaceRfChannelLabelNr135662580MHz string = "135 (6625/80 MHz)" + + // InterfaceRfChannelLabelNr137663520MHz captures enum value "137 (6635/20 MHz)" + InterfaceRfChannelLabelNr137663520MHz string = "137 (6635/20 MHz)" + + // InterfaceRfChannelLabelNr139664540MHz captures enum value "139 (6645/40 MHz)" + InterfaceRfChannelLabelNr139664540MHz string = "139 (6645/40 MHz)" + + // InterfaceRfChannelLabelNr141665520MHz captures enum value "141 (6655/20 MHz)" + InterfaceRfChannelLabelNr141665520MHz string = "141 (6655/20 MHz)" + + // InterfaceRfChannelLabelNr1436665160MHz captures enum value "143 (6665/160 MHz)" + InterfaceRfChannelLabelNr1436665160MHz string = "143 (6665/160 MHz)" + + // InterfaceRfChannelLabelNr145667520MHz captures enum value "145 (6675/20 MHz)" + InterfaceRfChannelLabelNr145667520MHz string = "145 (6675/20 MHz)" + + // InterfaceRfChannelLabelNr147668540MHz captures enum value "147 (6685/40 MHz)" + InterfaceRfChannelLabelNr147668540MHz string = "147 (6685/40 MHz)" + + // InterfaceRfChannelLabelNr149669520MHz captures enum value "149 (6695/20 MHz)" + InterfaceRfChannelLabelNr149669520MHz string = "149 (6695/20 MHz)" + + // InterfaceRfChannelLabelNr151670580MHz captures enum value "151 (6705/80 MHz)" + InterfaceRfChannelLabelNr151670580MHz string = "151 (6705/80 MHz)" + + // InterfaceRfChannelLabelNr153671520MHz captures enum value "153 (6715/20 MHz)" + InterfaceRfChannelLabelNr153671520MHz string = "153 (6715/20 MHz)" + + // InterfaceRfChannelLabelNr155672540MHz captures enum value "155 (6725/40 MHz)" + InterfaceRfChannelLabelNr155672540MHz string = "155 (6725/40 MHz)" + + // InterfaceRfChannelLabelNr157673520MHz captures enum value "157 (6735/20 MHz)" + InterfaceRfChannelLabelNr157673520MHz string = "157 (6735/20 MHz)" + + // InterfaceRfChannelLabelNr1596745320MHz captures enum value "159 (6745/320 MHz)" + InterfaceRfChannelLabelNr1596745320MHz string = "159 (6745/320 MHz)" + + // InterfaceRfChannelLabelNr161675520MHz captures enum value "161 (6755/20 MHz)" + InterfaceRfChannelLabelNr161675520MHz string = "161 (6755/20 MHz)" + + // InterfaceRfChannelLabelNr163676540MHz captures enum value "163 (6765/40 MHz)" + InterfaceRfChannelLabelNr163676540MHz string = "163 (6765/40 MHz)" + + // InterfaceRfChannelLabelNr165677520MHz captures enum value "165 (6775/20 MHz)" + InterfaceRfChannelLabelNr165677520MHz string = "165 (6775/20 MHz)" + + // InterfaceRfChannelLabelNr167678580MHz captures enum value "167 (6785/80 MHz)" + InterfaceRfChannelLabelNr167678580MHz string = "167 (6785/80 MHz)" + + // InterfaceRfChannelLabelNr169679520MHz captures enum value "169 (6795/20 MHz)" + InterfaceRfChannelLabelNr169679520MHz string = "169 (6795/20 MHz)" + + // InterfaceRfChannelLabelNr171680540MHz captures enum value "171 (6805/40 MHz)" + InterfaceRfChannelLabelNr171680540MHz string = "171 (6805/40 MHz)" + + // InterfaceRfChannelLabelNr173681520MHz captures enum value "173 (6815/20 MHz)" + InterfaceRfChannelLabelNr173681520MHz string = "173 (6815/20 MHz)" + + // InterfaceRfChannelLabelNr1756825160MHz captures enum value "175 (6825/160 MHz)" + InterfaceRfChannelLabelNr1756825160MHz string = "175 (6825/160 MHz)" + + // InterfaceRfChannelLabelNr177683520MHz captures enum value "177 (6835/20 MHz)" + InterfaceRfChannelLabelNr177683520MHz string = "177 (6835/20 MHz)" + + // InterfaceRfChannelLabelNr179684540MHz captures enum value "179 (6845/40 MHz)" + InterfaceRfChannelLabelNr179684540MHz string = "179 (6845/40 MHz)" + + // InterfaceRfChannelLabelNr181685520MHz captures enum value "181 (6855/20 MHz)" + InterfaceRfChannelLabelNr181685520MHz string = "181 (6855/20 MHz)" + + // InterfaceRfChannelLabelNr183686580MHz captures enum value "183 (6865/80 MHz)" + InterfaceRfChannelLabelNr183686580MHz string = "183 (6865/80 MHz)" + + // InterfaceRfChannelLabelNr185687520MHz captures enum value "185 (6875/20 MHz)" + InterfaceRfChannelLabelNr185687520MHz string = "185 (6875/20 MHz)" + + // InterfaceRfChannelLabelNr187688540MHz captures enum value "187 (6885/40 MHz)" + InterfaceRfChannelLabelNr187688540MHz string = "187 (6885/40 MHz)" + + // InterfaceRfChannelLabelNr189689520MHz captures enum value "189 (6895/20 MHz)" + InterfaceRfChannelLabelNr189689520MHz string = "189 (6895/20 MHz)" + + // InterfaceRfChannelLabelNr193691520MHz captures enum value "193 (6915/20 MHz)" + InterfaceRfChannelLabelNr193691520MHz string = "193 (6915/20 MHz)" + + // InterfaceRfChannelLabelNr195692540MHz captures enum value "195 (6925/40 MHz)" + InterfaceRfChannelLabelNr195692540MHz string = "195 (6925/40 MHz)" + + // InterfaceRfChannelLabelNr197693520MHz captures enum value "197 (6935/20 MHz)" + InterfaceRfChannelLabelNr197693520MHz string = "197 (6935/20 MHz)" + + // InterfaceRfChannelLabelNr199694580MHz captures enum value "199 (6945/80 MHz)" + InterfaceRfChannelLabelNr199694580MHz string = "199 (6945/80 MHz)" + + // InterfaceRfChannelLabelNr201695520MHz captures enum value "201 (6955/20 MHz)" + InterfaceRfChannelLabelNr201695520MHz string = "201 (6955/20 MHz)" + + // InterfaceRfChannelLabelNr203696540MHz captures enum value "203 (6965/40 MHz)" + InterfaceRfChannelLabelNr203696540MHz string = "203 (6965/40 MHz)" + + // InterfaceRfChannelLabelNr205697520MHz captures enum value "205 (6975/20 MHz)" + InterfaceRfChannelLabelNr205697520MHz string = "205 (6975/20 MHz)" + + // InterfaceRfChannelLabelNr2076985160MHz captures enum value "207 (6985/160 MHz)" + InterfaceRfChannelLabelNr2076985160MHz string = "207 (6985/160 MHz)" + + // InterfaceRfChannelLabelNr209699520MHz captures enum value "209 (6995/20 MHz)" + InterfaceRfChannelLabelNr209699520MHz string = "209 (6995/20 MHz)" + + // InterfaceRfChannelLabelNr211700540MHz captures enum value "211 (7005/40 MHz)" + InterfaceRfChannelLabelNr211700540MHz string = "211 (7005/40 MHz)" + + // InterfaceRfChannelLabelNr213701520MHz captures enum value "213 (7015/20 MHz)" + InterfaceRfChannelLabelNr213701520MHz string = "213 (7015/20 MHz)" + + // InterfaceRfChannelLabelNr215702580MHz captures enum value "215 (7025/80 MHz)" + InterfaceRfChannelLabelNr215702580MHz string = "215 (7025/80 MHz)" + + // InterfaceRfChannelLabelNr217703520MHz captures enum value "217 (7035/20 MHz)" + InterfaceRfChannelLabelNr217703520MHz string = "217 (7035/20 MHz)" + + // InterfaceRfChannelLabelNr219704540MHz captures enum value "219 (7045/40 MHz)" + InterfaceRfChannelLabelNr219704540MHz string = "219 (7045/40 MHz)" + + // InterfaceRfChannelLabelNr221705520MHz captures enum value "221 (7055/20 MHz)" + InterfaceRfChannelLabelNr221705520MHz string = "221 (7055/20 MHz)" + + // InterfaceRfChannelLabelNr225707520MHz captures enum value "225 (7075/20 MHz)" + InterfaceRfChannelLabelNr225707520MHz string = "225 (7075/20 MHz)" + + // InterfaceRfChannelLabelNr227708540MHz captures enum value "227 (7085/40 MHz)" + InterfaceRfChannelLabelNr227708540MHz string = "227 (7085/40 MHz)" + + // InterfaceRfChannelLabelNr229709520MHz captures enum value "229 (7095/20 MHz)" + InterfaceRfChannelLabelNr229709520MHz string = "229 (7095/20 MHz)" + + // InterfaceRfChannelLabelNr233711520MHz captures enum value "233 (7115/20 MHz)" + InterfaceRfChannelLabelNr233711520MHz string = "233 (7115/20 MHz)" + + // InterfaceRfChannelLabelNr158Dot322Dot16GHz captures enum value "1 (58.32/2.16 GHz)" + InterfaceRfChannelLabelNr158Dot322Dot16GHz string = "1 (58.32/2.16 GHz)" + + // InterfaceRfChannelLabelNr260Dot482Dot16GHz captures enum value "2 (60.48/2.16 GHz)" + InterfaceRfChannelLabelNr260Dot482Dot16GHz string = "2 (60.48/2.16 GHz)" + + // InterfaceRfChannelLabelNr362Dot642Dot16GHz captures enum value "3 (62.64/2.16 GHz)" + InterfaceRfChannelLabelNr362Dot642Dot16GHz string = "3 (62.64/2.16 GHz)" + + // InterfaceRfChannelLabelNr464Dot802Dot16GHz captures enum value "4 (64.80/2.16 GHz)" + InterfaceRfChannelLabelNr464Dot802Dot16GHz string = "4 (64.80/2.16 GHz)" + + // InterfaceRfChannelLabelNr566Dot962Dot16GHz captures enum value "5 (66.96/2.16 GHz)" + InterfaceRfChannelLabelNr566Dot962Dot16GHz string = "5 (66.96/2.16 GHz)" + + // InterfaceRfChannelLabelNr669Dot122Dot16GHz captures enum value "6 (69.12/2.16 GHz)" + InterfaceRfChannelLabelNr669Dot122Dot16GHz string = "6 (69.12/2.16 GHz)" + + // InterfaceRfChannelLabelNr959Dot404Dot32GHz captures enum value "9 (59.40/4.32 GHz)" + InterfaceRfChannelLabelNr959Dot404Dot32GHz string = "9 (59.40/4.32 GHz)" + + // InterfaceRfChannelLabelNr1061Dot564Dot32GHz captures enum value "10 (61.56/4.32 GHz)" + InterfaceRfChannelLabelNr1061Dot564Dot32GHz string = "10 (61.56/4.32 GHz)" + + // InterfaceRfChannelLabelNr1163Dot724Dot32GHz captures enum value "11 (63.72/4.32 GHz)" + InterfaceRfChannelLabelNr1163Dot724Dot32GHz string = "11 (63.72/4.32 GHz)" + + // InterfaceRfChannelLabelNr1265Dot884Dot32GHz captures enum value "12 (65.88/4.32 GHz)" + InterfaceRfChannelLabelNr1265Dot884Dot32GHz string = "12 (65.88/4.32 GHz)" + + // InterfaceRfChannelLabelNr1368Dot044Dot32GHz captures enum value "13 (68.04/4.32 GHz)" + InterfaceRfChannelLabelNr1368Dot044Dot32GHz string = "13 (68.04/4.32 GHz)" + + // InterfaceRfChannelLabelNr1760Dot486Dot48GHz captures enum value "17 (60.48/6.48 GHz)" + InterfaceRfChannelLabelNr1760Dot486Dot48GHz string = "17 (60.48/6.48 GHz)" + + // InterfaceRfChannelLabelNr1862Dot646Dot48GHz captures enum value "18 (62.64/6.48 GHz)" + InterfaceRfChannelLabelNr1862Dot646Dot48GHz string = "18 (62.64/6.48 GHz)" + + // InterfaceRfChannelLabelNr1964Dot806Dot48GHz captures enum value "19 (64.80/6.48 GHz)" + InterfaceRfChannelLabelNr1964Dot806Dot48GHz string = "19 (64.80/6.48 GHz)" + + // InterfaceRfChannelLabelNr2066Dot966Dot48GHz captures enum value "20 (66.96/6.48 GHz)" + InterfaceRfChannelLabelNr2066Dot966Dot48GHz string = "20 (66.96/6.48 GHz)" + + // InterfaceRfChannelLabelNr2561Dot568Dot64GHz captures enum value "25 (61.56/8.64 GHz)" + InterfaceRfChannelLabelNr2561Dot568Dot64GHz string = "25 (61.56/8.64 GHz)" + + // InterfaceRfChannelLabelNr2663Dot728Dot64GHz captures enum value "26 (63.72/8.64 GHz)" + InterfaceRfChannelLabelNr2663Dot728Dot64GHz string = "26 (63.72/8.64 GHz)" + + // InterfaceRfChannelLabelNr2765Dot888Dot64GHz captures enum value "27 (65.88/8.64 GHz)" + InterfaceRfChannelLabelNr2765Dot888Dot64GHz string = "27 (65.88/8.64 GHz)" +) + +// prop value enum +func (m *InterfaceRfChannel) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, interfaceRfChannelTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InterfaceRfChannel) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("rf_channel"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("rf_channel"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var interfaceRfChannelTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["2.4g-1-2412-22","2.4g-2-2417-22","2.4g-3-2422-22","2.4g-4-2427-22","2.4g-5-2432-22","2.4g-6-2437-22","2.4g-7-2442-22","2.4g-8-2447-22","2.4g-9-2452-22","2.4g-10-2457-22","2.4g-11-2462-22","2.4g-12-2467-22","2.4g-13-2472-22","5g-32-5160-20","5g-34-5170-40","5g-36-5180-20","5g-38-5190-40","5g-40-5200-20","5g-42-5210-80","5g-44-5220-20","5g-46-5230-40","5g-48-5240-20","5g-50-5250-160","5g-52-5260-20","5g-54-5270-40","5g-56-5280-20","5g-58-5290-80","5g-60-5300-20","5g-62-5310-40","5g-64-5320-20","5g-100-5500-20","5g-102-5510-40","5g-104-5520-20","5g-106-5530-80","5g-108-5540-20","5g-110-5550-40","5g-112-5560-20","5g-114-5570-160","5g-116-5580-20","5g-118-5590-40","5g-120-5600-20","5g-122-5610-80","5g-124-5620-20","5g-126-5630-40","5g-128-5640-20","5g-132-5660-20","5g-134-5670-40","5g-136-5680-20","5g-138-5690-80","5g-140-5700-20","5g-142-5710-40","5g-144-5720-20","5g-149-5745-20","5g-151-5755-40","5g-153-5765-20","5g-155-5775-80","5g-157-5785-20","5g-159-5795-40","5g-161-5805-20","5g-163-5815-160","5g-165-5825-20","5g-167-5835-40","5g-169-5845-20","5g-171-5855-80","5g-173-5865-20","5g-175-5875-40","5g-177-5885-20","6g-1-5955-20","6g-3-5965-40","6g-5-5975-20","6g-7-5985-80","6g-9-5995-20","6g-11-6005-40","6g-13-6015-20","6g-15-6025-160","6g-17-6035-20","6g-19-6045-40","6g-21-6055-20","6g-23-6065-80","6g-25-6075-20","6g-27-6085-40","6g-29-6095-20","6g-31-6105-320","6g-33-6115-20","6g-35-6125-40","6g-37-6135-20","6g-39-6145-80","6g-41-6155-20","6g-43-6165-40","6g-45-6175-20","6g-47-6185-160","6g-49-6195-20","6g-51-6205-40","6g-53-6215-20","6g-55-6225-80","6g-57-6235-20","6g-59-6245-40","6g-61-6255-20","6g-65-6275-20","6g-67-6285-40","6g-69-6295-20","6g-71-6305-80","6g-73-6315-20","6g-75-6325-40","6g-77-6335-20","6g-79-6345-160","6g-81-6355-20","6g-83-6365-40","6g-85-6375-20","6g-87-6385-80","6g-89-6395-20","6g-91-6405-40","6g-93-6415-20","6g-95-6425-320","6g-97-6435-20","6g-99-6445-40","6g-101-6455-20","6g-103-6465-80","6g-105-6475-20","6g-107-6485-40","6g-109-6495-20","6g-111-6505-160","6g-113-6515-20","6g-115-6525-40","6g-117-6535-20","6g-119-6545-80","6g-121-6555-20","6g-123-6565-40","6g-125-6575-20","6g-129-6595-20","6g-131-6605-40","6g-133-6615-20","6g-135-6625-80","6g-137-6635-20","6g-139-6645-40","6g-141-6655-20","6g-143-6665-160","6g-145-6675-20","6g-147-6685-40","6g-149-6695-20","6g-151-6705-80","6g-153-6715-20","6g-155-6725-40","6g-157-6735-20","6g-159-6745-320","6g-161-6755-20","6g-163-6765-40","6g-165-6775-20","6g-167-6785-80","6g-169-6795-20","6g-171-6805-40","6g-173-6815-20","6g-175-6825-160","6g-177-6835-20","6g-179-6845-40","6g-181-6855-20","6g-183-6865-80","6g-185-6875-20","6g-187-6885-40","6g-189-6895-20","6g-193-6915-20","6g-195-6925-40","6g-197-6935-20","6g-199-6945-80","6g-201-6955-20","6g-203-6965-40","6g-205-6975-20","6g-207-6985-160","6g-209-6995-20","6g-211-7005-40","6g-213-7015-20","6g-215-7025-80","6g-217-7035-20","6g-219-7045-40","6g-221-7055-20","6g-225-7075-20","6g-227-7085-40","6g-229-7095-20","6g-233-7115-20","60g-1-58320-2160","60g-2-60480-2160","60g-3-62640-2160","60g-4-64800-2160","60g-5-66960-2160","60g-6-69120-2160","60g-9-59400-4320","60g-10-61560-4320","60g-11-63720-4320","60g-12-65880-4320","60g-13-68040-4320","60g-17-60480-6480","60g-18-62640-6480","60g-19-64800-6480","60g-20-66960-6480","60g-25-61560-6480","60g-26-63720-6480","60g-27-65880-6480"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + interfaceRfChannelTypeValuePropEnum = append(interfaceRfChannelTypeValuePropEnum, v) + } +} + +const ( + + // InterfaceRfChannelValueNr2Dot4gDash1Dash2412Dash22 captures enum value "2.4g-1-2412-22" + InterfaceRfChannelValueNr2Dot4gDash1Dash2412Dash22 string = "2.4g-1-2412-22" + + // InterfaceRfChannelValueNr2Dot4gDash2Dash2417Dash22 captures enum value "2.4g-2-2417-22" + InterfaceRfChannelValueNr2Dot4gDash2Dash2417Dash22 string = "2.4g-2-2417-22" + + // InterfaceRfChannelValueNr2Dot4gDash3Dash2422Dash22 captures enum value "2.4g-3-2422-22" + InterfaceRfChannelValueNr2Dot4gDash3Dash2422Dash22 string = "2.4g-3-2422-22" + + // InterfaceRfChannelValueNr2Dot4gDash4Dash2427Dash22 captures enum value "2.4g-4-2427-22" + InterfaceRfChannelValueNr2Dot4gDash4Dash2427Dash22 string = "2.4g-4-2427-22" + + // InterfaceRfChannelValueNr2Dot4gDash5Dash2432Dash22 captures enum value "2.4g-5-2432-22" + InterfaceRfChannelValueNr2Dot4gDash5Dash2432Dash22 string = "2.4g-5-2432-22" + + // InterfaceRfChannelValueNr2Dot4gDash6Dash2437Dash22 captures enum value "2.4g-6-2437-22" + InterfaceRfChannelValueNr2Dot4gDash6Dash2437Dash22 string = "2.4g-6-2437-22" + + // InterfaceRfChannelValueNr2Dot4gDash7Dash2442Dash22 captures enum value "2.4g-7-2442-22" + InterfaceRfChannelValueNr2Dot4gDash7Dash2442Dash22 string = "2.4g-7-2442-22" + + // InterfaceRfChannelValueNr2Dot4gDash8Dash2447Dash22 captures enum value "2.4g-8-2447-22" + InterfaceRfChannelValueNr2Dot4gDash8Dash2447Dash22 string = "2.4g-8-2447-22" + + // InterfaceRfChannelValueNr2Dot4gDash9Dash2452Dash22 captures enum value "2.4g-9-2452-22" + InterfaceRfChannelValueNr2Dot4gDash9Dash2452Dash22 string = "2.4g-9-2452-22" + + // InterfaceRfChannelValueNr2Dot4gDash10Dash2457Dash22 captures enum value "2.4g-10-2457-22" + InterfaceRfChannelValueNr2Dot4gDash10Dash2457Dash22 string = "2.4g-10-2457-22" + + // InterfaceRfChannelValueNr2Dot4gDash11Dash2462Dash22 captures enum value "2.4g-11-2462-22" + InterfaceRfChannelValueNr2Dot4gDash11Dash2462Dash22 string = "2.4g-11-2462-22" + + // InterfaceRfChannelValueNr2Dot4gDash12Dash2467Dash22 captures enum value "2.4g-12-2467-22" + InterfaceRfChannelValueNr2Dot4gDash12Dash2467Dash22 string = "2.4g-12-2467-22" + + // InterfaceRfChannelValueNr2Dot4gDash13Dash2472Dash22 captures enum value "2.4g-13-2472-22" + InterfaceRfChannelValueNr2Dot4gDash13Dash2472Dash22 string = "2.4g-13-2472-22" + + // InterfaceRfChannelValueNr5gDash32Dash5160Dash20 captures enum value "5g-32-5160-20" + InterfaceRfChannelValueNr5gDash32Dash5160Dash20 string = "5g-32-5160-20" + + // InterfaceRfChannelValueNr5gDash34Dash5170Dash40 captures enum value "5g-34-5170-40" + InterfaceRfChannelValueNr5gDash34Dash5170Dash40 string = "5g-34-5170-40" + + // InterfaceRfChannelValueNr5gDash36Dash5180Dash20 captures enum value "5g-36-5180-20" + InterfaceRfChannelValueNr5gDash36Dash5180Dash20 string = "5g-36-5180-20" + + // InterfaceRfChannelValueNr5gDash38Dash5190Dash40 captures enum value "5g-38-5190-40" + InterfaceRfChannelValueNr5gDash38Dash5190Dash40 string = "5g-38-5190-40" + + // InterfaceRfChannelValueNr5gDash40Dash5200Dash20 captures enum value "5g-40-5200-20" + InterfaceRfChannelValueNr5gDash40Dash5200Dash20 string = "5g-40-5200-20" + + // InterfaceRfChannelValueNr5gDash42Dash5210Dash80 captures enum value "5g-42-5210-80" + InterfaceRfChannelValueNr5gDash42Dash5210Dash80 string = "5g-42-5210-80" + + // InterfaceRfChannelValueNr5gDash44Dash5220Dash20 captures enum value "5g-44-5220-20" + InterfaceRfChannelValueNr5gDash44Dash5220Dash20 string = "5g-44-5220-20" + + // InterfaceRfChannelValueNr5gDash46Dash5230Dash40 captures enum value "5g-46-5230-40" + InterfaceRfChannelValueNr5gDash46Dash5230Dash40 string = "5g-46-5230-40" + + // InterfaceRfChannelValueNr5gDash48Dash5240Dash20 captures enum value "5g-48-5240-20" + InterfaceRfChannelValueNr5gDash48Dash5240Dash20 string = "5g-48-5240-20" + + // InterfaceRfChannelValueNr5gDash50Dash5250Dash160 captures enum value "5g-50-5250-160" + InterfaceRfChannelValueNr5gDash50Dash5250Dash160 string = "5g-50-5250-160" + + // InterfaceRfChannelValueNr5gDash52Dash5260Dash20 captures enum value "5g-52-5260-20" + InterfaceRfChannelValueNr5gDash52Dash5260Dash20 string = "5g-52-5260-20" + + // InterfaceRfChannelValueNr5gDash54Dash5270Dash40 captures enum value "5g-54-5270-40" + InterfaceRfChannelValueNr5gDash54Dash5270Dash40 string = "5g-54-5270-40" + + // InterfaceRfChannelValueNr5gDash56Dash5280Dash20 captures enum value "5g-56-5280-20" + InterfaceRfChannelValueNr5gDash56Dash5280Dash20 string = "5g-56-5280-20" + + // InterfaceRfChannelValueNr5gDash58Dash5290Dash80 captures enum value "5g-58-5290-80" + InterfaceRfChannelValueNr5gDash58Dash5290Dash80 string = "5g-58-5290-80" + + // InterfaceRfChannelValueNr5gDash60Dash5300Dash20 captures enum value "5g-60-5300-20" + InterfaceRfChannelValueNr5gDash60Dash5300Dash20 string = "5g-60-5300-20" + + // InterfaceRfChannelValueNr5gDash62Dash5310Dash40 captures enum value "5g-62-5310-40" + InterfaceRfChannelValueNr5gDash62Dash5310Dash40 string = "5g-62-5310-40" + + // InterfaceRfChannelValueNr5gDash64Dash5320Dash20 captures enum value "5g-64-5320-20" + InterfaceRfChannelValueNr5gDash64Dash5320Dash20 string = "5g-64-5320-20" + + // InterfaceRfChannelValueNr5gDash100Dash5500Dash20 captures enum value "5g-100-5500-20" + InterfaceRfChannelValueNr5gDash100Dash5500Dash20 string = "5g-100-5500-20" + + // InterfaceRfChannelValueNr5gDash102Dash5510Dash40 captures enum value "5g-102-5510-40" + InterfaceRfChannelValueNr5gDash102Dash5510Dash40 string = "5g-102-5510-40" + + // InterfaceRfChannelValueNr5gDash104Dash5520Dash20 captures enum value "5g-104-5520-20" + InterfaceRfChannelValueNr5gDash104Dash5520Dash20 string = "5g-104-5520-20" + + // InterfaceRfChannelValueNr5gDash106Dash5530Dash80 captures enum value "5g-106-5530-80" + InterfaceRfChannelValueNr5gDash106Dash5530Dash80 string = "5g-106-5530-80" + + // InterfaceRfChannelValueNr5gDash108Dash5540Dash20 captures enum value "5g-108-5540-20" + InterfaceRfChannelValueNr5gDash108Dash5540Dash20 string = "5g-108-5540-20" + + // InterfaceRfChannelValueNr5gDash110Dash5550Dash40 captures enum value "5g-110-5550-40" + InterfaceRfChannelValueNr5gDash110Dash5550Dash40 string = "5g-110-5550-40" + + // InterfaceRfChannelValueNr5gDash112Dash5560Dash20 captures enum value "5g-112-5560-20" + InterfaceRfChannelValueNr5gDash112Dash5560Dash20 string = "5g-112-5560-20" + + // InterfaceRfChannelValueNr5gDash114Dash5570Dash160 captures enum value "5g-114-5570-160" + InterfaceRfChannelValueNr5gDash114Dash5570Dash160 string = "5g-114-5570-160" + + // InterfaceRfChannelValueNr5gDash116Dash5580Dash20 captures enum value "5g-116-5580-20" + InterfaceRfChannelValueNr5gDash116Dash5580Dash20 string = "5g-116-5580-20" + + // InterfaceRfChannelValueNr5gDash118Dash5590Dash40 captures enum value "5g-118-5590-40" + InterfaceRfChannelValueNr5gDash118Dash5590Dash40 string = "5g-118-5590-40" + + // InterfaceRfChannelValueNr5gDash120Dash5600Dash20 captures enum value "5g-120-5600-20" + InterfaceRfChannelValueNr5gDash120Dash5600Dash20 string = "5g-120-5600-20" + + // InterfaceRfChannelValueNr5gDash122Dash5610Dash80 captures enum value "5g-122-5610-80" + InterfaceRfChannelValueNr5gDash122Dash5610Dash80 string = "5g-122-5610-80" + + // InterfaceRfChannelValueNr5gDash124Dash5620Dash20 captures enum value "5g-124-5620-20" + InterfaceRfChannelValueNr5gDash124Dash5620Dash20 string = "5g-124-5620-20" + + // InterfaceRfChannelValueNr5gDash126Dash5630Dash40 captures enum value "5g-126-5630-40" + InterfaceRfChannelValueNr5gDash126Dash5630Dash40 string = "5g-126-5630-40" + + // InterfaceRfChannelValueNr5gDash128Dash5640Dash20 captures enum value "5g-128-5640-20" + InterfaceRfChannelValueNr5gDash128Dash5640Dash20 string = "5g-128-5640-20" + + // InterfaceRfChannelValueNr5gDash132Dash5660Dash20 captures enum value "5g-132-5660-20" + InterfaceRfChannelValueNr5gDash132Dash5660Dash20 string = "5g-132-5660-20" + + // InterfaceRfChannelValueNr5gDash134Dash5670Dash40 captures enum value "5g-134-5670-40" + InterfaceRfChannelValueNr5gDash134Dash5670Dash40 string = "5g-134-5670-40" + + // InterfaceRfChannelValueNr5gDash136Dash5680Dash20 captures enum value "5g-136-5680-20" + InterfaceRfChannelValueNr5gDash136Dash5680Dash20 string = "5g-136-5680-20" + + // InterfaceRfChannelValueNr5gDash138Dash5690Dash80 captures enum value "5g-138-5690-80" + InterfaceRfChannelValueNr5gDash138Dash5690Dash80 string = "5g-138-5690-80" + + // InterfaceRfChannelValueNr5gDash140Dash5700Dash20 captures enum value "5g-140-5700-20" + InterfaceRfChannelValueNr5gDash140Dash5700Dash20 string = "5g-140-5700-20" + + // InterfaceRfChannelValueNr5gDash142Dash5710Dash40 captures enum value "5g-142-5710-40" + InterfaceRfChannelValueNr5gDash142Dash5710Dash40 string = "5g-142-5710-40" + + // InterfaceRfChannelValueNr5gDash144Dash5720Dash20 captures enum value "5g-144-5720-20" + InterfaceRfChannelValueNr5gDash144Dash5720Dash20 string = "5g-144-5720-20" + + // InterfaceRfChannelValueNr5gDash149Dash5745Dash20 captures enum value "5g-149-5745-20" + InterfaceRfChannelValueNr5gDash149Dash5745Dash20 string = "5g-149-5745-20" + + // InterfaceRfChannelValueNr5gDash151Dash5755Dash40 captures enum value "5g-151-5755-40" + InterfaceRfChannelValueNr5gDash151Dash5755Dash40 string = "5g-151-5755-40" + + // InterfaceRfChannelValueNr5gDash153Dash5765Dash20 captures enum value "5g-153-5765-20" + InterfaceRfChannelValueNr5gDash153Dash5765Dash20 string = "5g-153-5765-20" + + // InterfaceRfChannelValueNr5gDash155Dash5775Dash80 captures enum value "5g-155-5775-80" + InterfaceRfChannelValueNr5gDash155Dash5775Dash80 string = "5g-155-5775-80" + + // InterfaceRfChannelValueNr5gDash157Dash5785Dash20 captures enum value "5g-157-5785-20" + InterfaceRfChannelValueNr5gDash157Dash5785Dash20 string = "5g-157-5785-20" + + // InterfaceRfChannelValueNr5gDash159Dash5795Dash40 captures enum value "5g-159-5795-40" + InterfaceRfChannelValueNr5gDash159Dash5795Dash40 string = "5g-159-5795-40" + + // InterfaceRfChannelValueNr5gDash161Dash5805Dash20 captures enum value "5g-161-5805-20" + InterfaceRfChannelValueNr5gDash161Dash5805Dash20 string = "5g-161-5805-20" + + // InterfaceRfChannelValueNr5gDash163Dash5815Dash160 captures enum value "5g-163-5815-160" + InterfaceRfChannelValueNr5gDash163Dash5815Dash160 string = "5g-163-5815-160" + + // InterfaceRfChannelValueNr5gDash165Dash5825Dash20 captures enum value "5g-165-5825-20" + InterfaceRfChannelValueNr5gDash165Dash5825Dash20 string = "5g-165-5825-20" + + // InterfaceRfChannelValueNr5gDash167Dash5835Dash40 captures enum value "5g-167-5835-40" + InterfaceRfChannelValueNr5gDash167Dash5835Dash40 string = "5g-167-5835-40" + + // InterfaceRfChannelValueNr5gDash169Dash5845Dash20 captures enum value "5g-169-5845-20" + InterfaceRfChannelValueNr5gDash169Dash5845Dash20 string = "5g-169-5845-20" + + // InterfaceRfChannelValueNr5gDash171Dash5855Dash80 captures enum value "5g-171-5855-80" + InterfaceRfChannelValueNr5gDash171Dash5855Dash80 string = "5g-171-5855-80" + + // InterfaceRfChannelValueNr5gDash173Dash5865Dash20 captures enum value "5g-173-5865-20" + InterfaceRfChannelValueNr5gDash173Dash5865Dash20 string = "5g-173-5865-20" + + // InterfaceRfChannelValueNr5gDash175Dash5875Dash40 captures enum value "5g-175-5875-40" + InterfaceRfChannelValueNr5gDash175Dash5875Dash40 string = "5g-175-5875-40" + + // InterfaceRfChannelValueNr5gDash177Dash5885Dash20 captures enum value "5g-177-5885-20" + InterfaceRfChannelValueNr5gDash177Dash5885Dash20 string = "5g-177-5885-20" + + // InterfaceRfChannelValueNr6gDash1Dash5955Dash20 captures enum value "6g-1-5955-20" + InterfaceRfChannelValueNr6gDash1Dash5955Dash20 string = "6g-1-5955-20" + + // InterfaceRfChannelValueNr6gDash3Dash5965Dash40 captures enum value "6g-3-5965-40" + InterfaceRfChannelValueNr6gDash3Dash5965Dash40 string = "6g-3-5965-40" + + // InterfaceRfChannelValueNr6gDash5Dash5975Dash20 captures enum value "6g-5-5975-20" + InterfaceRfChannelValueNr6gDash5Dash5975Dash20 string = "6g-5-5975-20" + + // InterfaceRfChannelValueNr6gDash7Dash5985Dash80 captures enum value "6g-7-5985-80" + InterfaceRfChannelValueNr6gDash7Dash5985Dash80 string = "6g-7-5985-80" + + // InterfaceRfChannelValueNr6gDash9Dash5995Dash20 captures enum value "6g-9-5995-20" + InterfaceRfChannelValueNr6gDash9Dash5995Dash20 string = "6g-9-5995-20" + + // InterfaceRfChannelValueNr6gDash11Dash6005Dash40 captures enum value "6g-11-6005-40" + InterfaceRfChannelValueNr6gDash11Dash6005Dash40 string = "6g-11-6005-40" + + // InterfaceRfChannelValueNr6gDash13Dash6015Dash20 captures enum value "6g-13-6015-20" + InterfaceRfChannelValueNr6gDash13Dash6015Dash20 string = "6g-13-6015-20" + + // InterfaceRfChannelValueNr6gDash15Dash6025Dash160 captures enum value "6g-15-6025-160" + InterfaceRfChannelValueNr6gDash15Dash6025Dash160 string = "6g-15-6025-160" + + // InterfaceRfChannelValueNr6gDash17Dash6035Dash20 captures enum value "6g-17-6035-20" + InterfaceRfChannelValueNr6gDash17Dash6035Dash20 string = "6g-17-6035-20" + + // InterfaceRfChannelValueNr6gDash19Dash6045Dash40 captures enum value "6g-19-6045-40" + InterfaceRfChannelValueNr6gDash19Dash6045Dash40 string = "6g-19-6045-40" + + // InterfaceRfChannelValueNr6gDash21Dash6055Dash20 captures enum value "6g-21-6055-20" + InterfaceRfChannelValueNr6gDash21Dash6055Dash20 string = "6g-21-6055-20" + + // InterfaceRfChannelValueNr6gDash23Dash6065Dash80 captures enum value "6g-23-6065-80" + InterfaceRfChannelValueNr6gDash23Dash6065Dash80 string = "6g-23-6065-80" + + // InterfaceRfChannelValueNr6gDash25Dash6075Dash20 captures enum value "6g-25-6075-20" + InterfaceRfChannelValueNr6gDash25Dash6075Dash20 string = "6g-25-6075-20" + + // InterfaceRfChannelValueNr6gDash27Dash6085Dash40 captures enum value "6g-27-6085-40" + InterfaceRfChannelValueNr6gDash27Dash6085Dash40 string = "6g-27-6085-40" + + // InterfaceRfChannelValueNr6gDash29Dash6095Dash20 captures enum value "6g-29-6095-20" + InterfaceRfChannelValueNr6gDash29Dash6095Dash20 string = "6g-29-6095-20" + + // InterfaceRfChannelValueNr6gDash31Dash6105Dash320 captures enum value "6g-31-6105-320" + InterfaceRfChannelValueNr6gDash31Dash6105Dash320 string = "6g-31-6105-320" + + // InterfaceRfChannelValueNr6gDash33Dash6115Dash20 captures enum value "6g-33-6115-20" + InterfaceRfChannelValueNr6gDash33Dash6115Dash20 string = "6g-33-6115-20" + + // InterfaceRfChannelValueNr6gDash35Dash6125Dash40 captures enum value "6g-35-6125-40" + InterfaceRfChannelValueNr6gDash35Dash6125Dash40 string = "6g-35-6125-40" + + // InterfaceRfChannelValueNr6gDash37Dash6135Dash20 captures enum value "6g-37-6135-20" + InterfaceRfChannelValueNr6gDash37Dash6135Dash20 string = "6g-37-6135-20" + + // InterfaceRfChannelValueNr6gDash39Dash6145Dash80 captures enum value "6g-39-6145-80" + InterfaceRfChannelValueNr6gDash39Dash6145Dash80 string = "6g-39-6145-80" + + // InterfaceRfChannelValueNr6gDash41Dash6155Dash20 captures enum value "6g-41-6155-20" + InterfaceRfChannelValueNr6gDash41Dash6155Dash20 string = "6g-41-6155-20" + + // InterfaceRfChannelValueNr6gDash43Dash6165Dash40 captures enum value "6g-43-6165-40" + InterfaceRfChannelValueNr6gDash43Dash6165Dash40 string = "6g-43-6165-40" + + // InterfaceRfChannelValueNr6gDash45Dash6175Dash20 captures enum value "6g-45-6175-20" + InterfaceRfChannelValueNr6gDash45Dash6175Dash20 string = "6g-45-6175-20" + + // InterfaceRfChannelValueNr6gDash47Dash6185Dash160 captures enum value "6g-47-6185-160" + InterfaceRfChannelValueNr6gDash47Dash6185Dash160 string = "6g-47-6185-160" + + // InterfaceRfChannelValueNr6gDash49Dash6195Dash20 captures enum value "6g-49-6195-20" + InterfaceRfChannelValueNr6gDash49Dash6195Dash20 string = "6g-49-6195-20" + + // InterfaceRfChannelValueNr6gDash51Dash6205Dash40 captures enum value "6g-51-6205-40" + InterfaceRfChannelValueNr6gDash51Dash6205Dash40 string = "6g-51-6205-40" + + // InterfaceRfChannelValueNr6gDash53Dash6215Dash20 captures enum value "6g-53-6215-20" + InterfaceRfChannelValueNr6gDash53Dash6215Dash20 string = "6g-53-6215-20" + + // InterfaceRfChannelValueNr6gDash55Dash6225Dash80 captures enum value "6g-55-6225-80" + InterfaceRfChannelValueNr6gDash55Dash6225Dash80 string = "6g-55-6225-80" + + // InterfaceRfChannelValueNr6gDash57Dash6235Dash20 captures enum value "6g-57-6235-20" + InterfaceRfChannelValueNr6gDash57Dash6235Dash20 string = "6g-57-6235-20" + + // InterfaceRfChannelValueNr6gDash59Dash6245Dash40 captures enum value "6g-59-6245-40" + InterfaceRfChannelValueNr6gDash59Dash6245Dash40 string = "6g-59-6245-40" + + // InterfaceRfChannelValueNr6gDash61Dash6255Dash20 captures enum value "6g-61-6255-20" + InterfaceRfChannelValueNr6gDash61Dash6255Dash20 string = "6g-61-6255-20" + + // InterfaceRfChannelValueNr6gDash65Dash6275Dash20 captures enum value "6g-65-6275-20" + InterfaceRfChannelValueNr6gDash65Dash6275Dash20 string = "6g-65-6275-20" + + // InterfaceRfChannelValueNr6gDash67Dash6285Dash40 captures enum value "6g-67-6285-40" + InterfaceRfChannelValueNr6gDash67Dash6285Dash40 string = "6g-67-6285-40" + + // InterfaceRfChannelValueNr6gDash69Dash6295Dash20 captures enum value "6g-69-6295-20" + InterfaceRfChannelValueNr6gDash69Dash6295Dash20 string = "6g-69-6295-20" + + // InterfaceRfChannelValueNr6gDash71Dash6305Dash80 captures enum value "6g-71-6305-80" + InterfaceRfChannelValueNr6gDash71Dash6305Dash80 string = "6g-71-6305-80" + + // InterfaceRfChannelValueNr6gDash73Dash6315Dash20 captures enum value "6g-73-6315-20" + InterfaceRfChannelValueNr6gDash73Dash6315Dash20 string = "6g-73-6315-20" + + // InterfaceRfChannelValueNr6gDash75Dash6325Dash40 captures enum value "6g-75-6325-40" + InterfaceRfChannelValueNr6gDash75Dash6325Dash40 string = "6g-75-6325-40" + + // InterfaceRfChannelValueNr6gDash77Dash6335Dash20 captures enum value "6g-77-6335-20" + InterfaceRfChannelValueNr6gDash77Dash6335Dash20 string = "6g-77-6335-20" + + // InterfaceRfChannelValueNr6gDash79Dash6345Dash160 captures enum value "6g-79-6345-160" + InterfaceRfChannelValueNr6gDash79Dash6345Dash160 string = "6g-79-6345-160" + + // InterfaceRfChannelValueNr6gDash81Dash6355Dash20 captures enum value "6g-81-6355-20" + InterfaceRfChannelValueNr6gDash81Dash6355Dash20 string = "6g-81-6355-20" + + // InterfaceRfChannelValueNr6gDash83Dash6365Dash40 captures enum value "6g-83-6365-40" + InterfaceRfChannelValueNr6gDash83Dash6365Dash40 string = "6g-83-6365-40" + + // InterfaceRfChannelValueNr6gDash85Dash6375Dash20 captures enum value "6g-85-6375-20" + InterfaceRfChannelValueNr6gDash85Dash6375Dash20 string = "6g-85-6375-20" + + // InterfaceRfChannelValueNr6gDash87Dash6385Dash80 captures enum value "6g-87-6385-80" + InterfaceRfChannelValueNr6gDash87Dash6385Dash80 string = "6g-87-6385-80" + + // InterfaceRfChannelValueNr6gDash89Dash6395Dash20 captures enum value "6g-89-6395-20" + InterfaceRfChannelValueNr6gDash89Dash6395Dash20 string = "6g-89-6395-20" + + // InterfaceRfChannelValueNr6gDash91Dash6405Dash40 captures enum value "6g-91-6405-40" + InterfaceRfChannelValueNr6gDash91Dash6405Dash40 string = "6g-91-6405-40" + + // InterfaceRfChannelValueNr6gDash93Dash6415Dash20 captures enum value "6g-93-6415-20" + InterfaceRfChannelValueNr6gDash93Dash6415Dash20 string = "6g-93-6415-20" + + // InterfaceRfChannelValueNr6gDash95Dash6425Dash320 captures enum value "6g-95-6425-320" + InterfaceRfChannelValueNr6gDash95Dash6425Dash320 string = "6g-95-6425-320" + + // InterfaceRfChannelValueNr6gDash97Dash6435Dash20 captures enum value "6g-97-6435-20" + InterfaceRfChannelValueNr6gDash97Dash6435Dash20 string = "6g-97-6435-20" + + // InterfaceRfChannelValueNr6gDash99Dash6445Dash40 captures enum value "6g-99-6445-40" + InterfaceRfChannelValueNr6gDash99Dash6445Dash40 string = "6g-99-6445-40" + + // InterfaceRfChannelValueNr6gDash101Dash6455Dash20 captures enum value "6g-101-6455-20" + InterfaceRfChannelValueNr6gDash101Dash6455Dash20 string = "6g-101-6455-20" + + // InterfaceRfChannelValueNr6gDash103Dash6465Dash80 captures enum value "6g-103-6465-80" + InterfaceRfChannelValueNr6gDash103Dash6465Dash80 string = "6g-103-6465-80" + + // InterfaceRfChannelValueNr6gDash105Dash6475Dash20 captures enum value "6g-105-6475-20" + InterfaceRfChannelValueNr6gDash105Dash6475Dash20 string = "6g-105-6475-20" + + // InterfaceRfChannelValueNr6gDash107Dash6485Dash40 captures enum value "6g-107-6485-40" + InterfaceRfChannelValueNr6gDash107Dash6485Dash40 string = "6g-107-6485-40" + + // InterfaceRfChannelValueNr6gDash109Dash6495Dash20 captures enum value "6g-109-6495-20" + InterfaceRfChannelValueNr6gDash109Dash6495Dash20 string = "6g-109-6495-20" + + // InterfaceRfChannelValueNr6gDash111Dash6505Dash160 captures enum value "6g-111-6505-160" + InterfaceRfChannelValueNr6gDash111Dash6505Dash160 string = "6g-111-6505-160" + + // InterfaceRfChannelValueNr6gDash113Dash6515Dash20 captures enum value "6g-113-6515-20" + InterfaceRfChannelValueNr6gDash113Dash6515Dash20 string = "6g-113-6515-20" + + // InterfaceRfChannelValueNr6gDash115Dash6525Dash40 captures enum value "6g-115-6525-40" + InterfaceRfChannelValueNr6gDash115Dash6525Dash40 string = "6g-115-6525-40" + + // InterfaceRfChannelValueNr6gDash117Dash6535Dash20 captures enum value "6g-117-6535-20" + InterfaceRfChannelValueNr6gDash117Dash6535Dash20 string = "6g-117-6535-20" + + // InterfaceRfChannelValueNr6gDash119Dash6545Dash80 captures enum value "6g-119-6545-80" + InterfaceRfChannelValueNr6gDash119Dash6545Dash80 string = "6g-119-6545-80" + + // InterfaceRfChannelValueNr6gDash121Dash6555Dash20 captures enum value "6g-121-6555-20" + InterfaceRfChannelValueNr6gDash121Dash6555Dash20 string = "6g-121-6555-20" + + // InterfaceRfChannelValueNr6gDash123Dash6565Dash40 captures enum value "6g-123-6565-40" + InterfaceRfChannelValueNr6gDash123Dash6565Dash40 string = "6g-123-6565-40" + + // InterfaceRfChannelValueNr6gDash125Dash6575Dash20 captures enum value "6g-125-6575-20" + InterfaceRfChannelValueNr6gDash125Dash6575Dash20 string = "6g-125-6575-20" + + // InterfaceRfChannelValueNr6gDash129Dash6595Dash20 captures enum value "6g-129-6595-20" + InterfaceRfChannelValueNr6gDash129Dash6595Dash20 string = "6g-129-6595-20" + + // InterfaceRfChannelValueNr6gDash131Dash6605Dash40 captures enum value "6g-131-6605-40" + InterfaceRfChannelValueNr6gDash131Dash6605Dash40 string = "6g-131-6605-40" + + // InterfaceRfChannelValueNr6gDash133Dash6615Dash20 captures enum value "6g-133-6615-20" + InterfaceRfChannelValueNr6gDash133Dash6615Dash20 string = "6g-133-6615-20" + + // InterfaceRfChannelValueNr6gDash135Dash6625Dash80 captures enum value "6g-135-6625-80" + InterfaceRfChannelValueNr6gDash135Dash6625Dash80 string = "6g-135-6625-80" + + // InterfaceRfChannelValueNr6gDash137Dash6635Dash20 captures enum value "6g-137-6635-20" + InterfaceRfChannelValueNr6gDash137Dash6635Dash20 string = "6g-137-6635-20" + + // InterfaceRfChannelValueNr6gDash139Dash6645Dash40 captures enum value "6g-139-6645-40" + InterfaceRfChannelValueNr6gDash139Dash6645Dash40 string = "6g-139-6645-40" + + // InterfaceRfChannelValueNr6gDash141Dash6655Dash20 captures enum value "6g-141-6655-20" + InterfaceRfChannelValueNr6gDash141Dash6655Dash20 string = "6g-141-6655-20" + + // InterfaceRfChannelValueNr6gDash143Dash6665Dash160 captures enum value "6g-143-6665-160" + InterfaceRfChannelValueNr6gDash143Dash6665Dash160 string = "6g-143-6665-160" + + // InterfaceRfChannelValueNr6gDash145Dash6675Dash20 captures enum value "6g-145-6675-20" + InterfaceRfChannelValueNr6gDash145Dash6675Dash20 string = "6g-145-6675-20" + + // InterfaceRfChannelValueNr6gDash147Dash6685Dash40 captures enum value "6g-147-6685-40" + InterfaceRfChannelValueNr6gDash147Dash6685Dash40 string = "6g-147-6685-40" + + // InterfaceRfChannelValueNr6gDash149Dash6695Dash20 captures enum value "6g-149-6695-20" + InterfaceRfChannelValueNr6gDash149Dash6695Dash20 string = "6g-149-6695-20" + + // InterfaceRfChannelValueNr6gDash151Dash6705Dash80 captures enum value "6g-151-6705-80" + InterfaceRfChannelValueNr6gDash151Dash6705Dash80 string = "6g-151-6705-80" + + // InterfaceRfChannelValueNr6gDash153Dash6715Dash20 captures enum value "6g-153-6715-20" + InterfaceRfChannelValueNr6gDash153Dash6715Dash20 string = "6g-153-6715-20" + + // InterfaceRfChannelValueNr6gDash155Dash6725Dash40 captures enum value "6g-155-6725-40" + InterfaceRfChannelValueNr6gDash155Dash6725Dash40 string = "6g-155-6725-40" + + // InterfaceRfChannelValueNr6gDash157Dash6735Dash20 captures enum value "6g-157-6735-20" + InterfaceRfChannelValueNr6gDash157Dash6735Dash20 string = "6g-157-6735-20" + + // InterfaceRfChannelValueNr6gDash159Dash6745Dash320 captures enum value "6g-159-6745-320" + InterfaceRfChannelValueNr6gDash159Dash6745Dash320 string = "6g-159-6745-320" + + // InterfaceRfChannelValueNr6gDash161Dash6755Dash20 captures enum value "6g-161-6755-20" + InterfaceRfChannelValueNr6gDash161Dash6755Dash20 string = "6g-161-6755-20" + + // InterfaceRfChannelValueNr6gDash163Dash6765Dash40 captures enum value "6g-163-6765-40" + InterfaceRfChannelValueNr6gDash163Dash6765Dash40 string = "6g-163-6765-40" + + // InterfaceRfChannelValueNr6gDash165Dash6775Dash20 captures enum value "6g-165-6775-20" + InterfaceRfChannelValueNr6gDash165Dash6775Dash20 string = "6g-165-6775-20" + + // InterfaceRfChannelValueNr6gDash167Dash6785Dash80 captures enum value "6g-167-6785-80" + InterfaceRfChannelValueNr6gDash167Dash6785Dash80 string = "6g-167-6785-80" + + // InterfaceRfChannelValueNr6gDash169Dash6795Dash20 captures enum value "6g-169-6795-20" + InterfaceRfChannelValueNr6gDash169Dash6795Dash20 string = "6g-169-6795-20" + + // InterfaceRfChannelValueNr6gDash171Dash6805Dash40 captures enum value "6g-171-6805-40" + InterfaceRfChannelValueNr6gDash171Dash6805Dash40 string = "6g-171-6805-40" + + // InterfaceRfChannelValueNr6gDash173Dash6815Dash20 captures enum value "6g-173-6815-20" + InterfaceRfChannelValueNr6gDash173Dash6815Dash20 string = "6g-173-6815-20" + + // InterfaceRfChannelValueNr6gDash175Dash6825Dash160 captures enum value "6g-175-6825-160" + InterfaceRfChannelValueNr6gDash175Dash6825Dash160 string = "6g-175-6825-160" + + // InterfaceRfChannelValueNr6gDash177Dash6835Dash20 captures enum value "6g-177-6835-20" + InterfaceRfChannelValueNr6gDash177Dash6835Dash20 string = "6g-177-6835-20" + + // InterfaceRfChannelValueNr6gDash179Dash6845Dash40 captures enum value "6g-179-6845-40" + InterfaceRfChannelValueNr6gDash179Dash6845Dash40 string = "6g-179-6845-40" + + // InterfaceRfChannelValueNr6gDash181Dash6855Dash20 captures enum value "6g-181-6855-20" + InterfaceRfChannelValueNr6gDash181Dash6855Dash20 string = "6g-181-6855-20" + + // InterfaceRfChannelValueNr6gDash183Dash6865Dash80 captures enum value "6g-183-6865-80" + InterfaceRfChannelValueNr6gDash183Dash6865Dash80 string = "6g-183-6865-80" + + // InterfaceRfChannelValueNr6gDash185Dash6875Dash20 captures enum value "6g-185-6875-20" + InterfaceRfChannelValueNr6gDash185Dash6875Dash20 string = "6g-185-6875-20" + + // InterfaceRfChannelValueNr6gDash187Dash6885Dash40 captures enum value "6g-187-6885-40" + InterfaceRfChannelValueNr6gDash187Dash6885Dash40 string = "6g-187-6885-40" + + // InterfaceRfChannelValueNr6gDash189Dash6895Dash20 captures enum value "6g-189-6895-20" + InterfaceRfChannelValueNr6gDash189Dash6895Dash20 string = "6g-189-6895-20" + + // InterfaceRfChannelValueNr6gDash193Dash6915Dash20 captures enum value "6g-193-6915-20" + InterfaceRfChannelValueNr6gDash193Dash6915Dash20 string = "6g-193-6915-20" + + // InterfaceRfChannelValueNr6gDash195Dash6925Dash40 captures enum value "6g-195-6925-40" + InterfaceRfChannelValueNr6gDash195Dash6925Dash40 string = "6g-195-6925-40" + + // InterfaceRfChannelValueNr6gDash197Dash6935Dash20 captures enum value "6g-197-6935-20" + InterfaceRfChannelValueNr6gDash197Dash6935Dash20 string = "6g-197-6935-20" + + // InterfaceRfChannelValueNr6gDash199Dash6945Dash80 captures enum value "6g-199-6945-80" + InterfaceRfChannelValueNr6gDash199Dash6945Dash80 string = "6g-199-6945-80" + + // InterfaceRfChannelValueNr6gDash201Dash6955Dash20 captures enum value "6g-201-6955-20" + InterfaceRfChannelValueNr6gDash201Dash6955Dash20 string = "6g-201-6955-20" + + // InterfaceRfChannelValueNr6gDash203Dash6965Dash40 captures enum value "6g-203-6965-40" + InterfaceRfChannelValueNr6gDash203Dash6965Dash40 string = "6g-203-6965-40" + + // InterfaceRfChannelValueNr6gDash205Dash6975Dash20 captures enum value "6g-205-6975-20" + InterfaceRfChannelValueNr6gDash205Dash6975Dash20 string = "6g-205-6975-20" + + // InterfaceRfChannelValueNr6gDash207Dash6985Dash160 captures enum value "6g-207-6985-160" + InterfaceRfChannelValueNr6gDash207Dash6985Dash160 string = "6g-207-6985-160" + + // InterfaceRfChannelValueNr6gDash209Dash6995Dash20 captures enum value "6g-209-6995-20" + InterfaceRfChannelValueNr6gDash209Dash6995Dash20 string = "6g-209-6995-20" + + // InterfaceRfChannelValueNr6gDash211Dash7005Dash40 captures enum value "6g-211-7005-40" + InterfaceRfChannelValueNr6gDash211Dash7005Dash40 string = "6g-211-7005-40" + + // InterfaceRfChannelValueNr6gDash213Dash7015Dash20 captures enum value "6g-213-7015-20" + InterfaceRfChannelValueNr6gDash213Dash7015Dash20 string = "6g-213-7015-20" + + // InterfaceRfChannelValueNr6gDash215Dash7025Dash80 captures enum value "6g-215-7025-80" + InterfaceRfChannelValueNr6gDash215Dash7025Dash80 string = "6g-215-7025-80" + + // InterfaceRfChannelValueNr6gDash217Dash7035Dash20 captures enum value "6g-217-7035-20" + InterfaceRfChannelValueNr6gDash217Dash7035Dash20 string = "6g-217-7035-20" + + // InterfaceRfChannelValueNr6gDash219Dash7045Dash40 captures enum value "6g-219-7045-40" + InterfaceRfChannelValueNr6gDash219Dash7045Dash40 string = "6g-219-7045-40" + + // InterfaceRfChannelValueNr6gDash221Dash7055Dash20 captures enum value "6g-221-7055-20" + InterfaceRfChannelValueNr6gDash221Dash7055Dash20 string = "6g-221-7055-20" + + // InterfaceRfChannelValueNr6gDash225Dash7075Dash20 captures enum value "6g-225-7075-20" + InterfaceRfChannelValueNr6gDash225Dash7075Dash20 string = "6g-225-7075-20" + + // InterfaceRfChannelValueNr6gDash227Dash7085Dash40 captures enum value "6g-227-7085-40" + InterfaceRfChannelValueNr6gDash227Dash7085Dash40 string = "6g-227-7085-40" + + // InterfaceRfChannelValueNr6gDash229Dash7095Dash20 captures enum value "6g-229-7095-20" + InterfaceRfChannelValueNr6gDash229Dash7095Dash20 string = "6g-229-7095-20" + + // InterfaceRfChannelValueNr6gDash233Dash7115Dash20 captures enum value "6g-233-7115-20" + InterfaceRfChannelValueNr6gDash233Dash7115Dash20 string = "6g-233-7115-20" + + // InterfaceRfChannelValueNr60gDash1Dash58320Dash2160 captures enum value "60g-1-58320-2160" + InterfaceRfChannelValueNr60gDash1Dash58320Dash2160 string = "60g-1-58320-2160" + + // InterfaceRfChannelValueNr60gDash2Dash60480Dash2160 captures enum value "60g-2-60480-2160" + InterfaceRfChannelValueNr60gDash2Dash60480Dash2160 string = "60g-2-60480-2160" + + // InterfaceRfChannelValueNr60gDash3Dash62640Dash2160 captures enum value "60g-3-62640-2160" + InterfaceRfChannelValueNr60gDash3Dash62640Dash2160 string = "60g-3-62640-2160" + + // InterfaceRfChannelValueNr60gDash4Dash64800Dash2160 captures enum value "60g-4-64800-2160" + InterfaceRfChannelValueNr60gDash4Dash64800Dash2160 string = "60g-4-64800-2160" + + // InterfaceRfChannelValueNr60gDash5Dash66960Dash2160 captures enum value "60g-5-66960-2160" + InterfaceRfChannelValueNr60gDash5Dash66960Dash2160 string = "60g-5-66960-2160" + + // InterfaceRfChannelValueNr60gDash6Dash69120Dash2160 captures enum value "60g-6-69120-2160" + InterfaceRfChannelValueNr60gDash6Dash69120Dash2160 string = "60g-6-69120-2160" + + // InterfaceRfChannelValueNr60gDash9Dash59400Dash4320 captures enum value "60g-9-59400-4320" + InterfaceRfChannelValueNr60gDash9Dash59400Dash4320 string = "60g-9-59400-4320" + + // InterfaceRfChannelValueNr60gDash10Dash61560Dash4320 captures enum value "60g-10-61560-4320" + InterfaceRfChannelValueNr60gDash10Dash61560Dash4320 string = "60g-10-61560-4320" + + // InterfaceRfChannelValueNr60gDash11Dash63720Dash4320 captures enum value "60g-11-63720-4320" + InterfaceRfChannelValueNr60gDash11Dash63720Dash4320 string = "60g-11-63720-4320" + + // InterfaceRfChannelValueNr60gDash12Dash65880Dash4320 captures enum value "60g-12-65880-4320" + InterfaceRfChannelValueNr60gDash12Dash65880Dash4320 string = "60g-12-65880-4320" + + // InterfaceRfChannelValueNr60gDash13Dash68040Dash4320 captures enum value "60g-13-68040-4320" + InterfaceRfChannelValueNr60gDash13Dash68040Dash4320 string = "60g-13-68040-4320" + + // InterfaceRfChannelValueNr60gDash17Dash60480Dash6480 captures enum value "60g-17-60480-6480" + InterfaceRfChannelValueNr60gDash17Dash60480Dash6480 string = "60g-17-60480-6480" + + // InterfaceRfChannelValueNr60gDash18Dash62640Dash6480 captures enum value "60g-18-62640-6480" + InterfaceRfChannelValueNr60gDash18Dash62640Dash6480 string = "60g-18-62640-6480" + + // InterfaceRfChannelValueNr60gDash19Dash64800Dash6480 captures enum value "60g-19-64800-6480" + InterfaceRfChannelValueNr60gDash19Dash64800Dash6480 string = "60g-19-64800-6480" + + // InterfaceRfChannelValueNr60gDash20Dash66960Dash6480 captures enum value "60g-20-66960-6480" + InterfaceRfChannelValueNr60gDash20Dash66960Dash6480 string = "60g-20-66960-6480" + + // InterfaceRfChannelValueNr60gDash25Dash61560Dash6480 captures enum value "60g-25-61560-6480" + InterfaceRfChannelValueNr60gDash25Dash61560Dash6480 string = "60g-25-61560-6480" + + // InterfaceRfChannelValueNr60gDash26Dash63720Dash6480 captures enum value "60g-26-63720-6480" + InterfaceRfChannelValueNr60gDash26Dash63720Dash6480 string = "60g-26-63720-6480" + + // InterfaceRfChannelValueNr60gDash27Dash65880Dash6480 captures enum value "60g-27-65880-6480" + InterfaceRfChannelValueNr60gDash27Dash65880Dash6480 string = "60g-27-65880-6480" +) + +// prop value enum +func (m *InterfaceRfChannel) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, interfaceRfChannelTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InterfaceRfChannel) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("rf_channel"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("rf_channel"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this interface rf channel based on context it is used +func (m *InterfaceRfChannel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceRfChannel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceRfChannel) UnmarshalBinary(b []byte) error { + var res InterfaceRfChannel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// InterfaceRfRole Rf role +// +// swagger:model InterfaceRfRole +type InterfaceRfRole struct { + + // label + // Required: true + // Enum: [Access point Station] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [ap station] + Value *string `json:"value"` +} + +// Validate validates this interface rf role +func (m *InterfaceRfRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var interfaceRfRoleTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Access point","Station"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + interfaceRfRoleTypeLabelPropEnum = append(interfaceRfRoleTypeLabelPropEnum, v) + } +} + +const ( + + // InterfaceRfRoleLabelAccessPoint captures enum value "Access point" + InterfaceRfRoleLabelAccessPoint string = "Access point" + + // InterfaceRfRoleLabelStation captures enum value "Station" + InterfaceRfRoleLabelStation string = "Station" +) + +// prop value enum +func (m *InterfaceRfRole) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, interfaceRfRoleTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InterfaceRfRole) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("rf_role"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("rf_role"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var interfaceRfRoleTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ap","station"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + interfaceRfRoleTypeValuePropEnum = append(interfaceRfRoleTypeValuePropEnum, v) + } +} + +const ( + + // InterfaceRfRoleValueAp captures enum value "ap" + InterfaceRfRoleValueAp string = "ap" + + // InterfaceRfRoleValueStation captures enum value "station" + InterfaceRfRoleValueStation string = "station" +) + +// prop value enum +func (m *InterfaceRfRole) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, interfaceRfRoleTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InterfaceRfRole) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("rf_role"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("rf_role"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this interface rf role based on context it is used +func (m *InterfaceRfRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceRfRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceRfRole) UnmarshalBinary(b []byte) error { + var res InterfaceRfRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// InterfaceType Type +// +// swagger:model InterfaceType +type InterfaceType struct { + + // label + // Required: true + // Enum: [Virtual Bridge Link Aggregation Group (LAG) 100BASE-TX (10/100ME) 1000BASE-T (1GE) 2.5GBASE-T (2.5GE) 5GBASE-T (5GE) 10GBASE-T (10GE) 10GBASE-CX4 (10GE) GBIC (1GE) SFP (1GE) SFP+ (10GE) XFP (10GE) XENPAK (10GE) X2 (10GE) SFP28 (25GE) SFP56 (50GE) QSFP+ (40GE) QSFP28 (50GE) CFP (100GE) CFP2 (100GE) CFP2 (200GE) CFP4 (100GE) Cisco CPAK (100GE) QSFP28 (100GE) QSFP56 (200GE) QSFP-DD (400GE) OSFP (400GE) IEEE 802.11a IEEE 802.11b/g IEEE 802.11n IEEE 802.11ac IEEE 802.11ad IEEE 802.11ax IEEE 802.15.1 (Bluetooth) GSM CDMA LTE OC-3/STM-1 OC-12/STM-4 OC-48/STM-16 OC-192/STM-64 OC-768/STM-256 OC-1920/STM-640 OC-3840/STM-1234 SFP (1GFC) SFP (2GFC) SFP (4GFC) SFP+ (8GFC) SFP+ (16GFC) SFP28 (32GFC) QSFP+ (64GFC) QSFP28 (128GFC) SDR (2 Gbps) DDR (4 Gbps) QDR (8 Gbps) FDR10 (10 Gbps) FDR (13.5 Gbps) EDR (25 Gbps) HDR (50 Gbps) NDR (100 Gbps) XDR (250 Gbps) T1 (1.544 Mbps) E1 (2.048 Mbps) T3 (45 Mbps) E3 (34 Mbps) xDSL Cisco StackWise Cisco StackWise Plus Cisco FlexStack Cisco FlexStack Plus Cisco StackWise-80 Cisco StackWise-160 Cisco StackWise-320 Cisco StackWise-480 Juniper VCP Extreme SummitStack Extreme SummitStack-128 Extreme SummitStack-256 Extreme SummitStack-512 Other] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [virtual bridge lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-qsfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus cisco-stackwise-80 cisco-stackwise-160 cisco-stackwise-320 cisco-stackwise-480 juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] + Value *string `json:"value"` +} + +// Validate validates this interface type +func (m *InterfaceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var interfaceTypeTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Virtual","Bridge","Link Aggregation Group (LAG)","100BASE-TX (10/100ME)","1000BASE-T (1GE)","2.5GBASE-T (2.5GE)","5GBASE-T (5GE)","10GBASE-T (10GE)","10GBASE-CX4 (10GE)","GBIC (1GE)","SFP (1GE)","SFP+ (10GE)","XFP (10GE)","XENPAK (10GE)","X2 (10GE)","SFP28 (25GE)","SFP56 (50GE)","QSFP+ (40GE)","QSFP28 (50GE)","CFP (100GE)","CFP2 (100GE)","CFP2 (200GE)","CFP4 (100GE)","Cisco CPAK (100GE)","QSFP28 (100GE)","QSFP56 (200GE)","QSFP-DD (400GE)","OSFP (400GE)","IEEE 802.11a","IEEE 802.11b/g","IEEE 802.11n","IEEE 802.11ac","IEEE 802.11ad","IEEE 802.11ax","IEEE 802.15.1 (Bluetooth)","GSM","CDMA","LTE","OC-3/STM-1","OC-12/STM-4","OC-48/STM-16","OC-192/STM-64","OC-768/STM-256","OC-1920/STM-640","OC-3840/STM-1234","SFP (1GFC)","SFP (2GFC)","SFP (4GFC)","SFP+ (8GFC)","SFP+ (16GFC)","SFP28 (32GFC)","QSFP+ (64GFC)","QSFP28 (128GFC)","SDR (2 Gbps)","DDR (4 Gbps)","QDR (8 Gbps)","FDR10 (10 Gbps)","FDR (13.5 Gbps)","EDR (25 Gbps)","HDR (50 Gbps)","NDR (100 Gbps)","XDR (250 Gbps)","T1 (1.544 Mbps)","E1 (2.048 Mbps)","T3 (45 Mbps)","E3 (34 Mbps)","xDSL","Cisco StackWise","Cisco StackWise Plus","Cisco FlexStack","Cisco FlexStack Plus","Cisco StackWise-80","Cisco StackWise-160","Cisco StackWise-320","Cisco StackWise-480","Juniper VCP","Extreme SummitStack","Extreme SummitStack-128","Extreme SummitStack-256","Extreme SummitStack-512","Other"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + interfaceTypeTypeLabelPropEnum = append(interfaceTypeTypeLabelPropEnum, v) + } +} + +const ( + + // InterfaceTypeLabelVirtual captures enum value "Virtual" + InterfaceTypeLabelVirtual string = "Virtual" + + // InterfaceTypeLabelBridge captures enum value "Bridge" + InterfaceTypeLabelBridge string = "Bridge" + + // InterfaceTypeLabelLinkAggregationGroupLAG captures enum value "Link Aggregation Group (LAG)" + InterfaceTypeLabelLinkAggregationGroupLAG string = "Link Aggregation Group (LAG)" + + // InterfaceTypeLabelNr100BASEDashTX10100ME captures enum value "100BASE-TX (10/100ME)" + InterfaceTypeLabelNr100BASEDashTX10100ME string = "100BASE-TX (10/100ME)" + + // InterfaceTypeLabelNr1000BASEDashT1GE captures enum value "1000BASE-T (1GE)" + InterfaceTypeLabelNr1000BASEDashT1GE string = "1000BASE-T (1GE)" + + // InterfaceTypeLabelNr2Dot5GBASEDashT2Dot5GE captures enum value "2.5GBASE-T (2.5GE)" + InterfaceTypeLabelNr2Dot5GBASEDashT2Dot5GE string = "2.5GBASE-T (2.5GE)" // InterfaceTypeLabelNr5GBASEDashT5GE captures enum value "5GBASE-T (5GE)" InterfaceTypeLabelNr5GBASEDashT5GE string = "5GBASE-T (5GE)" @@ -1295,6 +3053,18 @@ const ( // InterfaceTypeLabelCiscoFlexStackPlus captures enum value "Cisco FlexStack Plus" InterfaceTypeLabelCiscoFlexStackPlus string = "Cisco FlexStack Plus" + // InterfaceTypeLabelCiscoStackWiseDash80 captures enum value "Cisco StackWise-80" + InterfaceTypeLabelCiscoStackWiseDash80 string = "Cisco StackWise-80" + + // InterfaceTypeLabelCiscoStackWiseDash160 captures enum value "Cisco StackWise-160" + InterfaceTypeLabelCiscoStackWiseDash160 string = "Cisco StackWise-160" + + // InterfaceTypeLabelCiscoStackWiseDash320 captures enum value "Cisco StackWise-320" + InterfaceTypeLabelCiscoStackWiseDash320 string = "Cisco StackWise-320" + + // InterfaceTypeLabelCiscoStackWiseDash480 captures enum value "Cisco StackWise-480" + InterfaceTypeLabelCiscoStackWiseDash480 string = "Cisco StackWise-480" + // InterfaceTypeLabelJuniperVCP captures enum value "Juniper VCP" InterfaceTypeLabelJuniperVCP string = "Juniper VCP" @@ -1340,7 +3110,7 @@ var interfaceTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["virtual","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-sfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["virtual","bridge","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-qsfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","cisco-stackwise-80","cisco-stackwise-160","cisco-stackwise-320","cisco-stackwise-480","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -1353,6 +3123,9 @@ const ( // InterfaceTypeValueVirtual captures enum value "virtual" InterfaceTypeValueVirtual string = "virtual" + // InterfaceTypeValueBridge captures enum value "bridge" + InterfaceTypeValueBridge string = "bridge" + // InterfaceTypeValueLag captures enum value "lag" InterfaceTypeValueLag string = "lag" @@ -1503,8 +3276,8 @@ const ( // InterfaceTypeValueNr64gfcDashQsfpp captures enum value "64gfc-qsfpp" InterfaceTypeValueNr64gfcDashQsfpp string = "64gfc-qsfpp" - // InterfaceTypeValueNr128gfcDashSfp28 captures enum value "128gfc-sfp28" - InterfaceTypeValueNr128gfcDashSfp28 string = "128gfc-sfp28" + // InterfaceTypeValueNr128gfcDashQsfp28 captures enum value "128gfc-qsfp28" + InterfaceTypeValueNr128gfcDashQsfp28 string = "128gfc-qsfp28" // InterfaceTypeValueInfinibandDashSdr captures enum value "infiniband-sdr" InterfaceTypeValueInfinibandDashSdr string = "infiniband-sdr" @@ -1560,6 +3333,18 @@ const ( // InterfaceTypeValueCiscoDashFlexstackDashPlus captures enum value "cisco-flexstack-plus" InterfaceTypeValueCiscoDashFlexstackDashPlus string = "cisco-flexstack-plus" + // InterfaceTypeValueCiscoDashStackwiseDash80 captures enum value "cisco-stackwise-80" + InterfaceTypeValueCiscoDashStackwiseDash80 string = "cisco-stackwise-80" + + // InterfaceTypeValueCiscoDashStackwiseDash160 captures enum value "cisco-stackwise-160" + InterfaceTypeValueCiscoDashStackwiseDash160 string = "cisco-stackwise-160" + + // InterfaceTypeValueCiscoDashStackwiseDash320 captures enum value "cisco-stackwise-320" + InterfaceTypeValueCiscoDashStackwiseDash320 string = "cisco-stackwise-320" + + // InterfaceTypeValueCiscoDashStackwiseDash480 captures enum value "cisco-stackwise-480" + InterfaceTypeValueCiscoDashStackwiseDash480 string = "cisco-stackwise-480" + // InterfaceTypeValueJuniperDashVcp captures enum value "juniper-vcp" InterfaceTypeValueJuniperDashVcp string = "juniper-vcp" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/interface_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/interface_template.go index 17e7b98c0..deb624631 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/interface_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/interface_template.go @@ -385,12 +385,12 @@ type InterfaceTemplateType struct { // label // Required: true - // Enum: [Virtual Link Aggregation Group (LAG) 100BASE-TX (10/100ME) 1000BASE-T (1GE) 2.5GBASE-T (2.5GE) 5GBASE-T (5GE) 10GBASE-T (10GE) 10GBASE-CX4 (10GE) GBIC (1GE) SFP (1GE) SFP+ (10GE) XFP (10GE) XENPAK (10GE) X2 (10GE) SFP28 (25GE) SFP56 (50GE) QSFP+ (40GE) QSFP28 (50GE) CFP (100GE) CFP2 (100GE) CFP2 (200GE) CFP4 (100GE) Cisco CPAK (100GE) QSFP28 (100GE) QSFP56 (200GE) QSFP-DD (400GE) OSFP (400GE) IEEE 802.11a IEEE 802.11b/g IEEE 802.11n IEEE 802.11ac IEEE 802.11ad IEEE 802.11ax IEEE 802.15.1 (Bluetooth) GSM CDMA LTE OC-3/STM-1 OC-12/STM-4 OC-48/STM-16 OC-192/STM-64 OC-768/STM-256 OC-1920/STM-640 OC-3840/STM-1234 SFP (1GFC) SFP (2GFC) SFP (4GFC) SFP+ (8GFC) SFP+ (16GFC) SFP28 (32GFC) QSFP+ (64GFC) QSFP28 (128GFC) SDR (2 Gbps) DDR (4 Gbps) QDR (8 Gbps) FDR10 (10 Gbps) FDR (13.5 Gbps) EDR (25 Gbps) HDR (50 Gbps) NDR (100 Gbps) XDR (250 Gbps) T1 (1.544 Mbps) E1 (2.048 Mbps) T3 (45 Mbps) E3 (34 Mbps) xDSL Cisco StackWise Cisco StackWise Plus Cisco FlexStack Cisco FlexStack Plus Juniper VCP Extreme SummitStack Extreme SummitStack-128 Extreme SummitStack-256 Extreme SummitStack-512 Other] + // Enum: [Virtual Bridge Link Aggregation Group (LAG) 100BASE-TX (10/100ME) 1000BASE-T (1GE) 2.5GBASE-T (2.5GE) 5GBASE-T (5GE) 10GBASE-T (10GE) 10GBASE-CX4 (10GE) GBIC (1GE) SFP (1GE) SFP+ (10GE) XFP (10GE) XENPAK (10GE) X2 (10GE) SFP28 (25GE) SFP56 (50GE) QSFP+ (40GE) QSFP28 (50GE) CFP (100GE) CFP2 (100GE) CFP2 (200GE) CFP4 (100GE) Cisco CPAK (100GE) QSFP28 (100GE) QSFP56 (200GE) QSFP-DD (400GE) OSFP (400GE) IEEE 802.11a IEEE 802.11b/g IEEE 802.11n IEEE 802.11ac IEEE 802.11ad IEEE 802.11ax IEEE 802.15.1 (Bluetooth) GSM CDMA LTE OC-3/STM-1 OC-12/STM-4 OC-48/STM-16 OC-192/STM-64 OC-768/STM-256 OC-1920/STM-640 OC-3840/STM-1234 SFP (1GFC) SFP (2GFC) SFP (4GFC) SFP+ (8GFC) SFP+ (16GFC) SFP28 (32GFC) QSFP+ (64GFC) QSFP28 (128GFC) SDR (2 Gbps) DDR (4 Gbps) QDR (8 Gbps) FDR10 (10 Gbps) FDR (13.5 Gbps) EDR (25 Gbps) HDR (50 Gbps) NDR (100 Gbps) XDR (250 Gbps) T1 (1.544 Mbps) E1 (2.048 Mbps) T3 (45 Mbps) E3 (34 Mbps) xDSL Cisco StackWise Cisco StackWise Plus Cisco FlexStack Cisco FlexStack Plus Cisco StackWise-80 Cisco StackWise-160 Cisco StackWise-320 Cisco StackWise-480 Juniper VCP Extreme SummitStack Extreme SummitStack-128 Extreme SummitStack-256 Extreme SummitStack-512 Other] Label *string `json:"label"` // value // Required: true - // Enum: [virtual lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-sfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] + // Enum: [virtual bridge lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-qsfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus cisco-stackwise-80 cisco-stackwise-160 cisco-stackwise-320 cisco-stackwise-480 juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] Value *string `json:"value"` } @@ -416,7 +416,7 @@ var interfaceTemplateTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["Virtual","Link Aggregation Group (LAG)","100BASE-TX (10/100ME)","1000BASE-T (1GE)","2.5GBASE-T (2.5GE)","5GBASE-T (5GE)","10GBASE-T (10GE)","10GBASE-CX4 (10GE)","GBIC (1GE)","SFP (1GE)","SFP+ (10GE)","XFP (10GE)","XENPAK (10GE)","X2 (10GE)","SFP28 (25GE)","SFP56 (50GE)","QSFP+ (40GE)","QSFP28 (50GE)","CFP (100GE)","CFP2 (100GE)","CFP2 (200GE)","CFP4 (100GE)","Cisco CPAK (100GE)","QSFP28 (100GE)","QSFP56 (200GE)","QSFP-DD (400GE)","OSFP (400GE)","IEEE 802.11a","IEEE 802.11b/g","IEEE 802.11n","IEEE 802.11ac","IEEE 802.11ad","IEEE 802.11ax","IEEE 802.15.1 (Bluetooth)","GSM","CDMA","LTE","OC-3/STM-1","OC-12/STM-4","OC-48/STM-16","OC-192/STM-64","OC-768/STM-256","OC-1920/STM-640","OC-3840/STM-1234","SFP (1GFC)","SFP (2GFC)","SFP (4GFC)","SFP+ (8GFC)","SFP+ (16GFC)","SFP28 (32GFC)","QSFP+ (64GFC)","QSFP28 (128GFC)","SDR (2 Gbps)","DDR (4 Gbps)","QDR (8 Gbps)","FDR10 (10 Gbps)","FDR (13.5 Gbps)","EDR (25 Gbps)","HDR (50 Gbps)","NDR (100 Gbps)","XDR (250 Gbps)","T1 (1.544 Mbps)","E1 (2.048 Mbps)","T3 (45 Mbps)","E3 (34 Mbps)","xDSL","Cisco StackWise","Cisco StackWise Plus","Cisco FlexStack","Cisco FlexStack Plus","Juniper VCP","Extreme SummitStack","Extreme SummitStack-128","Extreme SummitStack-256","Extreme SummitStack-512","Other"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Virtual","Bridge","Link Aggregation Group (LAG)","100BASE-TX (10/100ME)","1000BASE-T (1GE)","2.5GBASE-T (2.5GE)","5GBASE-T (5GE)","10GBASE-T (10GE)","10GBASE-CX4 (10GE)","GBIC (1GE)","SFP (1GE)","SFP+ (10GE)","XFP (10GE)","XENPAK (10GE)","X2 (10GE)","SFP28 (25GE)","SFP56 (50GE)","QSFP+ (40GE)","QSFP28 (50GE)","CFP (100GE)","CFP2 (100GE)","CFP2 (200GE)","CFP4 (100GE)","Cisco CPAK (100GE)","QSFP28 (100GE)","QSFP56 (200GE)","QSFP-DD (400GE)","OSFP (400GE)","IEEE 802.11a","IEEE 802.11b/g","IEEE 802.11n","IEEE 802.11ac","IEEE 802.11ad","IEEE 802.11ax","IEEE 802.15.1 (Bluetooth)","GSM","CDMA","LTE","OC-3/STM-1","OC-12/STM-4","OC-48/STM-16","OC-192/STM-64","OC-768/STM-256","OC-1920/STM-640","OC-3840/STM-1234","SFP (1GFC)","SFP (2GFC)","SFP (4GFC)","SFP+ (8GFC)","SFP+ (16GFC)","SFP28 (32GFC)","QSFP+ (64GFC)","QSFP28 (128GFC)","SDR (2 Gbps)","DDR (4 Gbps)","QDR (8 Gbps)","FDR10 (10 Gbps)","FDR (13.5 Gbps)","EDR (25 Gbps)","HDR (50 Gbps)","NDR (100 Gbps)","XDR (250 Gbps)","T1 (1.544 Mbps)","E1 (2.048 Mbps)","T3 (45 Mbps)","E3 (34 Mbps)","xDSL","Cisco StackWise","Cisco StackWise Plus","Cisco FlexStack","Cisco FlexStack Plus","Cisco StackWise-80","Cisco StackWise-160","Cisco StackWise-320","Cisco StackWise-480","Juniper VCP","Extreme SummitStack","Extreme SummitStack-128","Extreme SummitStack-256","Extreme SummitStack-512","Other"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -429,6 +429,9 @@ const ( // InterfaceTemplateTypeLabelVirtual captures enum value "Virtual" InterfaceTemplateTypeLabelVirtual string = "Virtual" + // InterfaceTemplateTypeLabelBridge captures enum value "Bridge" + InterfaceTemplateTypeLabelBridge string = "Bridge" + // InterfaceTemplateTypeLabelLinkAggregationGroupLAG captures enum value "Link Aggregation Group (LAG)" InterfaceTemplateTypeLabelLinkAggregationGroupLAG string = "Link Aggregation Group (LAG)" @@ -636,6 +639,18 @@ const ( // InterfaceTemplateTypeLabelCiscoFlexStackPlus captures enum value "Cisco FlexStack Plus" InterfaceTemplateTypeLabelCiscoFlexStackPlus string = "Cisco FlexStack Plus" + // InterfaceTemplateTypeLabelCiscoStackWiseDash80 captures enum value "Cisco StackWise-80" + InterfaceTemplateTypeLabelCiscoStackWiseDash80 string = "Cisco StackWise-80" + + // InterfaceTemplateTypeLabelCiscoStackWiseDash160 captures enum value "Cisco StackWise-160" + InterfaceTemplateTypeLabelCiscoStackWiseDash160 string = "Cisco StackWise-160" + + // InterfaceTemplateTypeLabelCiscoStackWiseDash320 captures enum value "Cisco StackWise-320" + InterfaceTemplateTypeLabelCiscoStackWiseDash320 string = "Cisco StackWise-320" + + // InterfaceTemplateTypeLabelCiscoStackWiseDash480 captures enum value "Cisco StackWise-480" + InterfaceTemplateTypeLabelCiscoStackWiseDash480 string = "Cisco StackWise-480" + // InterfaceTemplateTypeLabelJuniperVCP captures enum value "Juniper VCP" InterfaceTemplateTypeLabelJuniperVCP string = "Juniper VCP" @@ -681,7 +696,7 @@ var interfaceTemplateTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["virtual","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-sfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["virtual","bridge","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-qsfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","cisco-stackwise-80","cisco-stackwise-160","cisco-stackwise-320","cisco-stackwise-480","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -694,6 +709,9 @@ const ( // InterfaceTemplateTypeValueVirtual captures enum value "virtual" InterfaceTemplateTypeValueVirtual string = "virtual" + // InterfaceTemplateTypeValueBridge captures enum value "bridge" + InterfaceTemplateTypeValueBridge string = "bridge" + // InterfaceTemplateTypeValueLag captures enum value "lag" InterfaceTemplateTypeValueLag string = "lag" @@ -844,8 +862,8 @@ const ( // InterfaceTemplateTypeValueNr64gfcDashQsfpp captures enum value "64gfc-qsfpp" InterfaceTemplateTypeValueNr64gfcDashQsfpp string = "64gfc-qsfpp" - // InterfaceTemplateTypeValueNr128gfcDashSfp28 captures enum value "128gfc-sfp28" - InterfaceTemplateTypeValueNr128gfcDashSfp28 string = "128gfc-sfp28" + // InterfaceTemplateTypeValueNr128gfcDashQsfp28 captures enum value "128gfc-qsfp28" + InterfaceTemplateTypeValueNr128gfcDashQsfp28 string = "128gfc-qsfp28" // InterfaceTemplateTypeValueInfinibandDashSdr captures enum value "infiniband-sdr" InterfaceTemplateTypeValueInfinibandDashSdr string = "infiniband-sdr" @@ -901,6 +919,18 @@ const ( // InterfaceTemplateTypeValueCiscoDashFlexstackDashPlus captures enum value "cisco-flexstack-plus" InterfaceTemplateTypeValueCiscoDashFlexstackDashPlus string = "cisco-flexstack-plus" + // InterfaceTemplateTypeValueCiscoDashStackwiseDash80 captures enum value "cisco-stackwise-80" + InterfaceTemplateTypeValueCiscoDashStackwiseDash80 string = "cisco-stackwise-80" + + // InterfaceTemplateTypeValueCiscoDashStackwiseDash160 captures enum value "cisco-stackwise-160" + InterfaceTemplateTypeValueCiscoDashStackwiseDash160 string = "cisco-stackwise-160" + + // InterfaceTemplateTypeValueCiscoDashStackwiseDash320 captures enum value "cisco-stackwise-320" + InterfaceTemplateTypeValueCiscoDashStackwiseDash320 string = "cisco-stackwise-320" + + // InterfaceTemplateTypeValueCiscoDashStackwiseDash480 captures enum value "cisco-stackwise-480" + InterfaceTemplateTypeValueCiscoDashStackwiseDash480 string = "cisco-stackwise-480" + // InterfaceTemplateTypeValueJuniperDashVcp captures enum value "juniper-vcp" InterfaceTemplateTypeValueJuniperDashVcp string = "juniper-vcp" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/ip_address.go b/vendor/github.com/smutel/go-netbox/netbox/models/ip_address.go index 2a7ca96e1..33631934d 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/ip_address.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/ip_address.go @@ -74,7 +74,7 @@ type IPAddress struct { // // Hostname or FQDN (not case-sensitive) // Max Length: 255 - // Pattern: ^[0-9A-Za-z._-]+$ + // Pattern: ^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$ DNSName string `json:"dns_name,omitempty"` // family @@ -244,7 +244,7 @@ func (m *IPAddress) validateDNSName(formats strfmt.Registry) error { return err } - if err := validate.Pattern("dns_name", "body", m.DNSName, `^[0-9A-Za-z._-]+$`); err != nil { + if err := validate.Pattern("dns_name", "body", m.DNSName, `^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$`); err != nil { return err } diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/location.go b/vendor/github.com/smutel/go-netbox/netbox/models/location.go index 0fc968485..6495ad2f9 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/location.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/location.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -91,6 +92,12 @@ type Location struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + + // tenant + Tenant *NestedTenant `json:"tenant,omitempty"` + // Url // Read Only: true // Format: uri @@ -129,6 +136,14 @@ func (m *Location) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -252,6 +267,51 @@ func (m *Location) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Location) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Location) validateTenant(formats strfmt.Registry) error { + if swag.IsZero(m.Tenant) { // not required + return nil + } + + if m.Tenant != nil { + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenant") + } + return err + } + } + + return nil +} + func (m *Location) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -304,6 +364,14 @@ func (m *Location) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTenant(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -409,6 +477,42 @@ func (m *Location) contextValidateSite(ctx context.Context, formats strfmt.Regis return nil } +func (m *Location) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Location) contextValidateTenant(ctx context.Context, formats strfmt.Registry) error { + + if m.Tenant != nil { + if err := m.Tenant.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tenant") + } + return err + } + } + + return nil +} + func (m *Location) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/manufacturer.go b/vendor/github.com/smutel/go-netbox/netbox/models/manufacturer.go index d516bc6c3..37c818f59 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/manufacturer.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/manufacturer.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -84,6 +85,9 @@ type Manufacturer struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -114,6 +118,10 @@ func (m *Manufacturer) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -198,6 +206,32 @@ func (m *Manufacturer) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Manufacturer) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Manufacturer) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -242,6 +276,10 @@ func (m *Manufacturer) ContextValidate(ctx context.Context, formats strfmt.Regis res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -315,6 +353,26 @@ func (m *Manufacturer) contextValidatePlatformCount(ctx context.Context, formats return nil } +func (m *Manufacturer) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Manufacturer) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_a_s_n.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_a_s_n.go new file mode 100644 index 000000000..7900493bf --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_a_s_n.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedASN nested a s n +// +// swagger:model NestedASN +type NestedASN struct { + + // ASN + // + // 32-bit autonomous system number + // Required: true + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn *int64 `json:"asn"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested a s n +func (m *NestedASN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAsn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedASN) validateAsn(formats strfmt.Registry) error { + + if err := validate.Required("asn", "body", m.Asn); err != nil { + return err + } + + if err := validate.MinimumInt("asn", "body", *m.Asn, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", *m.Asn, 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *NestedASN) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested a s n based on the context it is used +func (m *NestedASN) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedASN) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedASN) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedASN) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedASN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedASN) UnmarshalBinary(b []byte) error { + var res NestedASN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact.go new file mode 100644 index 000000000..1f6e483a3 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedContact nested contact +// +// swagger:model NestedContact +type NestedContact struct { + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested contact +func (m *NestedContact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContact) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *NestedContact) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested contact based on the context it is used +func (m *NestedContact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContact) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedContact) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedContact) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedContact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedContact) UnmarshalBinary(b []byte) error { + var res NestedContact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_group.go new file mode 100644 index 000000000..de754c810 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_group.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedContactGroup nested contact group +// +// swagger:model NestedContactGroup +type NestedContactGroup struct { + + // depth + // Read Only: true + Depth int64 `json:"_depth,omitempty"` + + // Contact count + // Read Only: true + ContactCount int64 `json:"contact_count,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested contact group +func (m *NestedContactGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContactGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *NestedContactGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *NestedContactGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested contact group based on the context it is used +func (m *NestedContactGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContactCount(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContactGroup) contextValidateDepth(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "_depth", "body", int64(m.Depth)); err != nil { + return err + } + + return nil +} + +func (m *NestedContactGroup) contextValidateContactCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contact_count", "body", int64(m.ContactCount)); err != nil { + return err + } + + return nil +} + +func (m *NestedContactGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedContactGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedContactGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedContactGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedContactGroup) UnmarshalBinary(b []byte) error { + var res NestedContactGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_role.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_role.go new file mode 100644 index 000000000..35ce13a59 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_contact_role.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedContactRole nested contact role +// +// swagger:model NestedContactRole +type NestedContactRole struct { + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested contact role +func (m *NestedContactRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContactRole) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *NestedContactRole) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *NestedContactRole) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested contact role based on the context it is used +func (m *NestedContactRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedContactRole) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedContactRole) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedContactRole) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedContactRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedContactRole) UnmarshalBinary(b []byte) error { + var res NestedContactRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_f_h_r_p_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_f_h_r_p_group.go new file mode 100644 index 000000000..16cbd6bf5 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_f_h_r_p_group.go @@ -0,0 +1,237 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedFHRPGroup nested f h r p group +// +// swagger:model NestedFHRPGroup +type NestedFHRPGroup struct { + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Group ID + // Required: true + // Maximum: 32767 + // Minimum: 0 + GroupID *int64 `json:"group_id"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Protocol + // Required: true + // Enum: [vrrp2 vrrp3 carp clusterxl hsrp glbp other] + Protocol *string `json:"protocol"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested f h r p group +func (m *NestedFHRPGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGroupID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProtocol(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedFHRPGroup) validateGroupID(formats strfmt.Registry) error { + + if err := validate.Required("group_id", "body", m.GroupID); err != nil { + return err + } + + if err := validate.MinimumInt("group_id", "body", *m.GroupID, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("group_id", "body", *m.GroupID, 32767, false); err != nil { + return err + } + + return nil +} + +var nestedFHRPGroupTypeProtocolPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["vrrp2","vrrp3","carp","clusterxl","hsrp","glbp","other"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nestedFHRPGroupTypeProtocolPropEnum = append(nestedFHRPGroupTypeProtocolPropEnum, v) + } +} + +const ( + + // NestedFHRPGroupProtocolVrrp2 captures enum value "vrrp2" + NestedFHRPGroupProtocolVrrp2 string = "vrrp2" + + // NestedFHRPGroupProtocolVrrp3 captures enum value "vrrp3" + NestedFHRPGroupProtocolVrrp3 string = "vrrp3" + + // NestedFHRPGroupProtocolCarp captures enum value "carp" + NestedFHRPGroupProtocolCarp string = "carp" + + // NestedFHRPGroupProtocolClusterxl captures enum value "clusterxl" + NestedFHRPGroupProtocolClusterxl string = "clusterxl" + + // NestedFHRPGroupProtocolHsrp captures enum value "hsrp" + NestedFHRPGroupProtocolHsrp string = "hsrp" + + // NestedFHRPGroupProtocolGlbp captures enum value "glbp" + NestedFHRPGroupProtocolGlbp string = "glbp" + + // NestedFHRPGroupProtocolOther captures enum value "other" + NestedFHRPGroupProtocolOther string = "other" +) + +// prop value enum +func (m *NestedFHRPGroup) validateProtocolEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, nestedFHRPGroupTypeProtocolPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NestedFHRPGroup) validateProtocol(formats strfmt.Registry) error { + + if err := validate.Required("protocol", "body", m.Protocol); err != nil { + return err + } + + // value enum + if err := m.validateProtocolEnum("protocol", "body", *m.Protocol); err != nil { + return err + } + + return nil +} + +func (m *NestedFHRPGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested f h r p group based on the context it is used +func (m *NestedFHRPGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedFHRPGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedFHRPGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedFHRPGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedFHRPGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedFHRPGroup) UnmarshalBinary(b []byte) error { + var res NestedFHRPGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n.go new file mode 100644 index 000000000..59117f7f8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedWirelessLAN nested wireless l a n +// +// swagger:model NestedWirelessLAN +type NestedWirelessLAN struct { + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // SSID + // Required: true + // Max Length: 32 + // Min Length: 1 + Ssid *string `json:"ssid"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested wireless l a n +func (m *NestedWirelessLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSsid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedWirelessLAN) validateSsid(formats strfmt.Registry) error { + + if err := validate.Required("ssid", "body", m.Ssid); err != nil { + return err + } + + if err := validate.MinLength("ssid", "body", *m.Ssid, 1); err != nil { + return err + } + + if err := validate.MaxLength("ssid", "body", *m.Ssid, 32); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLAN) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested wireless l a n based on the context it is used +func (m *NestedWirelessLAN) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedWirelessLAN) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLAN) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLAN) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedWirelessLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedWirelessLAN) UnmarshalBinary(b []byte) error { + var res NestedWirelessLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n_group.go new file mode 100644 index 000000000..684e88110 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_l_a_n_group.go @@ -0,0 +1,235 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedWirelessLANGroup nested wireless l a n group +// +// swagger:model NestedWirelessLANGroup +type NestedWirelessLANGroup struct { + + // depth + // Read Only: true + Depth int64 `json:"_depth,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` + + // Wirelesslan count + // Read Only: true + WirelesslanCount int64 `json:"wirelesslan_count,omitempty"` +} + +// Validate validates this nested wireless l a n group +func (m *NestedWirelessLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedWirelessLANGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLANGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLANGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested wireless l a n group based on the context it is used +func (m *NestedWirelessLANGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWirelesslanCount(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedWirelessLANGroup) contextValidateDepth(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "_depth", "body", int64(m.Depth)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLANGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLANGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLANGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLANGroup) contextValidateWirelesslanCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "wirelesslan_count", "body", int64(m.WirelesslanCount)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedWirelessLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedWirelessLANGroup) UnmarshalBinary(b []byte) error { + var res NestedWirelessLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_link.go b/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_link.go new file mode 100644 index 000000000..e5ca305b8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/nested_wireless_link.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedWirelessLink nested wireless link +// +// swagger:model NestedWirelessLink +type NestedWirelessLink struct { + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // SSID + // Max Length: 32 + Ssid string `json:"ssid,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested wireless link +func (m *NestedWirelessLink) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSsid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedWirelessLink) validateSsid(formats strfmt.Registry) error { + if swag.IsZero(m.Ssid) { // not required + return nil + } + + if err := validate.MaxLength("ssid", "body", m.Ssid, 32); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLink) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this nested wireless link based on the context it is used +func (m *NestedWirelessLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedWirelessLink) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLink) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *NestedWirelessLink) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedWirelessLink) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedWirelessLink) UnmarshalBinary(b []byte) error { + var res NestedWirelessLink + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/platform.go b/vendor/github.com/smutel/go-netbox/netbox/models/platform.go index 4b2960b93..cf023c3a7 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/platform.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/platform.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -90,6 +91,9 @@ type Platform struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -132,6 +136,10 @@ func (m *Platform) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -247,6 +255,32 @@ func (m *Platform) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Platform) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Platform) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -287,6 +321,10 @@ func (m *Platform) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -362,6 +400,26 @@ func (m *Platform) contextValidateManufacturer(ctx context.Context, formats strf return nil } +func (m *Platform) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Platform) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/power_feed.go b/vendor/github.com/smutel/go-netbox/netbox/models/power_feed.go index 637eae906..bc693a102 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/power_feed.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/power_feed.go @@ -48,18 +48,6 @@ type PowerFeed struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Comments Comments string `json:"comments,omitempty"` @@ -100,6 +88,18 @@ type PowerFeed struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -494,14 +494,6 @@ func (m *PowerFeed) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -530,6 +522,14 @@ func (m *PowerFeed) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidatePhase(ctx, formats); err != nil { res = append(res, err) } @@ -593,20 +593,6 @@ func (m *PowerFeed) contextValidateCable(ctx context.Context, formats strfmt.Reg return nil } -func (m *PowerFeed) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *PowerFeed) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *PowerFeed) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -666,6 +652,20 @@ func (m *PowerFeed) contextValidateLastUpdated(ctx context.Context, formats strf return nil } +func (m *PowerFeed) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PowerFeed) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *PowerFeed) contextValidatePhase(ctx context.Context, formats strfmt.Registry) error { if m.Phase != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet.go b/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet.go index f1128cefc..16f002111 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet.go @@ -43,18 +43,6 @@ type PowerOutlet struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -109,6 +97,18 @@ type PowerOutlet struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -404,14 +404,6 @@ func (m *PowerOutlet) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -448,6 +440,14 @@ func (m *PowerOutlet) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidatePowerPort(ctx, formats); err != nil { res = append(res, err) } @@ -495,20 +495,6 @@ func (m *PowerOutlet) contextValidateCable(ctx context.Context, formats strfmt.R return nil } -func (m *PowerOutlet) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *PowerOutlet) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *PowerOutlet) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -600,6 +586,20 @@ func (m *PowerOutlet) contextValidateLastUpdated(ctx context.Context, formats st return nil } +func (m *PowerOutlet) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PowerOutlet) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *PowerOutlet) contextValidatePowerPort(ctx context.Context, formats strfmt.Registry) error { if m.PowerPort != nil { @@ -835,12 +835,12 @@ type PowerOutletType struct { // label // Required: true - // Enum: [C5 C7 C13 C15 C19 C21 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15R NEMA 5-15R NEMA 5-20R NEMA 5-30R NEMA 5-50R NEMA 6-15R NEMA 6-20R NEMA 6-30R NEMA 6-50R NEMA 10-30R NEMA 10-50R NEMA 14-20R NEMA 14-30R NEMA 14-50R NEMA 14-60R NEMA 15-15R NEMA 15-20R NEMA 15-30R NEMA 15-50R NEMA 15-60R NEMA L1-15R NEMA L5-15R NEMA L5-20R NEMA L5-30R NEMA L5-50R NEMA L6-15R NEMA L6-20R NEMA L6-30R NEMA L6-50R NEMA L10-30R NEMA L14-20R NEMA L14-30R NEMA L14-50R NEMA L14-60R NEMA L15-20R NEMA L15-30R NEMA L15-50R NEMA L15-60R NEMA L21-20R NEMA L21-30R CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ITA Type E (CEE 7/5) ITA Type F (CEE 7/3) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O USB Type A USB Micro B USB Type C DC Terminal HDOT Cx Saf-D-Grid Hardwired] + // Enum: [C5 C7 C13 C15 C19 C21 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15R NEMA 5-15R NEMA 5-20R NEMA 5-30R NEMA 5-50R NEMA 6-15R NEMA 6-20R NEMA 6-30R NEMA 6-50R NEMA 10-30R NEMA 10-50R NEMA 14-20R NEMA 14-30R NEMA 14-50R NEMA 14-60R NEMA 15-15R NEMA 15-20R NEMA 15-30R NEMA 15-50R NEMA 15-60R NEMA L1-15R NEMA L5-15R NEMA L5-20R NEMA L5-30R NEMA L5-50R NEMA L6-15R NEMA L6-20R NEMA L6-30R NEMA L6-50R NEMA L10-30R NEMA L14-20R NEMA L14-30R NEMA L14-50R NEMA L14-60R NEMA L15-20R NEMA L15-30R NEMA L15-50R NEMA L15-60R NEMA L21-20R NEMA L21-30R NEMA L22-30R CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ITA Type E (CEE 7/5) ITA Type F (CEE 7/3) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O ITA Multistandard USB Type A USB Micro B USB Type C DC Terminal HDOT Cx Saf-D-Grid Hardwired] Label *string `json:"label"` // value // Required: true - // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] + // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r nema-l22-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o ita-multistandard usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] Value *string `json:"value"` } @@ -866,7 +866,7 @@ var powerOutletTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["C5","C7","C13","C15","C19","C21","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15R","NEMA 5-15R","NEMA 5-20R","NEMA 5-30R","NEMA 5-50R","NEMA 6-15R","NEMA 6-20R","NEMA 6-30R","NEMA 6-50R","NEMA 10-30R","NEMA 10-50R","NEMA 14-20R","NEMA 14-30R","NEMA 14-50R","NEMA 14-60R","NEMA 15-15R","NEMA 15-20R","NEMA 15-30R","NEMA 15-50R","NEMA 15-60R","NEMA L1-15R","NEMA L5-15R","NEMA L5-20R","NEMA L5-30R","NEMA L5-50R","NEMA L6-15R","NEMA L6-20R","NEMA L6-30R","NEMA L6-50R","NEMA L10-30R","NEMA L14-20R","NEMA L14-30R","NEMA L14-50R","NEMA L14-60R","NEMA L15-20R","NEMA L15-30R","NEMA L15-50R","NEMA L15-60R","NEMA L21-20R","NEMA L21-30R","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ITA Type E (CEE 7/5)","ITA Type F (CEE 7/3)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","USB Type A","USB Micro B","USB Type C","DC Terminal","HDOT Cx","Saf-D-Grid","Hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["C5","C7","C13","C15","C19","C21","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15R","NEMA 5-15R","NEMA 5-20R","NEMA 5-30R","NEMA 5-50R","NEMA 6-15R","NEMA 6-20R","NEMA 6-30R","NEMA 6-50R","NEMA 10-30R","NEMA 10-50R","NEMA 14-20R","NEMA 14-30R","NEMA 14-50R","NEMA 14-60R","NEMA 15-15R","NEMA 15-20R","NEMA 15-30R","NEMA 15-50R","NEMA 15-60R","NEMA L1-15R","NEMA L5-15R","NEMA L5-20R","NEMA L5-30R","NEMA L5-50R","NEMA L6-15R","NEMA L6-20R","NEMA L6-30R","NEMA L6-50R","NEMA L10-30R","NEMA L14-20R","NEMA L14-30R","NEMA L14-50R","NEMA L14-60R","NEMA L15-20R","NEMA L15-30R","NEMA L15-50R","NEMA L15-60R","NEMA L21-20R","NEMA L21-30R","NEMA L22-30R","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ITA Type E (CEE 7/5)","ITA Type F (CEE 7/3)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","ITA Multistandard","USB Type A","USB Micro B","USB Type C","DC Terminal","HDOT Cx","Saf-D-Grid","Hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -1050,6 +1050,9 @@ const ( // PowerOutletTypeLabelNEMAL21Dash30R captures enum value "NEMA L21-30R" PowerOutletTypeLabelNEMAL21Dash30R string = "NEMA L21-30R" + // PowerOutletTypeLabelNEMAL22Dash30R captures enum value "NEMA L22-30R" + PowerOutletTypeLabelNEMAL22Dash30R string = "NEMA L22-30R" + // PowerOutletTypeLabelCS6360C captures enum value "CS6360C" PowerOutletTypeLabelCS6360C string = "CS6360C" @@ -1101,6 +1104,9 @@ const ( // PowerOutletTypeLabelITATypeO captures enum value "ITA Type O" PowerOutletTypeLabelITATypeO string = "ITA Type O" + // PowerOutletTypeLabelITAMultistandard captures enum value "ITA Multistandard" + PowerOutletTypeLabelITAMultistandard string = "ITA Multistandard" + // PowerOutletTypeLabelUSBTypeA captures enum value "USB Type A" PowerOutletTypeLabelUSBTypeA string = "USB Type A" @@ -1149,7 +1155,7 @@ var powerOutletTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","nema-l22-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","ita-multistandard","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -1333,6 +1339,9 @@ const ( // PowerOutletTypeValueNemaDashL21Dash30r captures enum value "nema-l21-30r" PowerOutletTypeValueNemaDashL21Dash30r string = "nema-l21-30r" + // PowerOutletTypeValueNemaDashL22Dash30r captures enum value "nema-l22-30r" + PowerOutletTypeValueNemaDashL22Dash30r string = "nema-l22-30r" + // PowerOutletTypeValueCS6360C captures enum value "CS6360C" PowerOutletTypeValueCS6360C string = "CS6360C" @@ -1384,6 +1393,9 @@ const ( // PowerOutletTypeValueItaDasho captures enum value "ita-o" PowerOutletTypeValueItaDasho string = "ita-o" + // PowerOutletTypeValueItaDashMultistandard captures enum value "ita-multistandard" + PowerOutletTypeValueItaDashMultistandard string = "ita-multistandard" + // PowerOutletTypeValueUsbDasha captures enum value "usb-a" PowerOutletTypeValueUsbDasha string = "usb-a" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet_template.go index 69cd2b024..58e61395e 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/power_outlet_template.go @@ -621,12 +621,12 @@ type PowerOutletTemplateType struct { // label // Required: true - // Enum: [C5 C7 C13 C15 C19 C21 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15R NEMA 5-15R NEMA 5-20R NEMA 5-30R NEMA 5-50R NEMA 6-15R NEMA 6-20R NEMA 6-30R NEMA 6-50R NEMA 10-30R NEMA 10-50R NEMA 14-20R NEMA 14-30R NEMA 14-50R NEMA 14-60R NEMA 15-15R NEMA 15-20R NEMA 15-30R NEMA 15-50R NEMA 15-60R NEMA L1-15R NEMA L5-15R NEMA L5-20R NEMA L5-30R NEMA L5-50R NEMA L6-15R NEMA L6-20R NEMA L6-30R NEMA L6-50R NEMA L10-30R NEMA L14-20R NEMA L14-30R NEMA L14-50R NEMA L14-60R NEMA L15-20R NEMA L15-30R NEMA L15-50R NEMA L15-60R NEMA L21-20R NEMA L21-30R CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ITA Type E (CEE 7/5) ITA Type F (CEE 7/3) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O USB Type A USB Micro B USB Type C DC Terminal HDOT Cx Saf-D-Grid Hardwired] + // Enum: [C5 C7 C13 C15 C19 C21 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15R NEMA 5-15R NEMA 5-20R NEMA 5-30R NEMA 5-50R NEMA 6-15R NEMA 6-20R NEMA 6-30R NEMA 6-50R NEMA 10-30R NEMA 10-50R NEMA 14-20R NEMA 14-30R NEMA 14-50R NEMA 14-60R NEMA 15-15R NEMA 15-20R NEMA 15-30R NEMA 15-50R NEMA 15-60R NEMA L1-15R NEMA L5-15R NEMA L5-20R NEMA L5-30R NEMA L5-50R NEMA L6-15R NEMA L6-20R NEMA L6-30R NEMA L6-50R NEMA L10-30R NEMA L14-20R NEMA L14-30R NEMA L14-50R NEMA L14-60R NEMA L15-20R NEMA L15-30R NEMA L15-50R NEMA L15-60R NEMA L21-20R NEMA L21-30R NEMA L22-30R CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ITA Type E (CEE 7/5) ITA Type F (CEE 7/3) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O ITA Multistandard USB Type A USB Micro B USB Type C DC Terminal HDOT Cx Saf-D-Grid Hardwired] Label *string `json:"label"` // value // Required: true - // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] + // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r nema-l22-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o ita-multistandard usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] Value *string `json:"value"` } @@ -652,7 +652,7 @@ var powerOutletTemplateTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["C5","C7","C13","C15","C19","C21","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15R","NEMA 5-15R","NEMA 5-20R","NEMA 5-30R","NEMA 5-50R","NEMA 6-15R","NEMA 6-20R","NEMA 6-30R","NEMA 6-50R","NEMA 10-30R","NEMA 10-50R","NEMA 14-20R","NEMA 14-30R","NEMA 14-50R","NEMA 14-60R","NEMA 15-15R","NEMA 15-20R","NEMA 15-30R","NEMA 15-50R","NEMA 15-60R","NEMA L1-15R","NEMA L5-15R","NEMA L5-20R","NEMA L5-30R","NEMA L5-50R","NEMA L6-15R","NEMA L6-20R","NEMA L6-30R","NEMA L6-50R","NEMA L10-30R","NEMA L14-20R","NEMA L14-30R","NEMA L14-50R","NEMA L14-60R","NEMA L15-20R","NEMA L15-30R","NEMA L15-50R","NEMA L15-60R","NEMA L21-20R","NEMA L21-30R","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ITA Type E (CEE 7/5)","ITA Type F (CEE 7/3)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","USB Type A","USB Micro B","USB Type C","DC Terminal","HDOT Cx","Saf-D-Grid","Hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["C5","C7","C13","C15","C19","C21","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15R","NEMA 5-15R","NEMA 5-20R","NEMA 5-30R","NEMA 5-50R","NEMA 6-15R","NEMA 6-20R","NEMA 6-30R","NEMA 6-50R","NEMA 10-30R","NEMA 10-50R","NEMA 14-20R","NEMA 14-30R","NEMA 14-50R","NEMA 14-60R","NEMA 15-15R","NEMA 15-20R","NEMA 15-30R","NEMA 15-50R","NEMA 15-60R","NEMA L1-15R","NEMA L5-15R","NEMA L5-20R","NEMA L5-30R","NEMA L5-50R","NEMA L6-15R","NEMA L6-20R","NEMA L6-30R","NEMA L6-50R","NEMA L10-30R","NEMA L14-20R","NEMA L14-30R","NEMA L14-50R","NEMA L14-60R","NEMA L15-20R","NEMA L15-30R","NEMA L15-50R","NEMA L15-60R","NEMA L21-20R","NEMA L21-30R","NEMA L22-30R","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ITA Type E (CEE 7/5)","ITA Type F (CEE 7/3)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","ITA Multistandard","USB Type A","USB Micro B","USB Type C","DC Terminal","HDOT Cx","Saf-D-Grid","Hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -836,6 +836,9 @@ const ( // PowerOutletTemplateTypeLabelNEMAL21Dash30R captures enum value "NEMA L21-30R" PowerOutletTemplateTypeLabelNEMAL21Dash30R string = "NEMA L21-30R" + // PowerOutletTemplateTypeLabelNEMAL22Dash30R captures enum value "NEMA L22-30R" + PowerOutletTemplateTypeLabelNEMAL22Dash30R string = "NEMA L22-30R" + // PowerOutletTemplateTypeLabelCS6360C captures enum value "CS6360C" PowerOutletTemplateTypeLabelCS6360C string = "CS6360C" @@ -887,6 +890,9 @@ const ( // PowerOutletTemplateTypeLabelITATypeO captures enum value "ITA Type O" PowerOutletTemplateTypeLabelITATypeO string = "ITA Type O" + // PowerOutletTemplateTypeLabelITAMultistandard captures enum value "ITA Multistandard" + PowerOutletTemplateTypeLabelITAMultistandard string = "ITA Multistandard" + // PowerOutletTemplateTypeLabelUSBTypeA captures enum value "USB Type A" PowerOutletTemplateTypeLabelUSBTypeA string = "USB Type A" @@ -935,7 +941,7 @@ var powerOutletTemplateTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","nema-l22-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","ita-multistandard","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -1119,6 +1125,9 @@ const ( // PowerOutletTemplateTypeValueNemaDashL21Dash30r captures enum value "nema-l21-30r" PowerOutletTemplateTypeValueNemaDashL21Dash30r string = "nema-l21-30r" + // PowerOutletTemplateTypeValueNemaDashL22Dash30r captures enum value "nema-l22-30r" + PowerOutletTemplateTypeValueNemaDashL22Dash30r string = "nema-l22-30r" + // PowerOutletTemplateTypeValueCS6360C captures enum value "CS6360C" PowerOutletTemplateTypeValueCS6360C string = "CS6360C" @@ -1170,6 +1179,9 @@ const ( // PowerOutletTemplateTypeValueItaDasho captures enum value "ita-o" PowerOutletTemplateTypeValueItaDasho string = "ita-o" + // PowerOutletTemplateTypeValueItaDashMultistandard captures enum value "ita-multistandard" + PowerOutletTemplateTypeValueItaDashMultistandard string = "ita-multistandard" + // PowerOutletTemplateTypeValueUsbDasha captures enum value "usb-a" PowerOutletTemplateTypeValueUsbDasha string = "usb-a" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/power_panel.go b/vendor/github.com/smutel/go-netbox/netbox/models/power_panel.go index 2e1531628..bca01588f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/power_panel.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/power_panel.go @@ -35,6 +35,11 @@ import ( // swagger:model PowerPanel type PowerPanel struct { + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -46,6 +51,11 @@ type PowerPanel struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // location Location *NestedLocation `json:"location,omitempty"` @@ -76,6 +86,14 @@ type PowerPanel struct { func (m *PowerPanel) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateLocation(formats); err != nil { res = append(res, err) } @@ -102,6 +120,30 @@ func (m *PowerPanel) Validate(formats strfmt.Registry) error { return nil } +func (m *PowerPanel) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PowerPanel) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *PowerPanel) validateLocation(formats strfmt.Registry) error { if swag.IsZero(m.Location) { // not required return nil @@ -200,6 +242,10 @@ func (m *PowerPanel) validateURL(formats strfmt.Registry) error { func (m *PowerPanel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -208,6 +254,10 @@ func (m *PowerPanel) ContextValidate(ctx context.Context, formats strfmt.Registr res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateLocation(ctx, formats); err != nil { res = append(res, err) } @@ -234,6 +284,15 @@ func (m *PowerPanel) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } +func (m *PowerPanel) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *PowerPanel) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -252,6 +311,15 @@ func (m *PowerPanel) contextValidateID(ctx context.Context, formats strfmt.Regis return nil } +func (m *PowerPanel) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *PowerPanel) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { if m.Location != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/power_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/power_port.go index 084c44950..11bcc3733 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/power_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/power_port.go @@ -50,18 +50,6 @@ type PowerPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -113,6 +101,18 @@ type PowerPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -406,14 +406,6 @@ func (m *PowerPort) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -446,6 +438,14 @@ func (m *PowerPort) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -489,20 +489,6 @@ func (m *PowerPort) contextValidateCable(ctx context.Context, formats strfmt.Reg return nil } -func (m *PowerPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *PowerPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *PowerPort) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -578,6 +564,20 @@ func (m *PowerPort) contextValidateLastUpdated(ctx context.Context, formats strf return nil } +func (m *PowerPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *PowerPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *PowerPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { @@ -648,12 +648,12 @@ type PowerPortType struct { // label // Required: true - // Enum: [C6 C8 C14 C16 C20 C22 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15P NEMA 5-15P NEMA 5-20P NEMA 5-30P NEMA 5-50P NEMA 6-15P NEMA 6-20P NEMA 6-30P NEMA 6-50P NEMA 10-30P NEMA 10-50P NEMA 14-20P NEMA 14-30P NEMA 14-50P NEMA 14-60P NEMA 15-15P NEMA 15-20P NEMA 15-30P NEMA 15-50P NEMA 15-60P NEMA L1-15P NEMA L5-15P NEMA L5-20P NEMA L5-30P NEMA L5-50P NEMA L6-15P NEMA L6-20P NEMA L6-30P NEMA L6-50P NEMA L10-30P NEMA L14-20P NEMA L14-30P NEMA L14-50P NEMA L14-60P NEMA L15-20P NEMA L15-30P NEMA L15-50P NEMA L15-60P NEMA L21-20P NEMA L21-30P CS6361C CS6365C CS8165C CS8265C CS8365C CS8465C ITA Type C (CEE 7/16) ITA Type E (CEE 7/6) ITA Type F (CEE 7/4) ITA Type E/F (CEE 7/7) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O USB Type A USB Type B USB Type C USB Mini A USB Mini B USB Micro A USB Micro B USB Micro AB USB 3.0 Type B USB 3.0 Micro B DC Terminal Saf-D-Grid Hardwired] + // Enum: [C6 C8 C14 C16 C20 C22 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15P NEMA 5-15P NEMA 5-20P NEMA 5-30P NEMA 5-50P NEMA 6-15P NEMA 6-20P NEMA 6-30P NEMA 6-50P NEMA 10-30P NEMA 10-50P NEMA 14-20P NEMA 14-30P NEMA 14-50P NEMA 14-60P NEMA 15-15P NEMA 15-20P NEMA 15-30P NEMA 15-50P NEMA 15-60P NEMA L1-15P NEMA L5-15P NEMA L5-20P NEMA L5-30P NEMA L5-50P NEMA L6-15P NEMA L6-20P NEMA L6-30P NEMA L6-50P NEMA L10-30P NEMA L14-20P NEMA L14-30P NEMA L14-50P NEMA L14-60P NEMA L15-20P NEMA L15-30P NEMA L15-50P NEMA L15-60P NEMA L21-20P NEMA L21-30P NEMA L22-30P CS6361C CS6365C CS8165C CS8265C CS8365C CS8465C ITA Type C (CEE 7/16) ITA Type E (CEE 7/6) ITA Type F (CEE 7/4) ITA Type E/F (CEE 7/7) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O USB Type A USB Type B USB Type C USB Mini A USB Mini B USB Micro A USB Micro B USB Micro AB USB 3.0 Type B USB 3.0 Micro B DC Terminal Saf-D-Grid Hardwired] Label *string `json:"label"` // value // Required: true - // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] + // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p nema-l22-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] Value *string `json:"value"` } @@ -679,7 +679,7 @@ var powerPortTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["C6","C8","C14","C16","C20","C22","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15P","NEMA 5-15P","NEMA 5-20P","NEMA 5-30P","NEMA 5-50P","NEMA 6-15P","NEMA 6-20P","NEMA 6-30P","NEMA 6-50P","NEMA 10-30P","NEMA 10-50P","NEMA 14-20P","NEMA 14-30P","NEMA 14-50P","NEMA 14-60P","NEMA 15-15P","NEMA 15-20P","NEMA 15-30P","NEMA 15-50P","NEMA 15-60P","NEMA L1-15P","NEMA L5-15P","NEMA L5-20P","NEMA L5-30P","NEMA L5-50P","NEMA L6-15P","NEMA L6-20P","NEMA L6-30P","NEMA L6-50P","NEMA L10-30P","NEMA L14-20P","NEMA L14-30P","NEMA L14-50P","NEMA L14-60P","NEMA L15-20P","NEMA L15-30P","NEMA L15-50P","NEMA L15-60P","NEMA L21-20P","NEMA L21-30P","CS6361C","CS6365C","CS8165C","CS8265C","CS8365C","CS8465C","ITA Type C (CEE 7/16)","ITA Type E (CEE 7/6)","ITA Type F (CEE 7/4)","ITA Type E/F (CEE 7/7)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","USB Type A","USB Type B","USB Type C","USB Mini A","USB Mini B","USB Micro A","USB Micro B","USB Micro AB","USB 3.0 Type B","USB 3.0 Micro B","DC Terminal","Saf-D-Grid","Hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["C6","C8","C14","C16","C20","C22","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15P","NEMA 5-15P","NEMA 5-20P","NEMA 5-30P","NEMA 5-50P","NEMA 6-15P","NEMA 6-20P","NEMA 6-30P","NEMA 6-50P","NEMA 10-30P","NEMA 10-50P","NEMA 14-20P","NEMA 14-30P","NEMA 14-50P","NEMA 14-60P","NEMA 15-15P","NEMA 15-20P","NEMA 15-30P","NEMA 15-50P","NEMA 15-60P","NEMA L1-15P","NEMA L5-15P","NEMA L5-20P","NEMA L5-30P","NEMA L5-50P","NEMA L6-15P","NEMA L6-20P","NEMA L6-30P","NEMA L6-50P","NEMA L10-30P","NEMA L14-20P","NEMA L14-30P","NEMA L14-50P","NEMA L14-60P","NEMA L15-20P","NEMA L15-30P","NEMA L15-50P","NEMA L15-60P","NEMA L21-20P","NEMA L21-30P","NEMA L22-30P","CS6361C","CS6365C","CS8165C","CS8265C","CS8365C","CS8465C","ITA Type C (CEE 7/16)","ITA Type E (CEE 7/6)","ITA Type F (CEE 7/4)","ITA Type E/F (CEE 7/7)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","USB Type A","USB Type B","USB Type C","USB Mini A","USB Mini B","USB Micro A","USB Micro B","USB Micro AB","USB 3.0 Type B","USB 3.0 Micro B","DC Terminal","Saf-D-Grid","Hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -863,6 +863,9 @@ const ( // PowerPortTypeLabelNEMAL21Dash30P captures enum value "NEMA L21-30P" PowerPortTypeLabelNEMAL21Dash30P string = "NEMA L21-30P" + // PowerPortTypeLabelNEMAL22Dash30P captures enum value "NEMA L22-30P" + PowerPortTypeLabelNEMAL22Dash30P string = "NEMA L22-30P" + // PowerPortTypeLabelCS6361C captures enum value "CS6361C" PowerPortTypeLabelCS6361C string = "CS6361C" @@ -986,7 +989,7 @@ var powerPortTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","nema-l22-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -1170,6 +1173,9 @@ const ( // PowerPortTypeValueNemaDashL21Dash30p captures enum value "nema-l21-30p" PowerPortTypeValueNemaDashL21Dash30p string = "nema-l21-30p" + // PowerPortTypeValueNemaDashL22Dash30p captures enum value "nema-l22-30p" + PowerPortTypeValueNemaDashL22Dash30p string = "nema-l22-30p" + // PowerPortTypeValueCs6361c captures enum value "cs6361c" PowerPortTypeValueCs6361c string = "cs6361c" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/power_port_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/power_port_template.go index 71fda2054..1fbc58fa0 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/power_port_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/power_port_template.go @@ -434,12 +434,12 @@ type PowerPortTemplateType struct { // label // Required: true - // Enum: [C6 C8 C14 C16 C20 C22 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15P NEMA 5-15P NEMA 5-20P NEMA 5-30P NEMA 5-50P NEMA 6-15P NEMA 6-20P NEMA 6-30P NEMA 6-50P NEMA 10-30P NEMA 10-50P NEMA 14-20P NEMA 14-30P NEMA 14-50P NEMA 14-60P NEMA 15-15P NEMA 15-20P NEMA 15-30P NEMA 15-50P NEMA 15-60P NEMA L1-15P NEMA L5-15P NEMA L5-20P NEMA L5-30P NEMA L5-50P NEMA L6-15P NEMA L6-20P NEMA L6-30P NEMA L6-50P NEMA L10-30P NEMA L14-20P NEMA L14-30P NEMA L14-50P NEMA L14-60P NEMA L15-20P NEMA L15-30P NEMA L15-50P NEMA L15-60P NEMA L21-20P NEMA L21-30P CS6361C CS6365C CS8165C CS8265C CS8365C CS8465C ITA Type C (CEE 7/16) ITA Type E (CEE 7/6) ITA Type F (CEE 7/4) ITA Type E/F (CEE 7/7) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O USB Type A USB Type B USB Type C USB Mini A USB Mini B USB Micro A USB Micro B USB Micro AB USB 3.0 Type B USB 3.0 Micro B DC Terminal Saf-D-Grid Hardwired] + // Enum: [C6 C8 C14 C16 C20 C22 P+N+E 4H P+N+E 6H P+N+E 9H 2P+E 4H 2P+E 6H 2P+E 9H 3P+E 4H 3P+E 6H 3P+E 9H 3P+N+E 4H 3P+N+E 6H 3P+N+E 9H NEMA 1-15P NEMA 5-15P NEMA 5-20P NEMA 5-30P NEMA 5-50P NEMA 6-15P NEMA 6-20P NEMA 6-30P NEMA 6-50P NEMA 10-30P NEMA 10-50P NEMA 14-20P NEMA 14-30P NEMA 14-50P NEMA 14-60P NEMA 15-15P NEMA 15-20P NEMA 15-30P NEMA 15-50P NEMA 15-60P NEMA L1-15P NEMA L5-15P NEMA L5-20P NEMA L5-30P NEMA L5-50P NEMA L6-15P NEMA L6-20P NEMA L6-30P NEMA L6-50P NEMA L10-30P NEMA L14-20P NEMA L14-30P NEMA L14-50P NEMA L14-60P NEMA L15-20P NEMA L15-30P NEMA L15-50P NEMA L15-60P NEMA L21-20P NEMA L21-30P NEMA L22-30P CS6361C CS6365C CS8165C CS8265C CS8365C CS8465C ITA Type C (CEE 7/16) ITA Type E (CEE 7/6) ITA Type F (CEE 7/4) ITA Type E/F (CEE 7/7) ITA Type G (BS 1363) ITA Type H ITA Type I ITA Type J ITA Type K ITA Type L (CEI 23-50) ITA Type M (BS 546) ITA Type N ITA Type O USB Type A USB Type B USB Type C USB Mini A USB Mini B USB Micro A USB Micro B USB Micro AB USB 3.0 Type B USB 3.0 Micro B DC Terminal Saf-D-Grid Hardwired] Label *string `json:"label"` // value // Required: true - // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] + // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p nema-l22-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] Value *string `json:"value"` } @@ -465,7 +465,7 @@ var powerPortTemplateTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["C6","C8","C14","C16","C20","C22","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15P","NEMA 5-15P","NEMA 5-20P","NEMA 5-30P","NEMA 5-50P","NEMA 6-15P","NEMA 6-20P","NEMA 6-30P","NEMA 6-50P","NEMA 10-30P","NEMA 10-50P","NEMA 14-20P","NEMA 14-30P","NEMA 14-50P","NEMA 14-60P","NEMA 15-15P","NEMA 15-20P","NEMA 15-30P","NEMA 15-50P","NEMA 15-60P","NEMA L1-15P","NEMA L5-15P","NEMA L5-20P","NEMA L5-30P","NEMA L5-50P","NEMA L6-15P","NEMA L6-20P","NEMA L6-30P","NEMA L6-50P","NEMA L10-30P","NEMA L14-20P","NEMA L14-30P","NEMA L14-50P","NEMA L14-60P","NEMA L15-20P","NEMA L15-30P","NEMA L15-50P","NEMA L15-60P","NEMA L21-20P","NEMA L21-30P","CS6361C","CS6365C","CS8165C","CS8265C","CS8365C","CS8465C","ITA Type C (CEE 7/16)","ITA Type E (CEE 7/6)","ITA Type F (CEE 7/4)","ITA Type E/F (CEE 7/7)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","USB Type A","USB Type B","USB Type C","USB Mini A","USB Mini B","USB Micro A","USB Micro B","USB Micro AB","USB 3.0 Type B","USB 3.0 Micro B","DC Terminal","Saf-D-Grid","Hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["C6","C8","C14","C16","C20","C22","P+N+E 4H","P+N+E 6H","P+N+E 9H","2P+E 4H","2P+E 6H","2P+E 9H","3P+E 4H","3P+E 6H","3P+E 9H","3P+N+E 4H","3P+N+E 6H","3P+N+E 9H","NEMA 1-15P","NEMA 5-15P","NEMA 5-20P","NEMA 5-30P","NEMA 5-50P","NEMA 6-15P","NEMA 6-20P","NEMA 6-30P","NEMA 6-50P","NEMA 10-30P","NEMA 10-50P","NEMA 14-20P","NEMA 14-30P","NEMA 14-50P","NEMA 14-60P","NEMA 15-15P","NEMA 15-20P","NEMA 15-30P","NEMA 15-50P","NEMA 15-60P","NEMA L1-15P","NEMA L5-15P","NEMA L5-20P","NEMA L5-30P","NEMA L5-50P","NEMA L6-15P","NEMA L6-20P","NEMA L6-30P","NEMA L6-50P","NEMA L10-30P","NEMA L14-20P","NEMA L14-30P","NEMA L14-50P","NEMA L14-60P","NEMA L15-20P","NEMA L15-30P","NEMA L15-50P","NEMA L15-60P","NEMA L21-20P","NEMA L21-30P","NEMA L22-30P","CS6361C","CS6365C","CS8165C","CS8265C","CS8365C","CS8465C","ITA Type C (CEE 7/16)","ITA Type E (CEE 7/6)","ITA Type F (CEE 7/4)","ITA Type E/F (CEE 7/7)","ITA Type G (BS 1363)","ITA Type H","ITA Type I","ITA Type J","ITA Type K","ITA Type L (CEI 23-50)","ITA Type M (BS 546)","ITA Type N","ITA Type O","USB Type A","USB Type B","USB Type C","USB Mini A","USB Mini B","USB Micro A","USB Micro B","USB Micro AB","USB 3.0 Type B","USB 3.0 Micro B","DC Terminal","Saf-D-Grid","Hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -649,6 +649,9 @@ const ( // PowerPortTemplateTypeLabelNEMAL21Dash30P captures enum value "NEMA L21-30P" PowerPortTemplateTypeLabelNEMAL21Dash30P string = "NEMA L21-30P" + // PowerPortTemplateTypeLabelNEMAL22Dash30P captures enum value "NEMA L22-30P" + PowerPortTemplateTypeLabelNEMAL22Dash30P string = "NEMA L22-30P" + // PowerPortTemplateTypeLabelCS6361C captures enum value "CS6361C" PowerPortTemplateTypeLabelCS6361C string = "CS6361C" @@ -772,7 +775,7 @@ var powerPortTemplateTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","nema-l22-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -956,6 +959,9 @@ const ( // PowerPortTemplateTypeValueNemaDashL21Dash30p captures enum value "nema-l21-30p" PowerPortTemplateTypeValueNemaDashL21Dash30p string = "nema-l21-30p" + // PowerPortTemplateTypeValueNemaDashL22Dash30p captures enum value "nema-l22-30p" + PowerPortTemplateTypeValueNemaDashL22Dash30p string = "nema-l22-30p" + // PowerPortTemplateTypeValueCs6361c captures enum value "cs6361c" PowerPortTemplateTypeValueCs6361c string = "cs6361c" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/r_i_r.go b/vendor/github.com/smutel/go-netbox/netbox/models/r_i_r.go index 06f78dcdb..50ff9a8a4 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/r_i_r.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/r_i_r.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -81,6 +82,9 @@ type RIR struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -111,6 +115,10 @@ func (m *RIR) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -195,6 +203,32 @@ func (m *RIR) validateSlug(formats strfmt.Registry) error { return nil } +func (m *RIR) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *RIR) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -231,6 +265,10 @@ func (m *RIR) ContextValidate(ctx context.Context, formats strfmt.Registry) erro res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -286,6 +324,26 @@ func (m *RIR) contextValidateLastUpdated(ctx context.Context, formats strfmt.Reg return nil } +func (m *RIR) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *RIR) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/rack.go b/vendor/github.com/smutel/go-netbox/netbox/models/rack.go index 79bdfaa53..f840e5737 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/rack.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/rack.go @@ -67,8 +67,6 @@ type Rack struct { Display string `json:"display,omitempty"` // Facility ID - // - // Locally-assigned identifier // Max Length: 50 FacilityID *string `json:"facility_id,omitempty"` diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/rack_reservation.go b/vendor/github.com/smutel/go-netbox/netbox/models/rack_reservation.go index 417436aa6..a4ea1813f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/rack_reservation.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/rack_reservation.go @@ -57,6 +57,11 @@ type RackReservation struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // rack // Required: true Rack *NestedRack `json:"rack"` @@ -93,6 +98,10 @@ func (m *RackReservation) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateRack(formats); err != nil { res = append(res, err) } @@ -152,6 +161,18 @@ func (m *RackReservation) validateDescription(formats strfmt.Registry) error { return nil } +func (m *RackReservation) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *RackReservation) validateRack(formats strfmt.Registry) error { if err := validate.Required("rack", "body", m.Rack); err != nil { @@ -289,6 +310,10 @@ func (m *RackReservation) ContextValidate(ctx context.Context, formats strfmt.Re res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateRack(ctx, formats); err != nil { res = append(res, err) } @@ -342,6 +367,15 @@ func (m *RackReservation) contextValidateID(ctx context.Context, formats strfmt. return nil } +func (m *RackReservation) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *RackReservation) contextValidateRack(ctx context.Context, formats strfmt.Registry) error { if m.Rack != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/rack_role.go b/vendor/github.com/smutel/go-netbox/netbox/models/rack_role.go index fbf9ba6cc..f19a25f40 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/rack_role.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/rack_role.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -82,6 +83,9 @@ type RackRole struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -116,6 +120,10 @@ func (m *RackRole) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -220,6 +228,32 @@ func (m *RackRole) validateSlug(formats strfmt.Registry) error { return nil } +func (m *RackRole) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *RackRole) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -256,6 +290,10 @@ func (m *RackRole) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -311,6 +349,26 @@ func (m *RackRole) contextValidateRackCount(ctx context.Context, formats strfmt. return nil } +func (m *RackRole) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *RackRole) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/rear_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/rear_port.go index 5882692be..71382cf45 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/rear_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/rear_port.go @@ -43,18 +43,6 @@ type RearPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Color // Max Length: 6 // Pattern: ^[0-9a-f]{6}$ @@ -95,6 +83,18 @@ type RearPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -388,31 +388,31 @@ func (m *RearPort) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { + if err := m.contextValidateCreated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { + if err := m.contextValidateDevice(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCreated(ctx, formats); err != nil { + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDevice(ctx, formats); err != nil { + if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDisplay(ctx, formats); err != nil { + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateID(ctx, formats); err != nil { + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { res = append(res, err) } @@ -459,20 +459,6 @@ func (m *RearPort) contextValidateCable(ctx context.Context, formats strfmt.Regi return nil } -func (m *RearPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *RearPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *RearPort) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { @@ -525,6 +511,20 @@ func (m *RearPort) contextValidateLastUpdated(ctx context.Context, formats strfm return nil } +func (m *RearPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *RearPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *RearPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { @@ -595,12 +595,12 @@ type RearPortType struct { // label // Required: true - // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/APC LSH LSH/APC MPO MTRJ SC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] + // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/PC LC/UPC LC/APC LSH LSH/PC LSH/UPC LSH/APC MPO MTRJ SC SC/PC SC/UPC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] Label *string `json:"label"` // value // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Value *string `json:"value"` } @@ -626,7 +626,7 @@ var rearPortTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/APC","LSH","LSH/APC","MPO","MTRJ","SC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/PC","LC/UPC","LC/APC","LSH","LSH/PC","LSH/UPC","LSH/APC","MPO","MTRJ","SC","SC/PC","SC/UPC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -696,12 +696,24 @@ const ( // RearPortTypeLabelLC captures enum value "LC" RearPortTypeLabelLC string = "LC" + // RearPortTypeLabelLCPC captures enum value "LC/PC" + RearPortTypeLabelLCPC string = "LC/PC" + + // RearPortTypeLabelLCUPC captures enum value "LC/UPC" + RearPortTypeLabelLCUPC string = "LC/UPC" + // RearPortTypeLabelLCAPC captures enum value "LC/APC" RearPortTypeLabelLCAPC string = "LC/APC" // RearPortTypeLabelLSH captures enum value "LSH" RearPortTypeLabelLSH string = "LSH" + // RearPortTypeLabelLSHPC captures enum value "LSH/PC" + RearPortTypeLabelLSHPC string = "LSH/PC" + + // RearPortTypeLabelLSHUPC captures enum value "LSH/UPC" + RearPortTypeLabelLSHUPC string = "LSH/UPC" + // RearPortTypeLabelLSHAPC captures enum value "LSH/APC" RearPortTypeLabelLSHAPC string = "LSH/APC" @@ -714,6 +726,12 @@ const ( // RearPortTypeLabelSC captures enum value "SC" RearPortTypeLabelSC string = "SC" + // RearPortTypeLabelSCPC captures enum value "SC/PC" + RearPortTypeLabelSCPC string = "SC/PC" + + // RearPortTypeLabelSCUPC captures enum value "SC/UPC" + RearPortTypeLabelSCUPC string = "SC/UPC" + // RearPortTypeLabelSCAPC captures enum value "SC/APC" RearPortTypeLabelSCAPC string = "SC/APC" @@ -771,7 +789,7 @@ var rearPortTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -841,12 +859,24 @@ const ( // RearPortTypeValueLc captures enum value "lc" RearPortTypeValueLc string = "lc" + // RearPortTypeValueLcDashPc captures enum value "lc-pc" + RearPortTypeValueLcDashPc string = "lc-pc" + + // RearPortTypeValueLcDashUpc captures enum value "lc-upc" + RearPortTypeValueLcDashUpc string = "lc-upc" + // RearPortTypeValueLcDashApc captures enum value "lc-apc" RearPortTypeValueLcDashApc string = "lc-apc" // RearPortTypeValueLsh captures enum value "lsh" RearPortTypeValueLsh string = "lsh" + // RearPortTypeValueLshDashPc captures enum value "lsh-pc" + RearPortTypeValueLshDashPc string = "lsh-pc" + + // RearPortTypeValueLshDashUpc captures enum value "lsh-upc" + RearPortTypeValueLshDashUpc string = "lsh-upc" + // RearPortTypeValueLshDashApc captures enum value "lsh-apc" RearPortTypeValueLshDashApc string = "lsh-apc" @@ -859,6 +889,12 @@ const ( // RearPortTypeValueSc captures enum value "sc" RearPortTypeValueSc string = "sc" + // RearPortTypeValueScDashPc captures enum value "sc-pc" + RearPortTypeValueScDashPc string = "sc-pc" + + // RearPortTypeValueScDashUpc captures enum value "sc-upc" + RearPortTypeValueScDashUpc string = "sc-upc" + // RearPortTypeValueScDashApc captures enum value "sc-apc" RearPortTypeValueScDashApc string = "sc-apc" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/rear_port_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/rear_port_template.go index 7760cb1a7..c762fcb40 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/rear_port_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/rear_port_template.go @@ -432,12 +432,12 @@ type RearPortTemplateType struct { // label // Required: true - // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/APC LSH LSH/APC MPO MTRJ SC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] + // Enum: [8P8C 8P6C 8P4C 8P2C 6P6C 6P4C 6P2C 4P4C 4P2C GG45 TERA 4P TERA 2P TERA 1P 110 Punch BNC F Connector N Connector MRJ21 FC LC LC/PC LC/UPC LC/APC LSH LSH/PC LSH/UPC LSH/APC MPO MTRJ SC SC/PC SC/UPC SC/APC ST CS SN SMA 905 SMA 906 URM-P2 URM-P4 URM-P8 Splice] Label *string `json:"label"` // value // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Value *string `json:"value"` } @@ -463,7 +463,7 @@ var rearPortTemplateTypeTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/APC","LSH","LSH/APC","MPO","MTRJ","SC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8P8C","8P6C","8P4C","8P2C","6P6C","6P4C","6P2C","4P4C","4P2C","GG45","TERA 4P","TERA 2P","TERA 1P","110 Punch","BNC","F Connector","N Connector","MRJ21","FC","LC","LC/PC","LC/UPC","LC/APC","LSH","LSH/PC","LSH/UPC","LSH/APC","MPO","MTRJ","SC","SC/PC","SC/UPC","SC/APC","ST","CS","SN","SMA 905","SMA 906","URM-P2","URM-P4","URM-P8","Splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -533,12 +533,24 @@ const ( // RearPortTemplateTypeLabelLC captures enum value "LC" RearPortTemplateTypeLabelLC string = "LC" + // RearPortTemplateTypeLabelLCPC captures enum value "LC/PC" + RearPortTemplateTypeLabelLCPC string = "LC/PC" + + // RearPortTemplateTypeLabelLCUPC captures enum value "LC/UPC" + RearPortTemplateTypeLabelLCUPC string = "LC/UPC" + // RearPortTemplateTypeLabelLCAPC captures enum value "LC/APC" RearPortTemplateTypeLabelLCAPC string = "LC/APC" // RearPortTemplateTypeLabelLSH captures enum value "LSH" RearPortTemplateTypeLabelLSH string = "LSH" + // RearPortTemplateTypeLabelLSHPC captures enum value "LSH/PC" + RearPortTemplateTypeLabelLSHPC string = "LSH/PC" + + // RearPortTemplateTypeLabelLSHUPC captures enum value "LSH/UPC" + RearPortTemplateTypeLabelLSHUPC string = "LSH/UPC" + // RearPortTemplateTypeLabelLSHAPC captures enum value "LSH/APC" RearPortTemplateTypeLabelLSHAPC string = "LSH/APC" @@ -551,6 +563,12 @@ const ( // RearPortTemplateTypeLabelSC captures enum value "SC" RearPortTemplateTypeLabelSC string = "SC" + // RearPortTemplateTypeLabelSCPC captures enum value "SC/PC" + RearPortTemplateTypeLabelSCPC string = "SC/PC" + + // RearPortTemplateTypeLabelSCUPC captures enum value "SC/UPC" + RearPortTemplateTypeLabelSCUPC string = "SC/UPC" + // RearPortTemplateTypeLabelSCAPC captures enum value "SC/APC" RearPortTemplateTypeLabelSCAPC string = "SC/APC" @@ -608,7 +626,7 @@ var rearPortTemplateTypeTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -678,12 +696,24 @@ const ( // RearPortTemplateTypeValueLc captures enum value "lc" RearPortTemplateTypeValueLc string = "lc" + // RearPortTemplateTypeValueLcDashPc captures enum value "lc-pc" + RearPortTemplateTypeValueLcDashPc string = "lc-pc" + + // RearPortTemplateTypeValueLcDashUpc captures enum value "lc-upc" + RearPortTemplateTypeValueLcDashUpc string = "lc-upc" + // RearPortTemplateTypeValueLcDashApc captures enum value "lc-apc" RearPortTemplateTypeValueLcDashApc string = "lc-apc" // RearPortTemplateTypeValueLsh captures enum value "lsh" RearPortTemplateTypeValueLsh string = "lsh" + // RearPortTemplateTypeValueLshDashPc captures enum value "lsh-pc" + RearPortTemplateTypeValueLshDashPc string = "lsh-pc" + + // RearPortTemplateTypeValueLshDashUpc captures enum value "lsh-upc" + RearPortTemplateTypeValueLshDashUpc string = "lsh-upc" + // RearPortTemplateTypeValueLshDashApc captures enum value "lsh-apc" RearPortTemplateTypeValueLshDashApc string = "lsh-apc" @@ -696,6 +726,12 @@ const ( // RearPortTemplateTypeValueSc captures enum value "sc" RearPortTemplateTypeValueSc string = "sc" + // RearPortTemplateTypeValueScDashPc captures enum value "sc-pc" + RearPortTemplateTypeValueScDashPc string = "sc-pc" + + // RearPortTemplateTypeValueScDashUpc captures enum value "sc-upc" + RearPortTemplateTypeValueScDashUpc string = "sc-upc" + // RearPortTemplateTypeValueScDashApc captures enum value "sc-apc" RearPortTemplateTypeValueScDashApc string = "sc-apc" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/region.go b/vendor/github.com/smutel/go-netbox/netbox/models/region.go index e33106ebc..1db390002 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/region.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/region.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -83,6 +84,9 @@ type Region struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -117,6 +121,10 @@ func (m *Region) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -220,6 +228,32 @@ func (m *Region) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Region) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Region) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -264,6 +298,10 @@ func (m *Region) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -344,6 +382,26 @@ func (m *Region) contextValidateSiteCount(ctx context.Context, formats strfmt.Re return nil } +func (m *Region) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Region) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/role.go b/vendor/github.com/smutel/go-netbox/netbox/models/role.go index 6acfdeaf8..67ff5f404 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/role.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/role.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -76,6 +77,9 @@ type Role struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -115,6 +119,10 @@ func (m *Role) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -203,6 +211,32 @@ func (m *Role) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Role) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Role) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -255,6 +289,10 @@ func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) err res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -314,6 +352,26 @@ func (m *Role) contextValidatePrefixCount(ctx context.Context, formats strfmt.Re return nil } +func (m *Role) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Role) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/service.go b/vendor/github.com/smutel/go-netbox/netbox/models/service.go index 417de0877..8b1c51631 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/service.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/service.go @@ -554,12 +554,12 @@ type ServiceProtocol struct { // label // Required: true - // Enum: [TCP UDP] + // Enum: [TCP UDP SCTP] Label *string `json:"label"` // value // Required: true - // Enum: [tcp udp] + // Enum: [tcp udp sctp] Value *string `json:"value"` } @@ -585,7 +585,7 @@ var serviceProtocolTypeLabelPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["TCP","UDP"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["TCP","UDP","SCTP"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -600,6 +600,9 @@ const ( // ServiceProtocolLabelUDP captures enum value "UDP" ServiceProtocolLabelUDP string = "UDP" + + // ServiceProtocolLabelSCTP captures enum value "SCTP" + ServiceProtocolLabelSCTP string = "SCTP" ) // prop value enum @@ -628,7 +631,7 @@ var serviceProtocolTypeValuePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["tcp","udp"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["tcp","udp","sctp"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -643,6 +646,9 @@ const ( // ServiceProtocolValueUDP captures enum value "udp" ServiceProtocolValueUDP string = "udp" + + // ServiceProtocolValueSctp captures enum value "sctp" + ServiceProtocolValueSctp string = "sctp" ) // prop value enum diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/site.go b/vendor/github.com/smutel/go-netbox/netbox/models/site.go index 208627c28..a821ee18f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/site.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/site.go @@ -43,6 +43,10 @@ type Site struct { // Minimum: 1 Asn *int64 `json:"asn,omitempty"` + // asns + // Unique: true + Asns []*NestedASN `json:"asns"` + // Circuit count // Read Only: true CircuitCount int64 `json:"circuit_count,omitempty"` @@ -177,6 +181,10 @@ func (m *Site) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateAsns(formats); err != nil { + res = append(res, err) + } + if err := m.validateContactEmail(formats); err != nil { res = append(res, err) } @@ -267,6 +275,36 @@ func (m *Site) validateAsn(formats strfmt.Registry) error { return nil } +func (m *Site) validateAsns(formats strfmt.Registry) error { + if swag.IsZero(m.Asns) { // not required + return nil + } + + if err := validate.UniqueItems("asns", "body", m.Asns); err != nil { + return err + } + + for i := 0; i < len(m.Asns); i++ { + if swag.IsZero(m.Asns[i]) { // not required + continue + } + + if m.Asns[i] != nil { + if err := m.Asns[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("asns" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("asns" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Site) validateContactEmail(formats strfmt.Registry) error { if swag.IsZero(m.ContactEmail) { // not required return nil @@ -535,6 +573,10 @@ func (m *Site) validateURL(formats strfmt.Registry) error { func (m *Site) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateAsns(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCircuitCount(ctx, formats); err != nil { res = append(res, err) } @@ -605,6 +647,26 @@ func (m *Site) ContextValidate(ctx context.Context, formats strfmt.Registry) err return nil } +func (m *Site) contextValidateAsns(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Asns); i++ { + + if m.Asns[i] != nil { + if err := m.Asns[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("asns" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("asns" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *Site) contextValidateCircuitCount(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "circuit_count", "body", int64(m.CircuitCount)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/site_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/site_group.go index 023b9f42d..ad59c58e3 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/site_group.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/site_group.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -83,6 +84,9 @@ type SiteGroup struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -117,6 +121,10 @@ func (m *SiteGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -220,6 +228,32 @@ func (m *SiteGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *SiteGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *SiteGroup) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -264,6 +298,10 @@ func (m *SiteGroup) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -344,6 +382,26 @@ func (m *SiteGroup) contextValidateSiteCount(ctx context.Context, formats strfmt return nil } +func (m *SiteGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *SiteGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/tag.go b/vendor/github.com/smutel/go-netbox/netbox/models/tag.go index f56dd7387..8c598dbbd 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/tag.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/tag.go @@ -40,6 +40,11 @@ type Tag struct { // Pattern: ^[0-9a-f]{6}$ Color string `json:"color,omitempty"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Description // Max Length: 200 Description string `json:"description,omitempty"` @@ -52,6 +57,11 @@ type Tag struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Name // Required: true // Max Length: 100 @@ -83,10 +93,18 @@ func (m *Tag) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -125,6 +143,18 @@ func (m *Tag) validateColor(formats strfmt.Registry) error { return nil } +func (m *Tag) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Tag) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required return nil @@ -137,6 +167,18 @@ func (m *Tag) validateDescription(formats strfmt.Registry) error { return nil } +func (m *Tag) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Tag) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -191,6 +233,10 @@ func (m *Tag) validateURL(formats strfmt.Registry) error { func (m *Tag) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -199,6 +245,10 @@ func (m *Tag) ContextValidate(ctx context.Context, formats strfmt.Registry) erro res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTaggedItems(ctx, formats); err != nil { res = append(res, err) } @@ -213,6 +263,15 @@ func (m *Tag) ContextValidate(ctx context.Context, formats strfmt.Registry) erro return nil } +func (m *Tag) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *Tag) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -231,6 +290,15 @@ func (m *Tag) contextValidateID(ctx context.Context, formats strfmt.Registry) er return nil } +func (m *Tag) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *Tag) contextValidateTaggedItems(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "tagged_items", "body", int64(m.TaggedItems)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/tenant_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/tenant_group.go index 5aa641a82..3c6a75e73 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/tenant_group.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/tenant_group.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -79,6 +80,9 @@ type TenantGroup struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Tenant count // Read Only: true TenantCount int64 `json:"tenant_count,omitempty"` @@ -117,6 +121,10 @@ func (m *TenantGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -220,6 +228,32 @@ func (m *TenantGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *TenantGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *TenantGroup) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -260,6 +294,10 @@ func (m *TenantGroup) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTenantCount(ctx, formats); err != nil { res = append(res, err) } @@ -335,6 +373,26 @@ func (m *TenantGroup) contextValidateParent(ctx context.Context, formats strfmt. return nil } +func (m *TenantGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *TenantGroup) contextValidateTenantCount(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "tenant_count", "body", int64(m.TenantCount)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/v_l_a_n_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/v_l_a_n_group.go index 7715b0ee2..301748e06 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/v_l_a_n_group.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/v_l_a_n_group.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -70,7 +71,6 @@ type VLANGroup struct { Scope string `json:"scope,omitempty"` // Scope id - // Minimum: 0 ScopeID *int64 `json:"scope_id,omitempty"` // Scope type @@ -83,6 +83,9 @@ type VLANGroup struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -113,11 +116,11 @@ func (m *VLANGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateScopeID(formats); err != nil { + if err := m.validateSlug(formats); err != nil { res = append(res, err) } - if err := m.validateSlug(formats); err != nil { + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -184,18 +187,6 @@ func (m *VLANGroup) validateName(formats strfmt.Registry) error { return nil } -func (m *VLANGroup) validateScopeID(formats strfmt.Registry) error { - if swag.IsZero(m.ScopeID) { // not required - return nil - } - - if err := validate.MinimumInt("scope_id", "body", *m.ScopeID, 0, false); err != nil { - return err - } - - return nil -} - func (m *VLANGroup) validateSlug(formats strfmt.Registry) error { if err := validate.Required("slug", "body", m.Slug); err != nil { @@ -217,6 +208,32 @@ func (m *VLANGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *VLANGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *VLANGroup) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -253,6 +270,10 @@ func (m *VLANGroup) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -312,6 +333,26 @@ func (m *VLANGroup) contextValidateScope(ctx context.Context, formats strfmt.Reg return nil } +func (m *VLANGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *VLANGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/virtual_chassis.go b/vendor/github.com/smutel/go-netbox/netbox/models/virtual_chassis.go index 0c685e51c..c5ff5b848 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/virtual_chassis.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/virtual_chassis.go @@ -35,6 +35,11 @@ import ( // swagger:model VirtualChassis type VirtualChassis struct { + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -50,6 +55,11 @@ type VirtualChassis struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // master Master *NestedDevice `json:"master,omitempty"` @@ -76,10 +86,18 @@ type VirtualChassis struct { func (m *VirtualChassis) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDomain(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateMaster(formats); err != nil { res = append(res, err) } @@ -102,6 +120,18 @@ func (m *VirtualChassis) Validate(formats strfmt.Registry) error { return nil } +func (m *VirtualChassis) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *VirtualChassis) validateDomain(formats strfmt.Registry) error { if swag.IsZero(m.Domain) { // not required return nil @@ -114,6 +144,18 @@ func (m *VirtualChassis) validateDomain(formats strfmt.Registry) error { return nil } +func (m *VirtualChassis) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *VirtualChassis) validateMaster(formats strfmt.Registry) error { if swag.IsZero(m.Master) { // not required return nil @@ -192,6 +234,10 @@ func (m *VirtualChassis) validateURL(formats strfmt.Registry) error { func (m *VirtualChassis) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -200,6 +246,10 @@ func (m *VirtualChassis) ContextValidate(ctx context.Context, formats strfmt.Reg res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateMaster(ctx, formats); err != nil { res = append(res, err) } @@ -222,6 +272,15 @@ func (m *VirtualChassis) ContextValidate(ctx context.Context, formats strfmt.Reg return nil } +func (m *VirtualChassis) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *VirtualChassis) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -240,6 +299,15 @@ func (m *VirtualChassis) contextValidateID(ctx context.Context, formats strfmt.R return nil } +func (m *VirtualChassis) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *VirtualChassis) contextValidateMaster(ctx context.Context, formats strfmt.Registry) error { if m.Master != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/vm_interface.go b/vendor/github.com/smutel/go-netbox/netbox/models/vm_interface.go index 12cf99b3c..80d6e4dc8 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/vm_interface.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/vm_interface.go @@ -36,6 +36,13 @@ import ( // swagger:model VMInterface type VMInterface struct { + // bridge + Bridge *NestedVMInterface `json:"bridge,omitempty"` + + // Count fhrp groups + // Read Only: true + CountFhrpGroups int64 `json:"count_fhrp_groups,omitempty"` + // Count ipaddresses // Read Only: true CountIpaddresses int64 `json:"count_ipaddresses,omitempty"` @@ -112,6 +119,10 @@ type VMInterface struct { func (m *VMInterface) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateBridge(formats); err != nil { + res = append(res, err) + } + if err := m.validateCreated(formats); err != nil { res = append(res, err) } @@ -166,6 +177,25 @@ func (m *VMInterface) Validate(formats strfmt.Registry) error { return nil } +func (m *VMInterface) validateBridge(formats strfmt.Registry) error { + if swag.IsZero(m.Bridge) { // not required + return nil + } + + if m.Bridge != nil { + if err := m.Bridge.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bridge") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bridge") + } + return err + } + } + + return nil +} + func (m *VMInterface) validateCreated(formats strfmt.Registry) error { if swag.IsZero(m.Created) { // not required return nil @@ -384,6 +414,14 @@ func (m *VMInterface) validateVirtualMachine(formats strfmt.Registry) error { func (m *VMInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateBridge(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCountFhrpGroups(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCountIpaddresses(ctx, formats); err != nil { res = append(res, err) } @@ -438,6 +476,31 @@ func (m *VMInterface) ContextValidate(ctx context.Context, formats strfmt.Regist return nil } +func (m *VMInterface) contextValidateBridge(ctx context.Context, formats strfmt.Registry) error { + + if m.Bridge != nil { + if err := m.Bridge.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bridge") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bridge") + } + return err + } + } + + return nil +} + +func (m *VMInterface) contextValidateCountFhrpGroups(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "count_fhrp_groups", "body", int64(m.CountFhrpGroups)); err != nil { + return err + } + + return nil +} + func (m *VMInterface) contextValidateCountIpaddresses(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "count_ipaddresses", "body", int64(m.CountIpaddresses)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/webhook.go b/vendor/github.com/smutel/go-netbox/netbox/models/webhook.go index ddee5e46a..020c158d6 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/webhook.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/webhook.go @@ -51,11 +51,21 @@ type Webhook struct { // Max Length: 4096 CaFilePath *string `json:"ca_file_path,omitempty"` + // Conditions + // + // A set of conditions which determine whether the webhook will be generated. + Conditions *string `json:"conditions,omitempty"` + // content types // Required: true // Unique: true ContentTypes []string `json:"content_types"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Display // Read Only: true Display string `json:"display,omitempty"` @@ -78,6 +88,11 @@ type Webhook struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Name // Required: true // Max Length: 150 @@ -136,6 +151,10 @@ func (m *Webhook) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateHTTPContentType(formats); err != nil { res = append(res, err) } @@ -144,6 +163,10 @@ func (m *Webhook) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -191,6 +214,18 @@ func (m *Webhook) validateContentTypes(formats strfmt.Registry) error { return nil } +func (m *Webhook) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Webhook) validateHTTPContentType(formats strfmt.Registry) error { if swag.IsZero(m.HTTPContentType) { // not required return nil @@ -258,6 +293,18 @@ func (m *Webhook) validateHTTPMethod(formats strfmt.Registry) error { return nil } +func (m *Webhook) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Webhook) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -320,6 +367,10 @@ func (m *Webhook) validateURL(formats strfmt.Registry) error { func (m *Webhook) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -328,6 +379,10 @@ func (m *Webhook) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -338,6 +393,15 @@ func (m *Webhook) ContextValidate(ctx context.Context, formats strfmt.Registry) return nil } +func (m *Webhook) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *Webhook) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -356,6 +420,15 @@ func (m *Webhook) contextValidateID(ctx context.Context, formats strfmt.Registry return nil } +func (m *Webhook) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *Webhook) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n.go b/vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n.go new file mode 100644 index 000000000..4bc29b5a1 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n.go @@ -0,0 +1,827 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WirelessLAN wireless l a n +// +// swagger:model WirelessLAN +type WirelessLAN struct { + + // auth cipher + AuthCipher *WirelessLANAuthCipher `json:"auth_cipher,omitempty"` + + // Pre-shared key + // Max Length: 64 + AuthPsk string `json:"auth_psk,omitempty"` + + // auth type + AuthType *WirelessLANAuthType `json:"auth_type,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // group + Group *NestedWirelessLANGroup `json:"group,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // SSID + // Required: true + // Max Length: 32 + // Min Length: 1 + Ssid *string `json:"ssid"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` + + // vlan + Vlan *NestedVLAN `json:"vlan,omitempty"` +} + +// Validate validates this wireless l a n +func (m *WirelessLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthCipher(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthPsk(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSsid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVlan(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WirelessLAN) validateAuthCipher(formats strfmt.Registry) error { + if swag.IsZero(m.AuthCipher) { // not required + return nil + } + + if m.AuthCipher != nil { + if err := m.AuthCipher.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_cipher") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_cipher") + } + return err + } + } + + return nil +} + +func (m *WirelessLAN) validateAuthPsk(formats strfmt.Registry) error { + if swag.IsZero(m.AuthPsk) { // not required + return nil + } + + if err := validate.MaxLength("auth_psk", "body", m.AuthPsk, 64); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) validateAuthType(formats strfmt.Registry) error { + if swag.IsZero(m.AuthType) { // not required + return nil + } + + if m.AuthType != nil { + if err := m.AuthType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_type") + } + return err + } + } + + return nil +} + +func (m *WirelessLAN) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) validateGroup(formats strfmt.Registry) error { + if swag.IsZero(m.Group) { // not required + return nil + } + + if m.Group != nil { + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *WirelessLAN) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) validateSsid(formats strfmt.Registry) error { + + if err := validate.Required("ssid", "body", m.Ssid); err != nil { + return err + } + + if err := validate.MinLength("ssid", "body", *m.Ssid, 1); err != nil { + return err + } + + if err := validate.MaxLength("ssid", "body", *m.Ssid, 32); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WirelessLAN) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) validateVlan(formats strfmt.Registry) error { + if swag.IsZero(m.Vlan) { // not required + return nil + } + + if m.Vlan != nil { + if err := m.Vlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vlan") + } + return err + } + } + + return nil +} + +// ContextValidate validate this wireless l a n based on the context it is used +func (m *WirelessLAN) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthCipher(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAuthType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGroup(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVlan(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WirelessLAN) contextValidateAuthCipher(ctx context.Context, formats strfmt.Registry) error { + + if m.AuthCipher != nil { + if err := m.AuthCipher.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_cipher") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_cipher") + } + return err + } + } + + return nil +} + +func (m *WirelessLAN) contextValidateAuthType(ctx context.Context, formats strfmt.Registry) error { + + if m.AuthType != nil { + if err := m.AuthType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_type") + } + return err + } + } + + return nil +} + +func (m *WirelessLAN) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) contextValidateGroup(ctx context.Context, formats strfmt.Registry) error { + + if m.Group != nil { + if err := m.Group.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *WirelessLAN) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WirelessLAN) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLAN) contextValidateVlan(ctx context.Context, formats strfmt.Registry) error { + + if m.Vlan != nil { + if err := m.Vlan.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("vlan") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLAN) UnmarshalBinary(b []byte) error { + var res WirelessLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// WirelessLANAuthCipher Auth cipher +// +// swagger:model WirelessLANAuthCipher +type WirelessLANAuthCipher struct { + + // label + // Required: true + // Enum: [Auto TKIP AES] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [auto tkip aes] + Value *string `json:"value"` +} + +// Validate validates this wireless l a n auth cipher +func (m *WirelessLANAuthCipher) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var wirelessLANAuthCipherTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Auto","TKIP","AES"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLANAuthCipherTypeLabelPropEnum = append(wirelessLANAuthCipherTypeLabelPropEnum, v) + } +} + +const ( + + // WirelessLANAuthCipherLabelAuto captures enum value "Auto" + WirelessLANAuthCipherLabelAuto string = "Auto" + + // WirelessLANAuthCipherLabelTKIP captures enum value "TKIP" + WirelessLANAuthCipherLabelTKIP string = "TKIP" + + // WirelessLANAuthCipherLabelAES captures enum value "AES" + WirelessLANAuthCipherLabelAES string = "AES" +) + +// prop value enum +func (m *WirelessLANAuthCipher) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLANAuthCipherTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLANAuthCipher) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("auth_cipher"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("auth_cipher"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var wirelessLANAuthCipherTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["auto","tkip","aes"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLANAuthCipherTypeValuePropEnum = append(wirelessLANAuthCipherTypeValuePropEnum, v) + } +} + +const ( + + // WirelessLANAuthCipherValueAuto captures enum value "auto" + WirelessLANAuthCipherValueAuto string = "auto" + + // WirelessLANAuthCipherValueTkip captures enum value "tkip" + WirelessLANAuthCipherValueTkip string = "tkip" + + // WirelessLANAuthCipherValueAes captures enum value "aes" + WirelessLANAuthCipherValueAes string = "aes" +) + +// prop value enum +func (m *WirelessLANAuthCipher) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLANAuthCipherTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLANAuthCipher) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("auth_cipher"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("auth_cipher"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this wireless l a n auth cipher based on context it is used +func (m *WirelessLANAuthCipher) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLANAuthCipher) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLANAuthCipher) UnmarshalBinary(b []byte) error { + var res WirelessLANAuthCipher + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// WirelessLANAuthType Auth type +// +// swagger:model WirelessLANAuthType +type WirelessLANAuthType struct { + + // label + // Required: true + // Enum: [Open WEP WPA Personal (PSK) WPA Enterprise] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [open wep wpa-personal wpa-enterprise] + Value *string `json:"value"` +} + +// Validate validates this wireless l a n auth type +func (m *WirelessLANAuthType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var wirelessLANAuthTypeTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Open","WEP","WPA Personal (PSK)","WPA Enterprise"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLANAuthTypeTypeLabelPropEnum = append(wirelessLANAuthTypeTypeLabelPropEnum, v) + } +} + +const ( + + // WirelessLANAuthTypeLabelOpen captures enum value "Open" + WirelessLANAuthTypeLabelOpen string = "Open" + + // WirelessLANAuthTypeLabelWEP captures enum value "WEP" + WirelessLANAuthTypeLabelWEP string = "WEP" + + // WirelessLANAuthTypeLabelWPAPersonalPSK captures enum value "WPA Personal (PSK)" + WirelessLANAuthTypeLabelWPAPersonalPSK string = "WPA Personal (PSK)" + + // WirelessLANAuthTypeLabelWPAEnterprise captures enum value "WPA Enterprise" + WirelessLANAuthTypeLabelWPAEnterprise string = "WPA Enterprise" +) + +// prop value enum +func (m *WirelessLANAuthType) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLANAuthTypeTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLANAuthType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("auth_type"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("auth_type"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var wirelessLANAuthTypeTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["open","wep","wpa-personal","wpa-enterprise"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLANAuthTypeTypeValuePropEnum = append(wirelessLANAuthTypeTypeValuePropEnum, v) + } +} + +const ( + + // WirelessLANAuthTypeValueOpen captures enum value "open" + WirelessLANAuthTypeValueOpen string = "open" + + // WirelessLANAuthTypeValueWep captures enum value "wep" + WirelessLANAuthTypeValueWep string = "wep" + + // WirelessLANAuthTypeValueWpaDashPersonal captures enum value "wpa-personal" + WirelessLANAuthTypeValueWpaDashPersonal string = "wpa-personal" + + // WirelessLANAuthTypeValueWpaDashEnterprise captures enum value "wpa-enterprise" + WirelessLANAuthTypeValueWpaDashEnterprise string = "wpa-enterprise" +) + +// prop value enum +func (m *WirelessLANAuthType) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLANAuthTypeTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLANAuthType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("auth_type"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("auth_type"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this wireless l a n auth type based on context it is used +func (m *WirelessLANAuthType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLANAuthType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLANAuthType) UnmarshalBinary(b []byte) error { + var res WirelessLANAuthType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n_group.go new file mode 100644 index 000000000..b5b20f363 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/wireless_l_a_n_group.go @@ -0,0 +1,430 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WirelessLANGroup wireless l a n group +// +// swagger:model WirelessLANGroup +type WirelessLANGroup struct { + + // depth + // Read Only: true + Depth int64 `json:"_depth,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // parent + Parent *NestedWirelessLANGroup `json:"parent,omitempty"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` + + // Wirelesslan count + // Read Only: true + WirelesslanCount int64 `json:"wirelesslan_count,omitempty"` +} + +// Validate validates this wireless l a n group +func (m *WirelessLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WirelessLANGroup) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) validateParent(formats strfmt.Registry) error { + if swag.IsZero(m.Parent) { // not required + return nil + } + + if m.Parent != nil { + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *WirelessLANGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WirelessLANGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this wireless l a n group based on the context it is used +func (m *WirelessLANGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParent(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWirelesslanCount(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WirelessLANGroup) contextValidateDepth(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "_depth", "body", int64(m.Depth)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateParent(ctx context.Context, formats strfmt.Registry) error { + + if m.Parent != nil { + if err := m.Parent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLANGroup) contextValidateWirelesslanCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "wirelesslan_count", "body", int64(m.WirelesslanCount)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLANGroup) UnmarshalBinary(b []byte) error { + var res WirelessLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/wireless_link.go b/vendor/github.com/smutel/go-netbox/netbox/models/wireless_link.go new file mode 100644 index 000000000..1c865080a --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/wireless_link.go @@ -0,0 +1,1019 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WirelessLink wireless link +// +// swagger:model WirelessLink +type WirelessLink struct { + + // auth cipher + AuthCipher *WirelessLinkAuthCipher `json:"auth_cipher,omitempty"` + + // Pre-shared key + // Max Length: 64 + AuthPsk string `json:"auth_psk,omitempty"` + + // auth type + AuthType *WirelessLinkAuthType `json:"auth_type,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // interface a + // Required: true + Interfacea *NestedInterface `json:"interface_a"` + + // interface b + // Required: true + Interfaceb *NestedInterface `json:"interface_b"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // SSID + // Max Length: 32 + Ssid string `json:"ssid,omitempty"` + + // status + Status *WirelessLinkStatus `json:"status,omitempty"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this wireless link +func (m *WirelessLink) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthCipher(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthPsk(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfacea(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfaceb(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSsid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WirelessLink) validateAuthCipher(formats strfmt.Registry) error { + if swag.IsZero(m.AuthCipher) { // not required + return nil + } + + if m.AuthCipher != nil { + if err := m.AuthCipher.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_cipher") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_cipher") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) validateAuthPsk(formats strfmt.Registry) error { + if swag.IsZero(m.AuthPsk) { // not required + return nil + } + + if err := validate.MaxLength("auth_psk", "body", m.AuthPsk, 64); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) validateAuthType(formats strfmt.Registry) error { + if swag.IsZero(m.AuthType) { // not required + return nil + } + + if m.AuthType != nil { + if err := m.AuthType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_type") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) validateInterfacea(formats strfmt.Registry) error { + + if err := validate.Required("interface_a", "body", m.Interfacea); err != nil { + return err + } + + if m.Interfacea != nil { + if err := m.Interfacea.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_a") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("interface_a") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) validateInterfaceb(formats strfmt.Registry) error { + + if err := validate.Required("interface_b", "body", m.Interfaceb); err != nil { + return err + } + + if m.Interfaceb != nil { + if err := m.Interfaceb.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_b") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("interface_b") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) validateSsid(formats strfmt.Registry) error { + if swag.IsZero(m.Ssid) { // not required + return nil + } + + if err := validate.MaxLength("ssid", "body", m.Ssid, 32); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WirelessLink) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this wireless link based on the context it is used +func (m *WirelessLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAuthCipher(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAuthType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInterfacea(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInterfaceb(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WirelessLink) contextValidateAuthCipher(ctx context.Context, formats strfmt.Registry) error { + + if m.AuthCipher != nil { + if err := m.AuthCipher.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_cipher") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_cipher") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) contextValidateAuthType(ctx context.Context, formats strfmt.Registry) error { + + if m.AuthType != nil { + if err := m.AuthType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("auth_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("auth_type") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) contextValidateInterfacea(ctx context.Context, formats strfmt.Registry) error { + + if m.Interfacea != nil { + if err := m.Interfacea.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_a") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("interface_a") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) contextValidateInterfaceb(ctx context.Context, formats strfmt.Registry) error { + + if m.Interfaceb != nil { + if err := m.Interfaceb.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_b") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("interface_b") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WirelessLink) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WirelessLink) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WirelessLink) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLink) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLink) UnmarshalBinary(b []byte) error { + var res WirelessLink + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// WirelessLinkAuthCipher Auth cipher +// +// swagger:model WirelessLinkAuthCipher +type WirelessLinkAuthCipher struct { + + // label + // Required: true + // Enum: [Auto TKIP AES] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [auto tkip aes] + Value *string `json:"value"` +} + +// Validate validates this wireless link auth cipher +func (m *WirelessLinkAuthCipher) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var wirelessLinkAuthCipherTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Auto","TKIP","AES"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLinkAuthCipherTypeLabelPropEnum = append(wirelessLinkAuthCipherTypeLabelPropEnum, v) + } +} + +const ( + + // WirelessLinkAuthCipherLabelAuto captures enum value "Auto" + WirelessLinkAuthCipherLabelAuto string = "Auto" + + // WirelessLinkAuthCipherLabelTKIP captures enum value "TKIP" + WirelessLinkAuthCipherLabelTKIP string = "TKIP" + + // WirelessLinkAuthCipherLabelAES captures enum value "AES" + WirelessLinkAuthCipherLabelAES string = "AES" +) + +// prop value enum +func (m *WirelessLinkAuthCipher) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLinkAuthCipherTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLinkAuthCipher) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("auth_cipher"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("auth_cipher"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var wirelessLinkAuthCipherTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["auto","tkip","aes"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLinkAuthCipherTypeValuePropEnum = append(wirelessLinkAuthCipherTypeValuePropEnum, v) + } +} + +const ( + + // WirelessLinkAuthCipherValueAuto captures enum value "auto" + WirelessLinkAuthCipherValueAuto string = "auto" + + // WirelessLinkAuthCipherValueTkip captures enum value "tkip" + WirelessLinkAuthCipherValueTkip string = "tkip" + + // WirelessLinkAuthCipherValueAes captures enum value "aes" + WirelessLinkAuthCipherValueAes string = "aes" +) + +// prop value enum +func (m *WirelessLinkAuthCipher) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLinkAuthCipherTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLinkAuthCipher) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("auth_cipher"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("auth_cipher"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this wireless link auth cipher based on context it is used +func (m *WirelessLinkAuthCipher) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLinkAuthCipher) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLinkAuthCipher) UnmarshalBinary(b []byte) error { + var res WirelessLinkAuthCipher + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// WirelessLinkAuthType Auth type +// +// swagger:model WirelessLinkAuthType +type WirelessLinkAuthType struct { + + // label + // Required: true + // Enum: [Open WEP WPA Personal (PSK) WPA Enterprise] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [open wep wpa-personal wpa-enterprise] + Value *string `json:"value"` +} + +// Validate validates this wireless link auth type +func (m *WirelessLinkAuthType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var wirelessLinkAuthTypeTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Open","WEP","WPA Personal (PSK)","WPA Enterprise"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLinkAuthTypeTypeLabelPropEnum = append(wirelessLinkAuthTypeTypeLabelPropEnum, v) + } +} + +const ( + + // WirelessLinkAuthTypeLabelOpen captures enum value "Open" + WirelessLinkAuthTypeLabelOpen string = "Open" + + // WirelessLinkAuthTypeLabelWEP captures enum value "WEP" + WirelessLinkAuthTypeLabelWEP string = "WEP" + + // WirelessLinkAuthTypeLabelWPAPersonalPSK captures enum value "WPA Personal (PSK)" + WirelessLinkAuthTypeLabelWPAPersonalPSK string = "WPA Personal (PSK)" + + // WirelessLinkAuthTypeLabelWPAEnterprise captures enum value "WPA Enterprise" + WirelessLinkAuthTypeLabelWPAEnterprise string = "WPA Enterprise" +) + +// prop value enum +func (m *WirelessLinkAuthType) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLinkAuthTypeTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLinkAuthType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("auth_type"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("auth_type"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var wirelessLinkAuthTypeTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["open","wep","wpa-personal","wpa-enterprise"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLinkAuthTypeTypeValuePropEnum = append(wirelessLinkAuthTypeTypeValuePropEnum, v) + } +} + +const ( + + // WirelessLinkAuthTypeValueOpen captures enum value "open" + WirelessLinkAuthTypeValueOpen string = "open" + + // WirelessLinkAuthTypeValueWep captures enum value "wep" + WirelessLinkAuthTypeValueWep string = "wep" + + // WirelessLinkAuthTypeValueWpaDashPersonal captures enum value "wpa-personal" + WirelessLinkAuthTypeValueWpaDashPersonal string = "wpa-personal" + + // WirelessLinkAuthTypeValueWpaDashEnterprise captures enum value "wpa-enterprise" + WirelessLinkAuthTypeValueWpaDashEnterprise string = "wpa-enterprise" +) + +// prop value enum +func (m *WirelessLinkAuthType) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLinkAuthTypeTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLinkAuthType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("auth_type"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("auth_type"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this wireless link auth type based on context it is used +func (m *WirelessLinkAuthType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLinkAuthType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLinkAuthType) UnmarshalBinary(b []byte) error { + var res WirelessLinkAuthType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// WirelessLinkStatus Status +// +// swagger:model WirelessLinkStatus +type WirelessLinkStatus struct { + + // label + // Required: true + // Enum: [Connected Planned Decommissioning] + Label *string `json:"label"` + + // value + // Required: true + // Enum: [connected planned decommissioning] + Value *string `json:"value"` +} + +// Validate validates this wireless link status +func (m *WirelessLinkStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var wirelessLinkStatusTypeLabelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Connected","Planned","Decommissioning"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLinkStatusTypeLabelPropEnum = append(wirelessLinkStatusTypeLabelPropEnum, v) + } +} + +const ( + + // WirelessLinkStatusLabelConnected captures enum value "Connected" + WirelessLinkStatusLabelConnected string = "Connected" + + // WirelessLinkStatusLabelPlanned captures enum value "Planned" + WirelessLinkStatusLabelPlanned string = "Planned" + + // WirelessLinkStatusLabelDecommissioning captures enum value "Decommissioning" + WirelessLinkStatusLabelDecommissioning string = "Decommissioning" +) + +// prop value enum +func (m *WirelessLinkStatus) validateLabelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLinkStatusTypeLabelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLinkStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + // value enum + if err := m.validateLabelEnum("status"+"."+"label", "body", *m.Label); err != nil { + return err + } + + return nil +} + +var wirelessLinkStatusTypeValuePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["connected","planned","decommissioning"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + wirelessLinkStatusTypeValuePropEnum = append(wirelessLinkStatusTypeValuePropEnum, v) + } +} + +const ( + + // WirelessLinkStatusValueConnected captures enum value "connected" + WirelessLinkStatusValueConnected string = "connected" + + // WirelessLinkStatusValuePlanned captures enum value "planned" + WirelessLinkStatusValuePlanned string = "planned" + + // WirelessLinkStatusValueDecommissioning captures enum value "decommissioning" + WirelessLinkStatusValueDecommissioning string = "decommissioning" +) + +// prop value enum +func (m *WirelessLinkStatus) validateValueEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, wirelessLinkStatusTypeValuePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WirelessLinkStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + // value enum + if err := m.validateValueEnum("status"+"."+"value", "body", *m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this wireless link status based on context it is used +func (m *WirelessLinkStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WirelessLinkStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WirelessLinkStatus) UnmarshalBinary(b []byte) error { + var res WirelessLinkStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_a_s_n.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_a_s_n.go new file mode 100644 index 000000000..95364a8be --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_a_s_n.go @@ -0,0 +1,357 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableASN writable a s n +// +// swagger:model WritableASN +type WritableASN struct { + + // ASN + // + // 32-bit autonomous system number + // Required: true + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn *int64 `json:"asn"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // RIR + // Required: true + Rir *int64 `json:"rir"` + + // Site count + // Read Only: true + SiteCount int64 `json:"site_count,omitempty"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Tenant + Tenant *int64 `json:"tenant,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this writable a s n +func (m *WritableASN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAsn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRir(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableASN) validateAsn(formats strfmt.Registry) error { + + if err := validate.Required("asn", "body", m.Asn); err != nil { + return err + } + + if err := validate.MinimumInt("asn", "body", *m.Asn, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", *m.Asn, 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) validateRir(formats strfmt.Registry) error { + + if err := validate.Required("rir", "body", m.Rir); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableASN) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable a s n based on the context it is used +func (m *WritableASN) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSiteCount(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableASN) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) contextValidateSiteCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "site_count", "body", int64(m.SiteCount)); err != nil { + return err + } + + return nil +} + +func (m *WritableASN) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableASN) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableASN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableASN) UnmarshalBinary(b []byte) error { + var res WritableASN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_available_ip.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_available_ip.go new file mode 100644 index 000000000..2d849c294 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_available_ip.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableAvailableIP writable available IP +// +// swagger:model WritableAvailableIP +type WritableAvailableIP struct { + + // Address + // Read Only: true + // Min Length: 1 + Address string `json:"address,omitempty"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` +} + +// Validate validates this writable available IP +func (m *WritableAvailableIP) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableAvailableIP) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := validate.MinLength("address", "body", m.Address, 1); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable available IP based on the context it is used +func (m *WritableAvailableIP) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFamily(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableAvailableIP) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "address", "body", string(m.Address)); err != nil { + return err + } + + return nil +} + +func (m *WritableAvailableIP) contextValidateFamily(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "family", "body", int64(m.Family)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableAvailableIP) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableAvailableIP) UnmarshalBinary(b []byte) error { + var res WritableAvailableIP + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_cable.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_cable.go index 22fbef38c..c4daf5456 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_cable.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_cable.go @@ -41,6 +41,11 @@ type WritableCable struct { // Pattern: ^[0-9a-f]{6}$ Color string `json:"color,omitempty"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -56,6 +61,11 @@ type WritableCable struct { // Max Length: 100 Label string `json:"label,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Length Length *float64 `json:"length,omitempty"` @@ -70,6 +80,9 @@ type WritableCable struct { // tags Tags []*NestedTag `json:"tags"` + // Tenant + Tenant *int64 `json:"tenant,omitempty"` + // Termination a // Read Only: true Terminationa map[string]*string `json:"termination_a,omitempty"` @@ -116,10 +129,18 @@ func (m *WritableCable) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateLabel(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateLengthUnit(formats); err != nil { res = append(res, err) } @@ -178,6 +199,18 @@ func (m *WritableCable) validateColor(formats strfmt.Registry) error { return nil } +func (m *WritableCable) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCable) validateLabel(formats strfmt.Registry) error { if swag.IsZero(m.Label) { // not required return nil @@ -190,6 +223,18 @@ func (m *WritableCable) validateLabel(formats strfmt.Registry) error { return nil } +func (m *WritableCable) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + var writableCableTypeLengthUnitPropEnum []interface{} func init() { @@ -488,6 +533,10 @@ func (m *WritableCable) validateURL(formats strfmt.Registry) error { func (m *WritableCable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -496,6 +545,10 @@ func (m *WritableCable) ContextValidate(ctx context.Context, formats strfmt.Regi res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -518,6 +571,15 @@ func (m *WritableCable) ContextValidate(ctx context.Context, formats strfmt.Regi return nil } +func (m *WritableCable) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *WritableCable) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -536,6 +598,15 @@ func (m *WritableCable) contextValidateID(ctx context.Context, formats strfmt.Re return nil } +func (m *WritableCable) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *WritableCable) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_circuit_termination.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_circuit_termination.go index 938d38cdf..3a955e4c9 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_circuit_termination.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_circuit_termination.go @@ -42,22 +42,15 @@ type WritableCircuitTermination struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Circuit // Required: true Circuit *int64 `json:"circuit"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Description // Max Length: 200 Description string `json:"description,omitempty"` @@ -70,6 +63,23 @@ type WritableCircuitTermination struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -124,10 +134,18 @@ func (m *WritableCircuitTermination) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validatePortSpeed(formats); err != nil { res = append(res, err) } @@ -186,6 +204,18 @@ func (m *WritableCircuitTermination) validateCircuit(formats strfmt.Registry) er return nil } +func (m *WritableCircuitTermination) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCircuitTermination) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required return nil @@ -198,6 +228,18 @@ func (m *WritableCircuitTermination) validateDescription(formats strfmt.Registry return nil } +func (m *WritableCircuitTermination) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCircuitTermination) validatePortSpeed(formats strfmt.Registry) error { if swag.IsZero(m.PortSpeed) { // not required return nil @@ -321,19 +363,27 @@ func (m *WritableCircuitTermination) ContextValidate(ctx context.Context, format res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { + if err := m.contextValidateCreated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDisplay(ctx, formats); err != nil { + if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateID(ctx, formats); err != nil { + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { res = append(res, err) } @@ -372,14 +422,9 @@ func (m *WritableCircuitTermination) contextValidateCable(ctx context.Context, f return nil } -func (m *WritableCircuitTermination) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritableCircuitTermination) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { +func (m *WritableCircuitTermination) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { return err } @@ -404,6 +449,29 @@ func (m *WritableCircuitTermination) contextValidateID(ctx context.Context, form return nil } +func (m *WritableCircuitTermination) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableCircuitTermination) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritableCircuitTermination) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_cluster.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_cluster.go index 0ba5cdd26..2c28d0b21 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_cluster.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_cluster.go @@ -55,7 +55,8 @@ type WritableCluster struct { Display string `json:"display,omitempty"` // Group - Group *int64 `json:"group,omitempty"` + // Required: true + Group *int64 `json:"group"` // Id // Read Only: true @@ -73,7 +74,8 @@ type WritableCluster struct { Name *string `json:"name"` // Site - Site *int64 `json:"site,omitempty"` + // Required: true + Site *int64 `json:"site"` // tags Tags []*NestedTag `json:"tags"` @@ -103,6 +105,10 @@ func (m *WritableCluster) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } @@ -111,6 +117,10 @@ func (m *WritableCluster) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateSite(formats); err != nil { + res = append(res, err) + } + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -141,6 +151,15 @@ func (m *WritableCluster) validateCreated(formats strfmt.Registry) error { return nil } +func (m *WritableCluster) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + return nil +} + func (m *WritableCluster) validateLastUpdated(formats strfmt.Registry) error { if swag.IsZero(m.LastUpdated) { // not required return nil @@ -170,6 +189,15 @@ func (m *WritableCluster) validateName(formats strfmt.Registry) error { return nil } +func (m *WritableCluster) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + func (m *WritableCluster) validateTags(formats strfmt.Registry) error { if swag.IsZero(m.Tags) { // not required return nil diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_port.go index 8b3db2222..c2a4b800e 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_port.go @@ -43,18 +43,6 @@ type WritableConsolePort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -106,6 +94,18 @@ type WritableConsolePort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -449,14 +449,6 @@ func (m *WritableConsolePort) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -485,6 +477,14 @@ func (m *WritableConsolePort) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -524,20 +524,6 @@ func (m *WritableConsolePort) contextValidateCable(ctx context.Context, formats return nil } -func (m *WritableConsolePort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritableConsolePort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *WritableConsolePort) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -597,6 +583,20 @@ func (m *WritableConsolePort) contextValidateLastUpdated(ctx context.Context, fo return nil } +func (m *WritableConsolePort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableConsolePort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritableConsolePort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_server_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_server_port.go index 8b1172000..56965230c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_server_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_console_server_port.go @@ -43,18 +43,6 @@ type WritableConsoleServerPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -106,6 +94,18 @@ type WritableConsoleServerPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -449,14 +449,6 @@ func (m *WritableConsoleServerPort) ContextValidate(ctx context.Context, formats res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -485,6 +477,14 @@ func (m *WritableConsoleServerPort) ContextValidate(ctx context.Context, formats res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -524,20 +524,6 @@ func (m *WritableConsoleServerPort) contextValidateCable(ctx context.Context, fo return nil } -func (m *WritableConsoleServerPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritableConsoleServerPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *WritableConsoleServerPort) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -597,6 +583,20 @@ func (m *WritableConsoleServerPort) contextValidateLastUpdated(ctx context.Conte return nil } +func (m *WritableConsoleServerPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableConsoleServerPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritableConsoleServerPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact.go new file mode 100644 index 000000000..92d9654d0 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact.go @@ -0,0 +1,403 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableContact writable contact +// +// swagger:model WritableContact +type WritableContact struct { + + // Address + // Max Length: 200 + Address string `json:"address,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Email + // Max Length: 254 + // Format: email + Email strfmt.Email `json:"email,omitempty"` + + // Group + // Required: true + Group *int64 `json:"group"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Phone + // Max Length: 50 + Phone string `json:"phone,omitempty"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Title + // Max Length: 100 + Title string `json:"title,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this writable contact +func (m *WritableContact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableContact) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := validate.MaxLength("address", "body", m.Address, 200); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.MaxLength("email", "body", m.Email.String(), 254); err != nil { + return err + } + + if err := validate.FormatOf("email", "body", "email", m.Email.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.MaxLength("phone", "body", m.Phone, 50); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableContact) validateTitle(formats strfmt.Registry) error { + if swag.IsZero(m.Title) { // not required + return nil + } + + if err := validate.MaxLength("title", "body", m.Title, 100); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable contact based on the context it is used +func (m *WritableContact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableContact) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableContact) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableContact) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableContact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableContact) UnmarshalBinary(b []byte) error { + var res WritableContact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_assignment.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_assignment.go new file mode 100644 index 000000000..a1c7f8800 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_assignment.go @@ -0,0 +1,360 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableContactAssignment writable contact assignment +// +// swagger:model WritableContactAssignment +type WritableContactAssignment struct { + + // Contact + // Required: true + Contact *int64 `json:"contact"` + + // Content type + // Required: true + ContentType *string `json:"content_type"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Object + // Read Only: true + Object map[string]*string `json:"object,omitempty"` + + // Object id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + ObjectID *int64 `json:"object_id"` + + // Priority + // Required: true + // Enum: [primary secondary tertiary inactive] + Priority *string `json:"priority"` + + // Role + // Required: true + Role *int64 `json:"role"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this writable contact assignment +func (m *WritableContactAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObjectID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriority(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableContactAssignment) validateContact(formats strfmt.Registry) error { + + if err := validate.Required("contact", "body", m.Contact); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("content_type", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) validateObjectID(formats strfmt.Registry) error { + + if err := validate.Required("object_id", "body", m.ObjectID); err != nil { + return err + } + + if err := validate.MinimumInt("object_id", "body", *m.ObjectID, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("object_id", "body", *m.ObjectID, 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +var writableContactAssignmentTypePriorityPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["primary","secondary","tertiary","inactive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableContactAssignmentTypePriorityPropEnum = append(writableContactAssignmentTypePriorityPropEnum, v) + } +} + +const ( + + // WritableContactAssignmentPriorityPrimary captures enum value "primary" + WritableContactAssignmentPriorityPrimary string = "primary" + + // WritableContactAssignmentPrioritySecondary captures enum value "secondary" + WritableContactAssignmentPrioritySecondary string = "secondary" + + // WritableContactAssignmentPriorityTertiary captures enum value "tertiary" + WritableContactAssignmentPriorityTertiary string = "tertiary" + + // WritableContactAssignmentPriorityInactive captures enum value "inactive" + WritableContactAssignmentPriorityInactive string = "inactive" +) + +// prop value enum +func (m *WritableContactAssignment) validatePriorityEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableContactAssignmentTypePriorityPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableContactAssignment) validatePriority(formats strfmt.Registry) error { + + if err := validate.Required("priority", "body", m.Priority); err != nil { + return err + } + + // value enum + if err := m.validatePriorityEnum("priority", "body", *m.Priority); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable contact assignment based on the context it is used +func (m *WritableContactAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateObject(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableContactAssignment) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactAssignment) contextValidateObject(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableContactAssignment) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableContactAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableContactAssignment) UnmarshalBinary(b []byte) error { + var res WritableContactAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_group.go new file mode 100644 index 000000000..b8748f111 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_contact_group.go @@ -0,0 +1,401 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableContactGroup writable contact group +// +// swagger:model WritableContactGroup +type WritableContactGroup struct { + + // depth + // Read Only: true + Depth int64 `json:"_depth,omitempty"` + + // Contact count + // Read Only: true + ContactCount int64 `json:"contact_count,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Parent + // Required: true + Parent *int64 `json:"parent"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this writable contact group +func (m *WritableContactGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableContactGroup) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableContactGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable contact group based on the context it is used +func (m *WritableContactGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContactCount(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableContactGroup) contextValidateDepth(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "_depth", "body", int64(m.Depth)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) contextValidateContactCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contact_count", "body", int64(m.ContactCount)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableContactGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableContactGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableContactGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableContactGroup) UnmarshalBinary(b []byte) error { + var res WritableContactGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_custom_field.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_custom_field.go index 54fbc0719..b7f1c5d80 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_custom_field.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_custom_field.go @@ -44,6 +44,11 @@ type WritableCustomField struct { // Unique: true ContentTypes []string `json:"content_types"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Default // // Default value for the field (must be a JSON value). Encapsulate strings with double quotes (e.g. "Foo"). @@ -73,12 +78,18 @@ type WritableCustomField struct { // Max Length: 50 Label string `json:"label,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Name // // Internal field name // Required: true // Max Length: 50 // Min Length: 1 + // Pattern: ^[a-z0-9_]+$ Name *string `json:"name"` // Required @@ -87,7 +98,7 @@ type WritableCustomField struct { Required bool `json:"required,omitempty"` // Type - // Enum: [text integer boolean date url select multiselect] + // Enum: [text longtext integer boolean date url json select multiselect] Type string `json:"type,omitempty"` // Url @@ -99,14 +110,14 @@ type WritableCustomField struct { // // Maximum allowed value (for numeric fields) // Maximum: 2.147483647e+09 - // Minimum: 0 + // Minimum: -2.147483648e+09 ValidationMaximum *int64 `json:"validation_maximum,omitempty"` // Minimum value // // Minimum allowed value (for numeric fields) // Maximum: 2.147483647e+09 - // Minimum: 0 + // Minimum: -2.147483648e+09 ValidationMinimum *int64 `json:"validation_minimum,omitempty"` // Validation regex @@ -135,6 +146,10 @@ func (m *WritableCustomField) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { res = append(res, err) } @@ -147,6 +162,10 @@ func (m *WritableCustomField) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -214,6 +233,18 @@ func (m *WritableCustomField) validateContentTypes(formats strfmt.Registry) erro return nil } +func (m *WritableCustomField) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCustomField) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required return nil @@ -283,6 +314,18 @@ func (m *WritableCustomField) validateLabel(formats strfmt.Registry) error { return nil } +func (m *WritableCustomField) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCustomField) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -297,6 +340,10 @@ func (m *WritableCustomField) validateName(formats strfmt.Registry) error { return err } + if err := validate.Pattern("name", "body", *m.Name, `^[a-z0-9_]+$`); err != nil { + return err + } + return nil } @@ -304,7 +351,7 @@ var writableCustomFieldTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["text","integer","boolean","date","url","select","multiselect"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["text","longtext","integer","boolean","date","url","json","select","multiselect"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -317,6 +364,9 @@ const ( // WritableCustomFieldTypeText captures enum value "text" WritableCustomFieldTypeText string = "text" + // WritableCustomFieldTypeLongtext captures enum value "longtext" + WritableCustomFieldTypeLongtext string = "longtext" + // WritableCustomFieldTypeInteger captures enum value "integer" WritableCustomFieldTypeInteger string = "integer" @@ -329,6 +379,9 @@ const ( // WritableCustomFieldTypeURL captures enum value "url" WritableCustomFieldTypeURL string = "url" + // WritableCustomFieldTypeJSON captures enum value "json" + WritableCustomFieldTypeJSON string = "json" + // WritableCustomFieldTypeSelect captures enum value "select" WritableCustomFieldTypeSelect string = "select" @@ -374,7 +427,7 @@ func (m *WritableCustomField) validateValidationMaximum(formats strfmt.Registry) return nil } - if err := validate.MinimumInt("validation_maximum", "body", *m.ValidationMaximum, 0, false); err != nil { + if err := validate.MinimumInt("validation_maximum", "body", *m.ValidationMaximum, -2.147483648e+09, false); err != nil { return err } @@ -390,7 +443,7 @@ func (m *WritableCustomField) validateValidationMinimum(formats strfmt.Registry) return nil } - if err := validate.MinimumInt("validation_minimum", "body", *m.ValidationMinimum, 0, false); err != nil { + if err := validate.MinimumInt("validation_minimum", "body", *m.ValidationMinimum, -2.147483648e+09, false); err != nil { return err } @@ -433,6 +486,10 @@ func (m *WritableCustomField) validateWeight(formats strfmt.Registry) error { func (m *WritableCustomField) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -441,6 +498,10 @@ func (m *WritableCustomField) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -451,6 +512,15 @@ func (m *WritableCustomField) ContextValidate(ctx context.Context, formats strfm return nil } +func (m *WritableCustomField) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *WritableCustomField) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -469,6 +539,15 @@ func (m *WritableCustomField) contextValidateID(ctx context.Context, formats str return nil } +func (m *WritableCustomField) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *WritableCustomField) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_type.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_type.go index 8e1e44791..be5e5fc90 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_type.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_type.go @@ -36,6 +36,10 @@ import ( // swagger:model WritableDeviceType type WritableDeviceType struct { + // Airflow + // Enum: [front-to-rear rear-to-front left-to-right right-to-left side-to-rear passive] + Airflow string `json:"airflow,omitempty"` + // Comments Comments string `json:"comments,omitempty"` @@ -126,6 +130,10 @@ type WritableDeviceType struct { func (m *WritableDeviceType) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAirflow(formats); err != nil { + res = append(res, err) + } + if err := m.validateCreated(formats); err != nil { res = append(res, err) } @@ -180,6 +188,60 @@ func (m *WritableDeviceType) Validate(formats strfmt.Registry) error { return nil } +var writableDeviceTypeTypeAirflowPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["front-to-rear","rear-to-front","left-to-right","right-to-left","side-to-rear","passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeTypeAirflowPropEnum = append(writableDeviceTypeTypeAirflowPropEnum, v) + } +} + +const ( + + // WritableDeviceTypeAirflowFrontDashToDashRear captures enum value "front-to-rear" + WritableDeviceTypeAirflowFrontDashToDashRear string = "front-to-rear" + + // WritableDeviceTypeAirflowRearDashToDashFront captures enum value "rear-to-front" + WritableDeviceTypeAirflowRearDashToDashFront string = "rear-to-front" + + // WritableDeviceTypeAirflowLeftDashToDashRight captures enum value "left-to-right" + WritableDeviceTypeAirflowLeftDashToDashRight string = "left-to-right" + + // WritableDeviceTypeAirflowRightDashToDashLeft captures enum value "right-to-left" + WritableDeviceTypeAirflowRightDashToDashLeft string = "right-to-left" + + // WritableDeviceTypeAirflowSideDashToDashRear captures enum value "side-to-rear" + WritableDeviceTypeAirflowSideDashToDashRear string = "side-to-rear" + + // WritableDeviceTypeAirflowPassive captures enum value "passive" + WritableDeviceTypeAirflowPassive string = "passive" +) + +// prop value enum +func (m *WritableDeviceType) validateAirflowEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableDeviceTypeTypeAirflowPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceType) validateAirflow(formats strfmt.Registry) error { + if swag.IsZero(m.Airflow) { // not required + return nil + } + + // value enum + if err := m.validateAirflowEnum("airflow", "body", m.Airflow); err != nil { + return err + } + + return nil +} + func (m *WritableDeviceType) validateCreated(formats strfmt.Registry) error { if swag.IsZero(m.Created) { // not required return nil diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_with_config_context.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_with_config_context.go index e00ef9141..44c6b1cd6 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_with_config_context.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_device_with_config_context.go @@ -36,6 +36,10 @@ import ( // swagger:model WritableDeviceWithConfigContext type WritableDeviceWithConfigContext struct { + // Airflow + // Enum: [front-to-rear rear-to-front left-to-right right-to-left side-to-rear passive] + Airflow string `json:"airflow,omitempty"` + // Asset tag // // A unique tag used to identify this device @@ -73,8 +77,9 @@ type WritableDeviceWithConfigContext struct { Display string `json:"display,omitempty"` // Rack face + // Required: true // Enum: [front rear] - Face string `json:"face,omitempty"` + Face *string `json:"face"` // Id // Read Only: true @@ -92,8 +97,9 @@ type WritableDeviceWithConfigContext struct { Location *int64 `json:"location,omitempty"` // Name + // Required: true // Max Length: 64 - Name *string `json:"name,omitempty"` + Name *string `json:"name"` // parent device ParentDevice *NestedDevice `json:"parent_device,omitempty"` @@ -102,9 +108,6 @@ type WritableDeviceWithConfigContext struct { Platform *int64 `json:"platform,omitempty"` // Position (U) - // - // The lowest-numbered unit occupied by the device - // Maximum: 32767 // Minimum: 1 Position *int64 `json:"position,omitempty"` @@ -119,7 +122,8 @@ type WritableDeviceWithConfigContext struct { PrimaryIp6 *int64 `json:"primary_ip6,omitempty"` // Rack - Rack *int64 `json:"rack,omitempty"` + // Required: true + Rack *int64 `json:"rack"` // Serial number // Max Length: 50 @@ -137,7 +141,8 @@ type WritableDeviceWithConfigContext struct { Tags []*NestedTag `json:"tags"` // Tenant - Tenant *int64 `json:"tenant,omitempty"` + // Required: true + Tenant *int64 `json:"tenant"` // Url // Read Only: true @@ -155,13 +160,18 @@ type WritableDeviceWithConfigContext struct { VcPriority *int64 `json:"vc_priority,omitempty"` // Virtual chassis - VirtualChassis *int64 `json:"virtual_chassis,omitempty"` + // Required: true + VirtualChassis *int64 `json:"virtual_chassis"` } // Validate validates this writable device with config context func (m *WritableDeviceWithConfigContext) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAirflow(formats); err != nil { + res = append(res, err) + } + if err := m.validateAssetTag(formats); err != nil { res = append(res, err) } @@ -198,6 +208,10 @@ func (m *WritableDeviceWithConfigContext) Validate(formats strfmt.Registry) erro res = append(res, err) } + if err := m.validateRack(formats); err != nil { + res = append(res, err) + } + if err := m.validateSerial(formats); err != nil { res = append(res, err) } @@ -214,6 +228,10 @@ func (m *WritableDeviceWithConfigContext) Validate(formats strfmt.Registry) erro res = append(res, err) } + if err := m.validateTenant(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -226,12 +244,70 @@ func (m *WritableDeviceWithConfigContext) Validate(formats strfmt.Registry) erro res = append(res, err) } + if err := m.validateVirtualChassis(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } +var writableDeviceWithConfigContextTypeAirflowPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["front-to-rear","rear-to-front","left-to-right","right-to-left","side-to-rear","passive"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceWithConfigContextTypeAirflowPropEnum = append(writableDeviceWithConfigContextTypeAirflowPropEnum, v) + } +} + +const ( + + // WritableDeviceWithConfigContextAirflowFrontDashToDashRear captures enum value "front-to-rear" + WritableDeviceWithConfigContextAirflowFrontDashToDashRear string = "front-to-rear" + + // WritableDeviceWithConfigContextAirflowRearDashToDashFront captures enum value "rear-to-front" + WritableDeviceWithConfigContextAirflowRearDashToDashFront string = "rear-to-front" + + // WritableDeviceWithConfigContextAirflowLeftDashToDashRight captures enum value "left-to-right" + WritableDeviceWithConfigContextAirflowLeftDashToDashRight string = "left-to-right" + + // WritableDeviceWithConfigContextAirflowRightDashToDashLeft captures enum value "right-to-left" + WritableDeviceWithConfigContextAirflowRightDashToDashLeft string = "right-to-left" + + // WritableDeviceWithConfigContextAirflowSideDashToDashRear captures enum value "side-to-rear" + WritableDeviceWithConfigContextAirflowSideDashToDashRear string = "side-to-rear" + + // WritableDeviceWithConfigContextAirflowPassive captures enum value "passive" + WritableDeviceWithConfigContextAirflowPassive string = "passive" +) + +// prop value enum +func (m *WritableDeviceWithConfigContext) validateAirflowEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableDeviceWithConfigContextTypeAirflowPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceWithConfigContext) validateAirflow(formats strfmt.Registry) error { + if swag.IsZero(m.Airflow) { // not required + return nil + } + + // value enum + if err := m.validateAirflowEnum("airflow", "body", m.Airflow); err != nil { + return err + } + + return nil +} + func (m *WritableDeviceWithConfigContext) validateAssetTag(formats strfmt.Registry) error { if swag.IsZero(m.AssetTag) { // not required return nil @@ -304,12 +380,13 @@ func (m *WritableDeviceWithConfigContext) validateFaceEnum(path, location string } func (m *WritableDeviceWithConfigContext) validateFace(formats strfmt.Registry) error { - if swag.IsZero(m.Face) { // not required - return nil + + if err := validate.Required("face", "body", m.Face); err != nil { + return err } // value enum - if err := m.validateFaceEnum("face", "body", m.Face); err != nil { + if err := m.validateFaceEnum("face", "body", *m.Face); err != nil { return err } @@ -329,8 +406,9 @@ func (m *WritableDeviceWithConfigContext) validateLastUpdated(formats strfmt.Reg } func (m *WritableDeviceWithConfigContext) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required - return nil + + if err := validate.Required("name", "body", m.Name); err != nil { + return err } if err := validate.MaxLength("name", "body", *m.Name, 64); err != nil { @@ -368,7 +446,12 @@ func (m *WritableDeviceWithConfigContext) validatePosition(formats strfmt.Regist return err } - if err := validate.MaximumInt("position", "body", *m.Position, 32767, false); err != nil { + return nil +} + +func (m *WritableDeviceWithConfigContext) validateRack(formats strfmt.Registry) error { + + if err := validate.Required("rack", "body", m.Rack); err != nil { return err } @@ -479,6 +562,15 @@ func (m *WritableDeviceWithConfigContext) validateTags(formats strfmt.Registry) return nil } +func (m *WritableDeviceWithConfigContext) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + return nil +} + func (m *WritableDeviceWithConfigContext) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -523,6 +615,15 @@ func (m *WritableDeviceWithConfigContext) validateVcPriority(formats strfmt.Regi return nil } +func (m *WritableDeviceWithConfigContext) validateVirtualChassis(formats strfmt.Registry) error { + + if err := validate.Required("virtual_chassis", "body", m.VirtualChassis); err != nil { + return err + } + + return nil +} + // ContextValidate validate this writable device with config context based on the context it is used func (m *WritableDeviceWithConfigContext) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_f_h_r_p_group_assignment.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_f_h_r_p_group_assignment.go new file mode 100644 index 000000000..aac59309e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_f_h_r_p_group_assignment.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableFHRPGroupAssignment writable f h r p group assignment +// +// swagger:model WritableFHRPGroupAssignment +type WritableFHRPGroupAssignment struct { + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Group + // Required: true + Group *int64 `json:"group"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface + // Read Only: true + Interface map[string]*string `json:"interface,omitempty"` + + // Interface id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + InterfaceID *int64 `json:"interface_id"` + + // Interface type + // Required: true + InterfaceType *string `json:"interface_type"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Priority + // Required: true + // Maximum: 255 + // Minimum: 0 + Priority *int64 `json:"priority"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this writable f h r p group assignment +func (m *WritableFHRPGroupAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfaceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfaceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriority(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableFHRPGroupAssignment) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) validateInterfaceID(formats strfmt.Registry) error { + + if err := validate.Required("interface_id", "body", m.InterfaceID); err != nil { + return err + } + + if err := validate.MinimumInt("interface_id", "body", *m.InterfaceID, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("interface_id", "body", *m.InterfaceID, 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) validateInterfaceType(formats strfmt.Registry) error { + + if err := validate.Required("interface_type", "body", m.InterfaceType); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) validatePriority(formats strfmt.Registry) error { + + if err := validate.Required("priority", "body", m.Priority); err != nil { + return err + } + + if err := validate.MinimumInt("priority", "body", *m.Priority, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("priority", "body", *m.Priority, 255, false); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable f h r p group assignment based on the context it is used +func (m *WritableFHRPGroupAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInterface(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableFHRPGroupAssignment) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) contextValidateInterface(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableFHRPGroupAssignment) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableFHRPGroupAssignment) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableFHRPGroupAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableFHRPGroupAssignment) UnmarshalBinary(b []byte) error { + var res WritableFHRPGroupAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port.go index fe6547818..e7c7190cc 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port.go @@ -43,18 +43,6 @@ type WritableFrontPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Color // Max Length: 6 // Pattern: ^[0-9a-f]{6}$ @@ -95,6 +83,18 @@ type WritableFrontPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -120,7 +120,7 @@ type WritableFrontPort struct { // Type // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Type *string `json:"type"` // Url @@ -355,7 +355,7 @@ var writableFrontPortTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -425,12 +425,24 @@ const ( // WritableFrontPortTypeLc captures enum value "lc" WritableFrontPortTypeLc string = "lc" + // WritableFrontPortTypeLcDashPc captures enum value "lc-pc" + WritableFrontPortTypeLcDashPc string = "lc-pc" + + // WritableFrontPortTypeLcDashUpc captures enum value "lc-upc" + WritableFrontPortTypeLcDashUpc string = "lc-upc" + // WritableFrontPortTypeLcDashApc captures enum value "lc-apc" WritableFrontPortTypeLcDashApc string = "lc-apc" // WritableFrontPortTypeLsh captures enum value "lsh" WritableFrontPortTypeLsh string = "lsh" + // WritableFrontPortTypeLshDashPc captures enum value "lsh-pc" + WritableFrontPortTypeLshDashPc string = "lsh-pc" + + // WritableFrontPortTypeLshDashUpc captures enum value "lsh-upc" + WritableFrontPortTypeLshDashUpc string = "lsh-upc" + // WritableFrontPortTypeLshDashApc captures enum value "lsh-apc" WritableFrontPortTypeLshDashApc string = "lsh-apc" @@ -443,6 +455,12 @@ const ( // WritableFrontPortTypeSc captures enum value "sc" WritableFrontPortTypeSc string = "sc" + // WritableFrontPortTypeScDashPc captures enum value "sc-pc" + WritableFrontPortTypeScDashPc string = "sc-pc" + + // WritableFrontPortTypeScDashUpc captures enum value "sc-upc" + WritableFrontPortTypeScDashUpc string = "sc-upc" + // WritableFrontPortTypeScDashApc captures enum value "sc-apc" WritableFrontPortTypeScDashApc string = "sc-apc" @@ -520,27 +538,27 @@ func (m *WritableFrontPort) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { + if err := m.contextValidateCreated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCreated(ctx, formats); err != nil { + if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDisplay(ctx, formats); err != nil { + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateID(ctx, formats); err != nil { + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { res = append(res, err) } @@ -583,20 +601,6 @@ func (m *WritableFrontPort) contextValidateCable(ctx context.Context, formats st return nil } -func (m *WritableFrontPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritableFrontPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *WritableFrontPort) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { @@ -633,6 +637,20 @@ func (m *WritableFrontPort) contextValidateLastUpdated(ctx context.Context, form return nil } +func (m *WritableFrontPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableFrontPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritableFrontPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port_template.go index de1d4b876..dc286087b 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_front_port_template.go @@ -89,7 +89,7 @@ type WritableFrontPortTemplate struct { // Type // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Type *string `json:"type"` // Url @@ -271,7 +271,7 @@ var writableFrontPortTemplateTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -341,12 +341,24 @@ const ( // WritableFrontPortTemplateTypeLc captures enum value "lc" WritableFrontPortTemplateTypeLc string = "lc" + // WritableFrontPortTemplateTypeLcDashPc captures enum value "lc-pc" + WritableFrontPortTemplateTypeLcDashPc string = "lc-pc" + + // WritableFrontPortTemplateTypeLcDashUpc captures enum value "lc-upc" + WritableFrontPortTemplateTypeLcDashUpc string = "lc-upc" + // WritableFrontPortTemplateTypeLcDashApc captures enum value "lc-apc" WritableFrontPortTemplateTypeLcDashApc string = "lc-apc" // WritableFrontPortTemplateTypeLsh captures enum value "lsh" WritableFrontPortTemplateTypeLsh string = "lsh" + // WritableFrontPortTemplateTypeLshDashPc captures enum value "lsh-pc" + WritableFrontPortTemplateTypeLshDashPc string = "lsh-pc" + + // WritableFrontPortTemplateTypeLshDashUpc captures enum value "lsh-upc" + WritableFrontPortTemplateTypeLshDashUpc string = "lsh-upc" + // WritableFrontPortTemplateTypeLshDashApc captures enum value "lsh-apc" WritableFrontPortTemplateTypeLshDashApc string = "lsh-apc" @@ -359,6 +371,12 @@ const ( // WritableFrontPortTemplateTypeSc captures enum value "sc" WritableFrontPortTemplateTypeSc string = "sc" + // WritableFrontPortTemplateTypeScDashPc captures enum value "sc-pc" + WritableFrontPortTemplateTypeScDashPc string = "sc-pc" + + // WritableFrontPortTemplateTypeScDashUpc captures enum value "sc-upc" + WritableFrontPortTemplateTypeScDashUpc string = "sc-upc" + // WritableFrontPortTemplateTypeScDashApc captures enum value "sc-apc" WritableFrontPortTemplateTypeScDashApc string = "sc-apc" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface.go index 41a11b36c..fce26539d 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface.go @@ -40,21 +40,12 @@ type WritableInterface struct { // Read Only: true Occupied *bool `json:"_occupied,omitempty"` + // Bridge interface + Bridge *int64 `json:"bridge,omitempty"` + // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -71,6 +62,10 @@ type WritableInterface struct { // Read Only: true ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + // Count fhrp groups + // Read Only: true + CountFhrpGroups int64 `json:"count_fhrp_groups,omitempty"` + // Count ipaddresses // Read Only: true CountIpaddresses int64 `json:"count_ipaddresses,omitempty"` @@ -116,6 +111,18 @@ type WritableInterface struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // MAC Address MacAddress *string `json:"mac_address,omitempty"` @@ -147,6 +154,20 @@ type WritableInterface struct { // Parent interface Parent *int64 `json:"parent,omitempty"` + // Wireless channel + // Enum: [2.4g-1-2412-22 2.4g-2-2417-22 2.4g-3-2422-22 2.4g-4-2427-22 2.4g-5-2432-22 2.4g-6-2437-22 2.4g-7-2442-22 2.4g-8-2447-22 2.4g-9-2452-22 2.4g-10-2457-22 2.4g-11-2462-22 2.4g-12-2467-22 2.4g-13-2472-22 5g-32-5160-20 5g-34-5170-40 5g-36-5180-20 5g-38-5190-40 5g-40-5200-20 5g-42-5210-80 5g-44-5220-20 5g-46-5230-40 5g-48-5240-20 5g-50-5250-160 5g-52-5260-20 5g-54-5270-40 5g-56-5280-20 5g-58-5290-80 5g-60-5300-20 5g-62-5310-40 5g-64-5320-20 5g-100-5500-20 5g-102-5510-40 5g-104-5520-20 5g-106-5530-80 5g-108-5540-20 5g-110-5550-40 5g-112-5560-20 5g-114-5570-160 5g-116-5580-20 5g-118-5590-40 5g-120-5600-20 5g-122-5610-80 5g-124-5620-20 5g-126-5630-40 5g-128-5640-20 5g-132-5660-20 5g-134-5670-40 5g-136-5680-20 5g-138-5690-80 5g-140-5700-20 5g-142-5710-40 5g-144-5720-20 5g-149-5745-20 5g-151-5755-40 5g-153-5765-20 5g-155-5775-80 5g-157-5785-20 5g-159-5795-40 5g-161-5805-20 5g-163-5815-160 5g-165-5825-20 5g-167-5835-40 5g-169-5845-20 5g-171-5855-80 5g-173-5865-20 5g-175-5875-40 5g-177-5885-20 6g-1-5955-20 6g-3-5965-40 6g-5-5975-20 6g-7-5985-80 6g-9-5995-20 6g-11-6005-40 6g-13-6015-20 6g-15-6025-160 6g-17-6035-20 6g-19-6045-40 6g-21-6055-20 6g-23-6065-80 6g-25-6075-20 6g-27-6085-40 6g-29-6095-20 6g-31-6105-320 6g-33-6115-20 6g-35-6125-40 6g-37-6135-20 6g-39-6145-80 6g-41-6155-20 6g-43-6165-40 6g-45-6175-20 6g-47-6185-160 6g-49-6195-20 6g-51-6205-40 6g-53-6215-20 6g-55-6225-80 6g-57-6235-20 6g-59-6245-40 6g-61-6255-20 6g-65-6275-20 6g-67-6285-40 6g-69-6295-20 6g-71-6305-80 6g-73-6315-20 6g-75-6325-40 6g-77-6335-20 6g-79-6345-160 6g-81-6355-20 6g-83-6365-40 6g-85-6375-20 6g-87-6385-80 6g-89-6395-20 6g-91-6405-40 6g-93-6415-20 6g-95-6425-320 6g-97-6435-20 6g-99-6445-40 6g-101-6455-20 6g-103-6465-80 6g-105-6475-20 6g-107-6485-40 6g-109-6495-20 6g-111-6505-160 6g-113-6515-20 6g-115-6525-40 6g-117-6535-20 6g-119-6545-80 6g-121-6555-20 6g-123-6565-40 6g-125-6575-20 6g-129-6595-20 6g-131-6605-40 6g-133-6615-20 6g-135-6625-80 6g-137-6635-20 6g-139-6645-40 6g-141-6655-20 6g-143-6665-160 6g-145-6675-20 6g-147-6685-40 6g-149-6695-20 6g-151-6705-80 6g-153-6715-20 6g-155-6725-40 6g-157-6735-20 6g-159-6745-320 6g-161-6755-20 6g-163-6765-40 6g-165-6775-20 6g-167-6785-80 6g-169-6795-20 6g-171-6805-40 6g-173-6815-20 6g-175-6825-160 6g-177-6835-20 6g-179-6845-40 6g-181-6855-20 6g-183-6865-80 6g-185-6875-20 6g-187-6885-40 6g-189-6895-20 6g-193-6915-20 6g-195-6925-40 6g-197-6935-20 6g-199-6945-80 6g-201-6955-20 6g-203-6965-40 6g-205-6975-20 6g-207-6985-160 6g-209-6995-20 6g-211-7005-40 6g-213-7015-20 6g-215-7025-80 6g-217-7035-20 6g-219-7045-40 6g-221-7055-20 6g-225-7075-20 6g-227-7085-40 6g-229-7095-20 6g-233-7115-20 60g-1-58320-2160 60g-2-60480-2160 60g-3-62640-2160 60g-4-64800-2160 60g-5-66960-2160 60g-6-69120-2160 60g-9-59400-4320 60g-10-61560-4320 60g-11-63720-4320 60g-12-65880-4320 60g-13-68040-4320 60g-17-60480-6480 60g-18-62640-6480 60g-19-64800-6480 60g-20-66960-6480 60g-25-61560-6480 60g-26-63720-6480 60g-27-65880-6480] + RfChannel string `json:"rf_channel,omitempty"` + + // Channel frequency (MHz) + RfChannelFrequency *float64 `json:"rf_channel_frequency,omitempty"` + + // Channel width (MHz) + RfChannelWidth *float64 `json:"rf_channel_width,omitempty"` + + // Wireless role + // Enum: [ap station] + RfRole string `json:"rf_role,omitempty"` + // tagged vlans // Unique: true TaggedVlans []int64 `json:"tagged_vlans"` @@ -154,9 +175,14 @@ type WritableInterface struct { // tags Tags []*NestedTag `json:"tags"` + // Transmit power (dBm) + // Maximum: 127 + // Minimum: 0 + TxPower *int64 `json:"tx_power,omitempty"` + // Type // Required: true - // Enum: [virtual lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-sfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] + // Enum: [virtual bridge lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-qsfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus cisco-stackwise-80 cisco-stackwise-160 cisco-stackwise-320 cisco-stackwise-480 juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] Type *string `json:"type"` // Untagged VLAN @@ -166,6 +192,18 @@ type WritableInterface struct { // Read Only: true // Format: uri URL strfmt.URI `json:"url,omitempty"` + + // wireless lans + // Unique: true + WirelessLans []int64 `json:"wireless_lans"` + + // Wireless link + WirelessLink *int64 `json:"wireless_link,omitempty"` + + // WWN + // + // 64-bit World Wide Name + Wwn *string `json:"wwn,omitempty"` } // Validate validates this writable interface @@ -208,6 +246,14 @@ func (m *WritableInterface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateRfChannel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRfRole(formats); err != nil { + res = append(res, err) + } + if err := m.validateTaggedVlans(formats); err != nil { res = append(res, err) } @@ -216,6 +262,10 @@ func (m *WritableInterface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTxPower(formats); err != nil { + res = append(res, err) + } + if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -224,6 +274,10 @@ func (m *WritableInterface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateWirelessLans(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -384,6 +438,675 @@ func (m *WritableInterface) validateName(formats strfmt.Registry) error { return nil } +var writableInterfaceTypeRfChannelPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["2.4g-1-2412-22","2.4g-2-2417-22","2.4g-3-2422-22","2.4g-4-2427-22","2.4g-5-2432-22","2.4g-6-2437-22","2.4g-7-2442-22","2.4g-8-2447-22","2.4g-9-2452-22","2.4g-10-2457-22","2.4g-11-2462-22","2.4g-12-2467-22","2.4g-13-2472-22","5g-32-5160-20","5g-34-5170-40","5g-36-5180-20","5g-38-5190-40","5g-40-5200-20","5g-42-5210-80","5g-44-5220-20","5g-46-5230-40","5g-48-5240-20","5g-50-5250-160","5g-52-5260-20","5g-54-5270-40","5g-56-5280-20","5g-58-5290-80","5g-60-5300-20","5g-62-5310-40","5g-64-5320-20","5g-100-5500-20","5g-102-5510-40","5g-104-5520-20","5g-106-5530-80","5g-108-5540-20","5g-110-5550-40","5g-112-5560-20","5g-114-5570-160","5g-116-5580-20","5g-118-5590-40","5g-120-5600-20","5g-122-5610-80","5g-124-5620-20","5g-126-5630-40","5g-128-5640-20","5g-132-5660-20","5g-134-5670-40","5g-136-5680-20","5g-138-5690-80","5g-140-5700-20","5g-142-5710-40","5g-144-5720-20","5g-149-5745-20","5g-151-5755-40","5g-153-5765-20","5g-155-5775-80","5g-157-5785-20","5g-159-5795-40","5g-161-5805-20","5g-163-5815-160","5g-165-5825-20","5g-167-5835-40","5g-169-5845-20","5g-171-5855-80","5g-173-5865-20","5g-175-5875-40","5g-177-5885-20","6g-1-5955-20","6g-3-5965-40","6g-5-5975-20","6g-7-5985-80","6g-9-5995-20","6g-11-6005-40","6g-13-6015-20","6g-15-6025-160","6g-17-6035-20","6g-19-6045-40","6g-21-6055-20","6g-23-6065-80","6g-25-6075-20","6g-27-6085-40","6g-29-6095-20","6g-31-6105-320","6g-33-6115-20","6g-35-6125-40","6g-37-6135-20","6g-39-6145-80","6g-41-6155-20","6g-43-6165-40","6g-45-6175-20","6g-47-6185-160","6g-49-6195-20","6g-51-6205-40","6g-53-6215-20","6g-55-6225-80","6g-57-6235-20","6g-59-6245-40","6g-61-6255-20","6g-65-6275-20","6g-67-6285-40","6g-69-6295-20","6g-71-6305-80","6g-73-6315-20","6g-75-6325-40","6g-77-6335-20","6g-79-6345-160","6g-81-6355-20","6g-83-6365-40","6g-85-6375-20","6g-87-6385-80","6g-89-6395-20","6g-91-6405-40","6g-93-6415-20","6g-95-6425-320","6g-97-6435-20","6g-99-6445-40","6g-101-6455-20","6g-103-6465-80","6g-105-6475-20","6g-107-6485-40","6g-109-6495-20","6g-111-6505-160","6g-113-6515-20","6g-115-6525-40","6g-117-6535-20","6g-119-6545-80","6g-121-6555-20","6g-123-6565-40","6g-125-6575-20","6g-129-6595-20","6g-131-6605-40","6g-133-6615-20","6g-135-6625-80","6g-137-6635-20","6g-139-6645-40","6g-141-6655-20","6g-143-6665-160","6g-145-6675-20","6g-147-6685-40","6g-149-6695-20","6g-151-6705-80","6g-153-6715-20","6g-155-6725-40","6g-157-6735-20","6g-159-6745-320","6g-161-6755-20","6g-163-6765-40","6g-165-6775-20","6g-167-6785-80","6g-169-6795-20","6g-171-6805-40","6g-173-6815-20","6g-175-6825-160","6g-177-6835-20","6g-179-6845-40","6g-181-6855-20","6g-183-6865-80","6g-185-6875-20","6g-187-6885-40","6g-189-6895-20","6g-193-6915-20","6g-195-6925-40","6g-197-6935-20","6g-199-6945-80","6g-201-6955-20","6g-203-6965-40","6g-205-6975-20","6g-207-6985-160","6g-209-6995-20","6g-211-7005-40","6g-213-7015-20","6g-215-7025-80","6g-217-7035-20","6g-219-7045-40","6g-221-7055-20","6g-225-7075-20","6g-227-7085-40","6g-229-7095-20","6g-233-7115-20","60g-1-58320-2160","60g-2-60480-2160","60g-3-62640-2160","60g-4-64800-2160","60g-5-66960-2160","60g-6-69120-2160","60g-9-59400-4320","60g-10-61560-4320","60g-11-63720-4320","60g-12-65880-4320","60g-13-68040-4320","60g-17-60480-6480","60g-18-62640-6480","60g-19-64800-6480","60g-20-66960-6480","60g-25-61560-6480","60g-26-63720-6480","60g-27-65880-6480"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceTypeRfChannelPropEnum = append(writableInterfaceTypeRfChannelPropEnum, v) + } +} + +const ( + + // WritableInterfaceRfChannelNr2Dot4gDash1Dash2412Dash22 captures enum value "2.4g-1-2412-22" + WritableInterfaceRfChannelNr2Dot4gDash1Dash2412Dash22 string = "2.4g-1-2412-22" + + // WritableInterfaceRfChannelNr2Dot4gDash2Dash2417Dash22 captures enum value "2.4g-2-2417-22" + WritableInterfaceRfChannelNr2Dot4gDash2Dash2417Dash22 string = "2.4g-2-2417-22" + + // WritableInterfaceRfChannelNr2Dot4gDash3Dash2422Dash22 captures enum value "2.4g-3-2422-22" + WritableInterfaceRfChannelNr2Dot4gDash3Dash2422Dash22 string = "2.4g-3-2422-22" + + // WritableInterfaceRfChannelNr2Dot4gDash4Dash2427Dash22 captures enum value "2.4g-4-2427-22" + WritableInterfaceRfChannelNr2Dot4gDash4Dash2427Dash22 string = "2.4g-4-2427-22" + + // WritableInterfaceRfChannelNr2Dot4gDash5Dash2432Dash22 captures enum value "2.4g-5-2432-22" + WritableInterfaceRfChannelNr2Dot4gDash5Dash2432Dash22 string = "2.4g-5-2432-22" + + // WritableInterfaceRfChannelNr2Dot4gDash6Dash2437Dash22 captures enum value "2.4g-6-2437-22" + WritableInterfaceRfChannelNr2Dot4gDash6Dash2437Dash22 string = "2.4g-6-2437-22" + + // WritableInterfaceRfChannelNr2Dot4gDash7Dash2442Dash22 captures enum value "2.4g-7-2442-22" + WritableInterfaceRfChannelNr2Dot4gDash7Dash2442Dash22 string = "2.4g-7-2442-22" + + // WritableInterfaceRfChannelNr2Dot4gDash8Dash2447Dash22 captures enum value "2.4g-8-2447-22" + WritableInterfaceRfChannelNr2Dot4gDash8Dash2447Dash22 string = "2.4g-8-2447-22" + + // WritableInterfaceRfChannelNr2Dot4gDash9Dash2452Dash22 captures enum value "2.4g-9-2452-22" + WritableInterfaceRfChannelNr2Dot4gDash9Dash2452Dash22 string = "2.4g-9-2452-22" + + // WritableInterfaceRfChannelNr2Dot4gDash10Dash2457Dash22 captures enum value "2.4g-10-2457-22" + WritableInterfaceRfChannelNr2Dot4gDash10Dash2457Dash22 string = "2.4g-10-2457-22" + + // WritableInterfaceRfChannelNr2Dot4gDash11Dash2462Dash22 captures enum value "2.4g-11-2462-22" + WritableInterfaceRfChannelNr2Dot4gDash11Dash2462Dash22 string = "2.4g-11-2462-22" + + // WritableInterfaceRfChannelNr2Dot4gDash12Dash2467Dash22 captures enum value "2.4g-12-2467-22" + WritableInterfaceRfChannelNr2Dot4gDash12Dash2467Dash22 string = "2.4g-12-2467-22" + + // WritableInterfaceRfChannelNr2Dot4gDash13Dash2472Dash22 captures enum value "2.4g-13-2472-22" + WritableInterfaceRfChannelNr2Dot4gDash13Dash2472Dash22 string = "2.4g-13-2472-22" + + // WritableInterfaceRfChannelNr5gDash32Dash5160Dash20 captures enum value "5g-32-5160-20" + WritableInterfaceRfChannelNr5gDash32Dash5160Dash20 string = "5g-32-5160-20" + + // WritableInterfaceRfChannelNr5gDash34Dash5170Dash40 captures enum value "5g-34-5170-40" + WritableInterfaceRfChannelNr5gDash34Dash5170Dash40 string = "5g-34-5170-40" + + // WritableInterfaceRfChannelNr5gDash36Dash5180Dash20 captures enum value "5g-36-5180-20" + WritableInterfaceRfChannelNr5gDash36Dash5180Dash20 string = "5g-36-5180-20" + + // WritableInterfaceRfChannelNr5gDash38Dash5190Dash40 captures enum value "5g-38-5190-40" + WritableInterfaceRfChannelNr5gDash38Dash5190Dash40 string = "5g-38-5190-40" + + // WritableInterfaceRfChannelNr5gDash40Dash5200Dash20 captures enum value "5g-40-5200-20" + WritableInterfaceRfChannelNr5gDash40Dash5200Dash20 string = "5g-40-5200-20" + + // WritableInterfaceRfChannelNr5gDash42Dash5210Dash80 captures enum value "5g-42-5210-80" + WritableInterfaceRfChannelNr5gDash42Dash5210Dash80 string = "5g-42-5210-80" + + // WritableInterfaceRfChannelNr5gDash44Dash5220Dash20 captures enum value "5g-44-5220-20" + WritableInterfaceRfChannelNr5gDash44Dash5220Dash20 string = "5g-44-5220-20" + + // WritableInterfaceRfChannelNr5gDash46Dash5230Dash40 captures enum value "5g-46-5230-40" + WritableInterfaceRfChannelNr5gDash46Dash5230Dash40 string = "5g-46-5230-40" + + // WritableInterfaceRfChannelNr5gDash48Dash5240Dash20 captures enum value "5g-48-5240-20" + WritableInterfaceRfChannelNr5gDash48Dash5240Dash20 string = "5g-48-5240-20" + + // WritableInterfaceRfChannelNr5gDash50Dash5250Dash160 captures enum value "5g-50-5250-160" + WritableInterfaceRfChannelNr5gDash50Dash5250Dash160 string = "5g-50-5250-160" + + // WritableInterfaceRfChannelNr5gDash52Dash5260Dash20 captures enum value "5g-52-5260-20" + WritableInterfaceRfChannelNr5gDash52Dash5260Dash20 string = "5g-52-5260-20" + + // WritableInterfaceRfChannelNr5gDash54Dash5270Dash40 captures enum value "5g-54-5270-40" + WritableInterfaceRfChannelNr5gDash54Dash5270Dash40 string = "5g-54-5270-40" + + // WritableInterfaceRfChannelNr5gDash56Dash5280Dash20 captures enum value "5g-56-5280-20" + WritableInterfaceRfChannelNr5gDash56Dash5280Dash20 string = "5g-56-5280-20" + + // WritableInterfaceRfChannelNr5gDash58Dash5290Dash80 captures enum value "5g-58-5290-80" + WritableInterfaceRfChannelNr5gDash58Dash5290Dash80 string = "5g-58-5290-80" + + // WritableInterfaceRfChannelNr5gDash60Dash5300Dash20 captures enum value "5g-60-5300-20" + WritableInterfaceRfChannelNr5gDash60Dash5300Dash20 string = "5g-60-5300-20" + + // WritableInterfaceRfChannelNr5gDash62Dash5310Dash40 captures enum value "5g-62-5310-40" + WritableInterfaceRfChannelNr5gDash62Dash5310Dash40 string = "5g-62-5310-40" + + // WritableInterfaceRfChannelNr5gDash64Dash5320Dash20 captures enum value "5g-64-5320-20" + WritableInterfaceRfChannelNr5gDash64Dash5320Dash20 string = "5g-64-5320-20" + + // WritableInterfaceRfChannelNr5gDash100Dash5500Dash20 captures enum value "5g-100-5500-20" + WritableInterfaceRfChannelNr5gDash100Dash5500Dash20 string = "5g-100-5500-20" + + // WritableInterfaceRfChannelNr5gDash102Dash5510Dash40 captures enum value "5g-102-5510-40" + WritableInterfaceRfChannelNr5gDash102Dash5510Dash40 string = "5g-102-5510-40" + + // WritableInterfaceRfChannelNr5gDash104Dash5520Dash20 captures enum value "5g-104-5520-20" + WritableInterfaceRfChannelNr5gDash104Dash5520Dash20 string = "5g-104-5520-20" + + // WritableInterfaceRfChannelNr5gDash106Dash5530Dash80 captures enum value "5g-106-5530-80" + WritableInterfaceRfChannelNr5gDash106Dash5530Dash80 string = "5g-106-5530-80" + + // WritableInterfaceRfChannelNr5gDash108Dash5540Dash20 captures enum value "5g-108-5540-20" + WritableInterfaceRfChannelNr5gDash108Dash5540Dash20 string = "5g-108-5540-20" + + // WritableInterfaceRfChannelNr5gDash110Dash5550Dash40 captures enum value "5g-110-5550-40" + WritableInterfaceRfChannelNr5gDash110Dash5550Dash40 string = "5g-110-5550-40" + + // WritableInterfaceRfChannelNr5gDash112Dash5560Dash20 captures enum value "5g-112-5560-20" + WritableInterfaceRfChannelNr5gDash112Dash5560Dash20 string = "5g-112-5560-20" + + // WritableInterfaceRfChannelNr5gDash114Dash5570Dash160 captures enum value "5g-114-5570-160" + WritableInterfaceRfChannelNr5gDash114Dash5570Dash160 string = "5g-114-5570-160" + + // WritableInterfaceRfChannelNr5gDash116Dash5580Dash20 captures enum value "5g-116-5580-20" + WritableInterfaceRfChannelNr5gDash116Dash5580Dash20 string = "5g-116-5580-20" + + // WritableInterfaceRfChannelNr5gDash118Dash5590Dash40 captures enum value "5g-118-5590-40" + WritableInterfaceRfChannelNr5gDash118Dash5590Dash40 string = "5g-118-5590-40" + + // WritableInterfaceRfChannelNr5gDash120Dash5600Dash20 captures enum value "5g-120-5600-20" + WritableInterfaceRfChannelNr5gDash120Dash5600Dash20 string = "5g-120-5600-20" + + // WritableInterfaceRfChannelNr5gDash122Dash5610Dash80 captures enum value "5g-122-5610-80" + WritableInterfaceRfChannelNr5gDash122Dash5610Dash80 string = "5g-122-5610-80" + + // WritableInterfaceRfChannelNr5gDash124Dash5620Dash20 captures enum value "5g-124-5620-20" + WritableInterfaceRfChannelNr5gDash124Dash5620Dash20 string = "5g-124-5620-20" + + // WritableInterfaceRfChannelNr5gDash126Dash5630Dash40 captures enum value "5g-126-5630-40" + WritableInterfaceRfChannelNr5gDash126Dash5630Dash40 string = "5g-126-5630-40" + + // WritableInterfaceRfChannelNr5gDash128Dash5640Dash20 captures enum value "5g-128-5640-20" + WritableInterfaceRfChannelNr5gDash128Dash5640Dash20 string = "5g-128-5640-20" + + // WritableInterfaceRfChannelNr5gDash132Dash5660Dash20 captures enum value "5g-132-5660-20" + WritableInterfaceRfChannelNr5gDash132Dash5660Dash20 string = "5g-132-5660-20" + + // WritableInterfaceRfChannelNr5gDash134Dash5670Dash40 captures enum value "5g-134-5670-40" + WritableInterfaceRfChannelNr5gDash134Dash5670Dash40 string = "5g-134-5670-40" + + // WritableInterfaceRfChannelNr5gDash136Dash5680Dash20 captures enum value "5g-136-5680-20" + WritableInterfaceRfChannelNr5gDash136Dash5680Dash20 string = "5g-136-5680-20" + + // WritableInterfaceRfChannelNr5gDash138Dash5690Dash80 captures enum value "5g-138-5690-80" + WritableInterfaceRfChannelNr5gDash138Dash5690Dash80 string = "5g-138-5690-80" + + // WritableInterfaceRfChannelNr5gDash140Dash5700Dash20 captures enum value "5g-140-5700-20" + WritableInterfaceRfChannelNr5gDash140Dash5700Dash20 string = "5g-140-5700-20" + + // WritableInterfaceRfChannelNr5gDash142Dash5710Dash40 captures enum value "5g-142-5710-40" + WritableInterfaceRfChannelNr5gDash142Dash5710Dash40 string = "5g-142-5710-40" + + // WritableInterfaceRfChannelNr5gDash144Dash5720Dash20 captures enum value "5g-144-5720-20" + WritableInterfaceRfChannelNr5gDash144Dash5720Dash20 string = "5g-144-5720-20" + + // WritableInterfaceRfChannelNr5gDash149Dash5745Dash20 captures enum value "5g-149-5745-20" + WritableInterfaceRfChannelNr5gDash149Dash5745Dash20 string = "5g-149-5745-20" + + // WritableInterfaceRfChannelNr5gDash151Dash5755Dash40 captures enum value "5g-151-5755-40" + WritableInterfaceRfChannelNr5gDash151Dash5755Dash40 string = "5g-151-5755-40" + + // WritableInterfaceRfChannelNr5gDash153Dash5765Dash20 captures enum value "5g-153-5765-20" + WritableInterfaceRfChannelNr5gDash153Dash5765Dash20 string = "5g-153-5765-20" + + // WritableInterfaceRfChannelNr5gDash155Dash5775Dash80 captures enum value "5g-155-5775-80" + WritableInterfaceRfChannelNr5gDash155Dash5775Dash80 string = "5g-155-5775-80" + + // WritableInterfaceRfChannelNr5gDash157Dash5785Dash20 captures enum value "5g-157-5785-20" + WritableInterfaceRfChannelNr5gDash157Dash5785Dash20 string = "5g-157-5785-20" + + // WritableInterfaceRfChannelNr5gDash159Dash5795Dash40 captures enum value "5g-159-5795-40" + WritableInterfaceRfChannelNr5gDash159Dash5795Dash40 string = "5g-159-5795-40" + + // WritableInterfaceRfChannelNr5gDash161Dash5805Dash20 captures enum value "5g-161-5805-20" + WritableInterfaceRfChannelNr5gDash161Dash5805Dash20 string = "5g-161-5805-20" + + // WritableInterfaceRfChannelNr5gDash163Dash5815Dash160 captures enum value "5g-163-5815-160" + WritableInterfaceRfChannelNr5gDash163Dash5815Dash160 string = "5g-163-5815-160" + + // WritableInterfaceRfChannelNr5gDash165Dash5825Dash20 captures enum value "5g-165-5825-20" + WritableInterfaceRfChannelNr5gDash165Dash5825Dash20 string = "5g-165-5825-20" + + // WritableInterfaceRfChannelNr5gDash167Dash5835Dash40 captures enum value "5g-167-5835-40" + WritableInterfaceRfChannelNr5gDash167Dash5835Dash40 string = "5g-167-5835-40" + + // WritableInterfaceRfChannelNr5gDash169Dash5845Dash20 captures enum value "5g-169-5845-20" + WritableInterfaceRfChannelNr5gDash169Dash5845Dash20 string = "5g-169-5845-20" + + // WritableInterfaceRfChannelNr5gDash171Dash5855Dash80 captures enum value "5g-171-5855-80" + WritableInterfaceRfChannelNr5gDash171Dash5855Dash80 string = "5g-171-5855-80" + + // WritableInterfaceRfChannelNr5gDash173Dash5865Dash20 captures enum value "5g-173-5865-20" + WritableInterfaceRfChannelNr5gDash173Dash5865Dash20 string = "5g-173-5865-20" + + // WritableInterfaceRfChannelNr5gDash175Dash5875Dash40 captures enum value "5g-175-5875-40" + WritableInterfaceRfChannelNr5gDash175Dash5875Dash40 string = "5g-175-5875-40" + + // WritableInterfaceRfChannelNr5gDash177Dash5885Dash20 captures enum value "5g-177-5885-20" + WritableInterfaceRfChannelNr5gDash177Dash5885Dash20 string = "5g-177-5885-20" + + // WritableInterfaceRfChannelNr6gDash1Dash5955Dash20 captures enum value "6g-1-5955-20" + WritableInterfaceRfChannelNr6gDash1Dash5955Dash20 string = "6g-1-5955-20" + + // WritableInterfaceRfChannelNr6gDash3Dash5965Dash40 captures enum value "6g-3-5965-40" + WritableInterfaceRfChannelNr6gDash3Dash5965Dash40 string = "6g-3-5965-40" + + // WritableInterfaceRfChannelNr6gDash5Dash5975Dash20 captures enum value "6g-5-5975-20" + WritableInterfaceRfChannelNr6gDash5Dash5975Dash20 string = "6g-5-5975-20" + + // WritableInterfaceRfChannelNr6gDash7Dash5985Dash80 captures enum value "6g-7-5985-80" + WritableInterfaceRfChannelNr6gDash7Dash5985Dash80 string = "6g-7-5985-80" + + // WritableInterfaceRfChannelNr6gDash9Dash5995Dash20 captures enum value "6g-9-5995-20" + WritableInterfaceRfChannelNr6gDash9Dash5995Dash20 string = "6g-9-5995-20" + + // WritableInterfaceRfChannelNr6gDash11Dash6005Dash40 captures enum value "6g-11-6005-40" + WritableInterfaceRfChannelNr6gDash11Dash6005Dash40 string = "6g-11-6005-40" + + // WritableInterfaceRfChannelNr6gDash13Dash6015Dash20 captures enum value "6g-13-6015-20" + WritableInterfaceRfChannelNr6gDash13Dash6015Dash20 string = "6g-13-6015-20" + + // WritableInterfaceRfChannelNr6gDash15Dash6025Dash160 captures enum value "6g-15-6025-160" + WritableInterfaceRfChannelNr6gDash15Dash6025Dash160 string = "6g-15-6025-160" + + // WritableInterfaceRfChannelNr6gDash17Dash6035Dash20 captures enum value "6g-17-6035-20" + WritableInterfaceRfChannelNr6gDash17Dash6035Dash20 string = "6g-17-6035-20" + + // WritableInterfaceRfChannelNr6gDash19Dash6045Dash40 captures enum value "6g-19-6045-40" + WritableInterfaceRfChannelNr6gDash19Dash6045Dash40 string = "6g-19-6045-40" + + // WritableInterfaceRfChannelNr6gDash21Dash6055Dash20 captures enum value "6g-21-6055-20" + WritableInterfaceRfChannelNr6gDash21Dash6055Dash20 string = "6g-21-6055-20" + + // WritableInterfaceRfChannelNr6gDash23Dash6065Dash80 captures enum value "6g-23-6065-80" + WritableInterfaceRfChannelNr6gDash23Dash6065Dash80 string = "6g-23-6065-80" + + // WritableInterfaceRfChannelNr6gDash25Dash6075Dash20 captures enum value "6g-25-6075-20" + WritableInterfaceRfChannelNr6gDash25Dash6075Dash20 string = "6g-25-6075-20" + + // WritableInterfaceRfChannelNr6gDash27Dash6085Dash40 captures enum value "6g-27-6085-40" + WritableInterfaceRfChannelNr6gDash27Dash6085Dash40 string = "6g-27-6085-40" + + // WritableInterfaceRfChannelNr6gDash29Dash6095Dash20 captures enum value "6g-29-6095-20" + WritableInterfaceRfChannelNr6gDash29Dash6095Dash20 string = "6g-29-6095-20" + + // WritableInterfaceRfChannelNr6gDash31Dash6105Dash320 captures enum value "6g-31-6105-320" + WritableInterfaceRfChannelNr6gDash31Dash6105Dash320 string = "6g-31-6105-320" + + // WritableInterfaceRfChannelNr6gDash33Dash6115Dash20 captures enum value "6g-33-6115-20" + WritableInterfaceRfChannelNr6gDash33Dash6115Dash20 string = "6g-33-6115-20" + + // WritableInterfaceRfChannelNr6gDash35Dash6125Dash40 captures enum value "6g-35-6125-40" + WritableInterfaceRfChannelNr6gDash35Dash6125Dash40 string = "6g-35-6125-40" + + // WritableInterfaceRfChannelNr6gDash37Dash6135Dash20 captures enum value "6g-37-6135-20" + WritableInterfaceRfChannelNr6gDash37Dash6135Dash20 string = "6g-37-6135-20" + + // WritableInterfaceRfChannelNr6gDash39Dash6145Dash80 captures enum value "6g-39-6145-80" + WritableInterfaceRfChannelNr6gDash39Dash6145Dash80 string = "6g-39-6145-80" + + // WritableInterfaceRfChannelNr6gDash41Dash6155Dash20 captures enum value "6g-41-6155-20" + WritableInterfaceRfChannelNr6gDash41Dash6155Dash20 string = "6g-41-6155-20" + + // WritableInterfaceRfChannelNr6gDash43Dash6165Dash40 captures enum value "6g-43-6165-40" + WritableInterfaceRfChannelNr6gDash43Dash6165Dash40 string = "6g-43-6165-40" + + // WritableInterfaceRfChannelNr6gDash45Dash6175Dash20 captures enum value "6g-45-6175-20" + WritableInterfaceRfChannelNr6gDash45Dash6175Dash20 string = "6g-45-6175-20" + + // WritableInterfaceRfChannelNr6gDash47Dash6185Dash160 captures enum value "6g-47-6185-160" + WritableInterfaceRfChannelNr6gDash47Dash6185Dash160 string = "6g-47-6185-160" + + // WritableInterfaceRfChannelNr6gDash49Dash6195Dash20 captures enum value "6g-49-6195-20" + WritableInterfaceRfChannelNr6gDash49Dash6195Dash20 string = "6g-49-6195-20" + + // WritableInterfaceRfChannelNr6gDash51Dash6205Dash40 captures enum value "6g-51-6205-40" + WritableInterfaceRfChannelNr6gDash51Dash6205Dash40 string = "6g-51-6205-40" + + // WritableInterfaceRfChannelNr6gDash53Dash6215Dash20 captures enum value "6g-53-6215-20" + WritableInterfaceRfChannelNr6gDash53Dash6215Dash20 string = "6g-53-6215-20" + + // WritableInterfaceRfChannelNr6gDash55Dash6225Dash80 captures enum value "6g-55-6225-80" + WritableInterfaceRfChannelNr6gDash55Dash6225Dash80 string = "6g-55-6225-80" + + // WritableInterfaceRfChannelNr6gDash57Dash6235Dash20 captures enum value "6g-57-6235-20" + WritableInterfaceRfChannelNr6gDash57Dash6235Dash20 string = "6g-57-6235-20" + + // WritableInterfaceRfChannelNr6gDash59Dash6245Dash40 captures enum value "6g-59-6245-40" + WritableInterfaceRfChannelNr6gDash59Dash6245Dash40 string = "6g-59-6245-40" + + // WritableInterfaceRfChannelNr6gDash61Dash6255Dash20 captures enum value "6g-61-6255-20" + WritableInterfaceRfChannelNr6gDash61Dash6255Dash20 string = "6g-61-6255-20" + + // WritableInterfaceRfChannelNr6gDash65Dash6275Dash20 captures enum value "6g-65-6275-20" + WritableInterfaceRfChannelNr6gDash65Dash6275Dash20 string = "6g-65-6275-20" + + // WritableInterfaceRfChannelNr6gDash67Dash6285Dash40 captures enum value "6g-67-6285-40" + WritableInterfaceRfChannelNr6gDash67Dash6285Dash40 string = "6g-67-6285-40" + + // WritableInterfaceRfChannelNr6gDash69Dash6295Dash20 captures enum value "6g-69-6295-20" + WritableInterfaceRfChannelNr6gDash69Dash6295Dash20 string = "6g-69-6295-20" + + // WritableInterfaceRfChannelNr6gDash71Dash6305Dash80 captures enum value "6g-71-6305-80" + WritableInterfaceRfChannelNr6gDash71Dash6305Dash80 string = "6g-71-6305-80" + + // WritableInterfaceRfChannelNr6gDash73Dash6315Dash20 captures enum value "6g-73-6315-20" + WritableInterfaceRfChannelNr6gDash73Dash6315Dash20 string = "6g-73-6315-20" + + // WritableInterfaceRfChannelNr6gDash75Dash6325Dash40 captures enum value "6g-75-6325-40" + WritableInterfaceRfChannelNr6gDash75Dash6325Dash40 string = "6g-75-6325-40" + + // WritableInterfaceRfChannelNr6gDash77Dash6335Dash20 captures enum value "6g-77-6335-20" + WritableInterfaceRfChannelNr6gDash77Dash6335Dash20 string = "6g-77-6335-20" + + // WritableInterfaceRfChannelNr6gDash79Dash6345Dash160 captures enum value "6g-79-6345-160" + WritableInterfaceRfChannelNr6gDash79Dash6345Dash160 string = "6g-79-6345-160" + + // WritableInterfaceRfChannelNr6gDash81Dash6355Dash20 captures enum value "6g-81-6355-20" + WritableInterfaceRfChannelNr6gDash81Dash6355Dash20 string = "6g-81-6355-20" + + // WritableInterfaceRfChannelNr6gDash83Dash6365Dash40 captures enum value "6g-83-6365-40" + WritableInterfaceRfChannelNr6gDash83Dash6365Dash40 string = "6g-83-6365-40" + + // WritableInterfaceRfChannelNr6gDash85Dash6375Dash20 captures enum value "6g-85-6375-20" + WritableInterfaceRfChannelNr6gDash85Dash6375Dash20 string = "6g-85-6375-20" + + // WritableInterfaceRfChannelNr6gDash87Dash6385Dash80 captures enum value "6g-87-6385-80" + WritableInterfaceRfChannelNr6gDash87Dash6385Dash80 string = "6g-87-6385-80" + + // WritableInterfaceRfChannelNr6gDash89Dash6395Dash20 captures enum value "6g-89-6395-20" + WritableInterfaceRfChannelNr6gDash89Dash6395Dash20 string = "6g-89-6395-20" + + // WritableInterfaceRfChannelNr6gDash91Dash6405Dash40 captures enum value "6g-91-6405-40" + WritableInterfaceRfChannelNr6gDash91Dash6405Dash40 string = "6g-91-6405-40" + + // WritableInterfaceRfChannelNr6gDash93Dash6415Dash20 captures enum value "6g-93-6415-20" + WritableInterfaceRfChannelNr6gDash93Dash6415Dash20 string = "6g-93-6415-20" + + // WritableInterfaceRfChannelNr6gDash95Dash6425Dash320 captures enum value "6g-95-6425-320" + WritableInterfaceRfChannelNr6gDash95Dash6425Dash320 string = "6g-95-6425-320" + + // WritableInterfaceRfChannelNr6gDash97Dash6435Dash20 captures enum value "6g-97-6435-20" + WritableInterfaceRfChannelNr6gDash97Dash6435Dash20 string = "6g-97-6435-20" + + // WritableInterfaceRfChannelNr6gDash99Dash6445Dash40 captures enum value "6g-99-6445-40" + WritableInterfaceRfChannelNr6gDash99Dash6445Dash40 string = "6g-99-6445-40" + + // WritableInterfaceRfChannelNr6gDash101Dash6455Dash20 captures enum value "6g-101-6455-20" + WritableInterfaceRfChannelNr6gDash101Dash6455Dash20 string = "6g-101-6455-20" + + // WritableInterfaceRfChannelNr6gDash103Dash6465Dash80 captures enum value "6g-103-6465-80" + WritableInterfaceRfChannelNr6gDash103Dash6465Dash80 string = "6g-103-6465-80" + + // WritableInterfaceRfChannelNr6gDash105Dash6475Dash20 captures enum value "6g-105-6475-20" + WritableInterfaceRfChannelNr6gDash105Dash6475Dash20 string = "6g-105-6475-20" + + // WritableInterfaceRfChannelNr6gDash107Dash6485Dash40 captures enum value "6g-107-6485-40" + WritableInterfaceRfChannelNr6gDash107Dash6485Dash40 string = "6g-107-6485-40" + + // WritableInterfaceRfChannelNr6gDash109Dash6495Dash20 captures enum value "6g-109-6495-20" + WritableInterfaceRfChannelNr6gDash109Dash6495Dash20 string = "6g-109-6495-20" + + // WritableInterfaceRfChannelNr6gDash111Dash6505Dash160 captures enum value "6g-111-6505-160" + WritableInterfaceRfChannelNr6gDash111Dash6505Dash160 string = "6g-111-6505-160" + + // WritableInterfaceRfChannelNr6gDash113Dash6515Dash20 captures enum value "6g-113-6515-20" + WritableInterfaceRfChannelNr6gDash113Dash6515Dash20 string = "6g-113-6515-20" + + // WritableInterfaceRfChannelNr6gDash115Dash6525Dash40 captures enum value "6g-115-6525-40" + WritableInterfaceRfChannelNr6gDash115Dash6525Dash40 string = "6g-115-6525-40" + + // WritableInterfaceRfChannelNr6gDash117Dash6535Dash20 captures enum value "6g-117-6535-20" + WritableInterfaceRfChannelNr6gDash117Dash6535Dash20 string = "6g-117-6535-20" + + // WritableInterfaceRfChannelNr6gDash119Dash6545Dash80 captures enum value "6g-119-6545-80" + WritableInterfaceRfChannelNr6gDash119Dash6545Dash80 string = "6g-119-6545-80" + + // WritableInterfaceRfChannelNr6gDash121Dash6555Dash20 captures enum value "6g-121-6555-20" + WritableInterfaceRfChannelNr6gDash121Dash6555Dash20 string = "6g-121-6555-20" + + // WritableInterfaceRfChannelNr6gDash123Dash6565Dash40 captures enum value "6g-123-6565-40" + WritableInterfaceRfChannelNr6gDash123Dash6565Dash40 string = "6g-123-6565-40" + + // WritableInterfaceRfChannelNr6gDash125Dash6575Dash20 captures enum value "6g-125-6575-20" + WritableInterfaceRfChannelNr6gDash125Dash6575Dash20 string = "6g-125-6575-20" + + // WritableInterfaceRfChannelNr6gDash129Dash6595Dash20 captures enum value "6g-129-6595-20" + WritableInterfaceRfChannelNr6gDash129Dash6595Dash20 string = "6g-129-6595-20" + + // WritableInterfaceRfChannelNr6gDash131Dash6605Dash40 captures enum value "6g-131-6605-40" + WritableInterfaceRfChannelNr6gDash131Dash6605Dash40 string = "6g-131-6605-40" + + // WritableInterfaceRfChannelNr6gDash133Dash6615Dash20 captures enum value "6g-133-6615-20" + WritableInterfaceRfChannelNr6gDash133Dash6615Dash20 string = "6g-133-6615-20" + + // WritableInterfaceRfChannelNr6gDash135Dash6625Dash80 captures enum value "6g-135-6625-80" + WritableInterfaceRfChannelNr6gDash135Dash6625Dash80 string = "6g-135-6625-80" + + // WritableInterfaceRfChannelNr6gDash137Dash6635Dash20 captures enum value "6g-137-6635-20" + WritableInterfaceRfChannelNr6gDash137Dash6635Dash20 string = "6g-137-6635-20" + + // WritableInterfaceRfChannelNr6gDash139Dash6645Dash40 captures enum value "6g-139-6645-40" + WritableInterfaceRfChannelNr6gDash139Dash6645Dash40 string = "6g-139-6645-40" + + // WritableInterfaceRfChannelNr6gDash141Dash6655Dash20 captures enum value "6g-141-6655-20" + WritableInterfaceRfChannelNr6gDash141Dash6655Dash20 string = "6g-141-6655-20" + + // WritableInterfaceRfChannelNr6gDash143Dash6665Dash160 captures enum value "6g-143-6665-160" + WritableInterfaceRfChannelNr6gDash143Dash6665Dash160 string = "6g-143-6665-160" + + // WritableInterfaceRfChannelNr6gDash145Dash6675Dash20 captures enum value "6g-145-6675-20" + WritableInterfaceRfChannelNr6gDash145Dash6675Dash20 string = "6g-145-6675-20" + + // WritableInterfaceRfChannelNr6gDash147Dash6685Dash40 captures enum value "6g-147-6685-40" + WritableInterfaceRfChannelNr6gDash147Dash6685Dash40 string = "6g-147-6685-40" + + // WritableInterfaceRfChannelNr6gDash149Dash6695Dash20 captures enum value "6g-149-6695-20" + WritableInterfaceRfChannelNr6gDash149Dash6695Dash20 string = "6g-149-6695-20" + + // WritableInterfaceRfChannelNr6gDash151Dash6705Dash80 captures enum value "6g-151-6705-80" + WritableInterfaceRfChannelNr6gDash151Dash6705Dash80 string = "6g-151-6705-80" + + // WritableInterfaceRfChannelNr6gDash153Dash6715Dash20 captures enum value "6g-153-6715-20" + WritableInterfaceRfChannelNr6gDash153Dash6715Dash20 string = "6g-153-6715-20" + + // WritableInterfaceRfChannelNr6gDash155Dash6725Dash40 captures enum value "6g-155-6725-40" + WritableInterfaceRfChannelNr6gDash155Dash6725Dash40 string = "6g-155-6725-40" + + // WritableInterfaceRfChannelNr6gDash157Dash6735Dash20 captures enum value "6g-157-6735-20" + WritableInterfaceRfChannelNr6gDash157Dash6735Dash20 string = "6g-157-6735-20" + + // WritableInterfaceRfChannelNr6gDash159Dash6745Dash320 captures enum value "6g-159-6745-320" + WritableInterfaceRfChannelNr6gDash159Dash6745Dash320 string = "6g-159-6745-320" + + // WritableInterfaceRfChannelNr6gDash161Dash6755Dash20 captures enum value "6g-161-6755-20" + WritableInterfaceRfChannelNr6gDash161Dash6755Dash20 string = "6g-161-6755-20" + + // WritableInterfaceRfChannelNr6gDash163Dash6765Dash40 captures enum value "6g-163-6765-40" + WritableInterfaceRfChannelNr6gDash163Dash6765Dash40 string = "6g-163-6765-40" + + // WritableInterfaceRfChannelNr6gDash165Dash6775Dash20 captures enum value "6g-165-6775-20" + WritableInterfaceRfChannelNr6gDash165Dash6775Dash20 string = "6g-165-6775-20" + + // WritableInterfaceRfChannelNr6gDash167Dash6785Dash80 captures enum value "6g-167-6785-80" + WritableInterfaceRfChannelNr6gDash167Dash6785Dash80 string = "6g-167-6785-80" + + // WritableInterfaceRfChannelNr6gDash169Dash6795Dash20 captures enum value "6g-169-6795-20" + WritableInterfaceRfChannelNr6gDash169Dash6795Dash20 string = "6g-169-6795-20" + + // WritableInterfaceRfChannelNr6gDash171Dash6805Dash40 captures enum value "6g-171-6805-40" + WritableInterfaceRfChannelNr6gDash171Dash6805Dash40 string = "6g-171-6805-40" + + // WritableInterfaceRfChannelNr6gDash173Dash6815Dash20 captures enum value "6g-173-6815-20" + WritableInterfaceRfChannelNr6gDash173Dash6815Dash20 string = "6g-173-6815-20" + + // WritableInterfaceRfChannelNr6gDash175Dash6825Dash160 captures enum value "6g-175-6825-160" + WritableInterfaceRfChannelNr6gDash175Dash6825Dash160 string = "6g-175-6825-160" + + // WritableInterfaceRfChannelNr6gDash177Dash6835Dash20 captures enum value "6g-177-6835-20" + WritableInterfaceRfChannelNr6gDash177Dash6835Dash20 string = "6g-177-6835-20" + + // WritableInterfaceRfChannelNr6gDash179Dash6845Dash40 captures enum value "6g-179-6845-40" + WritableInterfaceRfChannelNr6gDash179Dash6845Dash40 string = "6g-179-6845-40" + + // WritableInterfaceRfChannelNr6gDash181Dash6855Dash20 captures enum value "6g-181-6855-20" + WritableInterfaceRfChannelNr6gDash181Dash6855Dash20 string = "6g-181-6855-20" + + // WritableInterfaceRfChannelNr6gDash183Dash6865Dash80 captures enum value "6g-183-6865-80" + WritableInterfaceRfChannelNr6gDash183Dash6865Dash80 string = "6g-183-6865-80" + + // WritableInterfaceRfChannelNr6gDash185Dash6875Dash20 captures enum value "6g-185-6875-20" + WritableInterfaceRfChannelNr6gDash185Dash6875Dash20 string = "6g-185-6875-20" + + // WritableInterfaceRfChannelNr6gDash187Dash6885Dash40 captures enum value "6g-187-6885-40" + WritableInterfaceRfChannelNr6gDash187Dash6885Dash40 string = "6g-187-6885-40" + + // WritableInterfaceRfChannelNr6gDash189Dash6895Dash20 captures enum value "6g-189-6895-20" + WritableInterfaceRfChannelNr6gDash189Dash6895Dash20 string = "6g-189-6895-20" + + // WritableInterfaceRfChannelNr6gDash193Dash6915Dash20 captures enum value "6g-193-6915-20" + WritableInterfaceRfChannelNr6gDash193Dash6915Dash20 string = "6g-193-6915-20" + + // WritableInterfaceRfChannelNr6gDash195Dash6925Dash40 captures enum value "6g-195-6925-40" + WritableInterfaceRfChannelNr6gDash195Dash6925Dash40 string = "6g-195-6925-40" + + // WritableInterfaceRfChannelNr6gDash197Dash6935Dash20 captures enum value "6g-197-6935-20" + WritableInterfaceRfChannelNr6gDash197Dash6935Dash20 string = "6g-197-6935-20" + + // WritableInterfaceRfChannelNr6gDash199Dash6945Dash80 captures enum value "6g-199-6945-80" + WritableInterfaceRfChannelNr6gDash199Dash6945Dash80 string = "6g-199-6945-80" + + // WritableInterfaceRfChannelNr6gDash201Dash6955Dash20 captures enum value "6g-201-6955-20" + WritableInterfaceRfChannelNr6gDash201Dash6955Dash20 string = "6g-201-6955-20" + + // WritableInterfaceRfChannelNr6gDash203Dash6965Dash40 captures enum value "6g-203-6965-40" + WritableInterfaceRfChannelNr6gDash203Dash6965Dash40 string = "6g-203-6965-40" + + // WritableInterfaceRfChannelNr6gDash205Dash6975Dash20 captures enum value "6g-205-6975-20" + WritableInterfaceRfChannelNr6gDash205Dash6975Dash20 string = "6g-205-6975-20" + + // WritableInterfaceRfChannelNr6gDash207Dash6985Dash160 captures enum value "6g-207-6985-160" + WritableInterfaceRfChannelNr6gDash207Dash6985Dash160 string = "6g-207-6985-160" + + // WritableInterfaceRfChannelNr6gDash209Dash6995Dash20 captures enum value "6g-209-6995-20" + WritableInterfaceRfChannelNr6gDash209Dash6995Dash20 string = "6g-209-6995-20" + + // WritableInterfaceRfChannelNr6gDash211Dash7005Dash40 captures enum value "6g-211-7005-40" + WritableInterfaceRfChannelNr6gDash211Dash7005Dash40 string = "6g-211-7005-40" + + // WritableInterfaceRfChannelNr6gDash213Dash7015Dash20 captures enum value "6g-213-7015-20" + WritableInterfaceRfChannelNr6gDash213Dash7015Dash20 string = "6g-213-7015-20" + + // WritableInterfaceRfChannelNr6gDash215Dash7025Dash80 captures enum value "6g-215-7025-80" + WritableInterfaceRfChannelNr6gDash215Dash7025Dash80 string = "6g-215-7025-80" + + // WritableInterfaceRfChannelNr6gDash217Dash7035Dash20 captures enum value "6g-217-7035-20" + WritableInterfaceRfChannelNr6gDash217Dash7035Dash20 string = "6g-217-7035-20" + + // WritableInterfaceRfChannelNr6gDash219Dash7045Dash40 captures enum value "6g-219-7045-40" + WritableInterfaceRfChannelNr6gDash219Dash7045Dash40 string = "6g-219-7045-40" + + // WritableInterfaceRfChannelNr6gDash221Dash7055Dash20 captures enum value "6g-221-7055-20" + WritableInterfaceRfChannelNr6gDash221Dash7055Dash20 string = "6g-221-7055-20" + + // WritableInterfaceRfChannelNr6gDash225Dash7075Dash20 captures enum value "6g-225-7075-20" + WritableInterfaceRfChannelNr6gDash225Dash7075Dash20 string = "6g-225-7075-20" + + // WritableInterfaceRfChannelNr6gDash227Dash7085Dash40 captures enum value "6g-227-7085-40" + WritableInterfaceRfChannelNr6gDash227Dash7085Dash40 string = "6g-227-7085-40" + + // WritableInterfaceRfChannelNr6gDash229Dash7095Dash20 captures enum value "6g-229-7095-20" + WritableInterfaceRfChannelNr6gDash229Dash7095Dash20 string = "6g-229-7095-20" + + // WritableInterfaceRfChannelNr6gDash233Dash7115Dash20 captures enum value "6g-233-7115-20" + WritableInterfaceRfChannelNr6gDash233Dash7115Dash20 string = "6g-233-7115-20" + + // WritableInterfaceRfChannelNr60gDash1Dash58320Dash2160 captures enum value "60g-1-58320-2160" + WritableInterfaceRfChannelNr60gDash1Dash58320Dash2160 string = "60g-1-58320-2160" + + // WritableInterfaceRfChannelNr60gDash2Dash60480Dash2160 captures enum value "60g-2-60480-2160" + WritableInterfaceRfChannelNr60gDash2Dash60480Dash2160 string = "60g-2-60480-2160" + + // WritableInterfaceRfChannelNr60gDash3Dash62640Dash2160 captures enum value "60g-3-62640-2160" + WritableInterfaceRfChannelNr60gDash3Dash62640Dash2160 string = "60g-3-62640-2160" + + // WritableInterfaceRfChannelNr60gDash4Dash64800Dash2160 captures enum value "60g-4-64800-2160" + WritableInterfaceRfChannelNr60gDash4Dash64800Dash2160 string = "60g-4-64800-2160" + + // WritableInterfaceRfChannelNr60gDash5Dash66960Dash2160 captures enum value "60g-5-66960-2160" + WritableInterfaceRfChannelNr60gDash5Dash66960Dash2160 string = "60g-5-66960-2160" + + // WritableInterfaceRfChannelNr60gDash6Dash69120Dash2160 captures enum value "60g-6-69120-2160" + WritableInterfaceRfChannelNr60gDash6Dash69120Dash2160 string = "60g-6-69120-2160" + + // WritableInterfaceRfChannelNr60gDash9Dash59400Dash4320 captures enum value "60g-9-59400-4320" + WritableInterfaceRfChannelNr60gDash9Dash59400Dash4320 string = "60g-9-59400-4320" + + // WritableInterfaceRfChannelNr60gDash10Dash61560Dash4320 captures enum value "60g-10-61560-4320" + WritableInterfaceRfChannelNr60gDash10Dash61560Dash4320 string = "60g-10-61560-4320" + + // WritableInterfaceRfChannelNr60gDash11Dash63720Dash4320 captures enum value "60g-11-63720-4320" + WritableInterfaceRfChannelNr60gDash11Dash63720Dash4320 string = "60g-11-63720-4320" + + // WritableInterfaceRfChannelNr60gDash12Dash65880Dash4320 captures enum value "60g-12-65880-4320" + WritableInterfaceRfChannelNr60gDash12Dash65880Dash4320 string = "60g-12-65880-4320" + + // WritableInterfaceRfChannelNr60gDash13Dash68040Dash4320 captures enum value "60g-13-68040-4320" + WritableInterfaceRfChannelNr60gDash13Dash68040Dash4320 string = "60g-13-68040-4320" + + // WritableInterfaceRfChannelNr60gDash17Dash60480Dash6480 captures enum value "60g-17-60480-6480" + WritableInterfaceRfChannelNr60gDash17Dash60480Dash6480 string = "60g-17-60480-6480" + + // WritableInterfaceRfChannelNr60gDash18Dash62640Dash6480 captures enum value "60g-18-62640-6480" + WritableInterfaceRfChannelNr60gDash18Dash62640Dash6480 string = "60g-18-62640-6480" + + // WritableInterfaceRfChannelNr60gDash19Dash64800Dash6480 captures enum value "60g-19-64800-6480" + WritableInterfaceRfChannelNr60gDash19Dash64800Dash6480 string = "60g-19-64800-6480" + + // WritableInterfaceRfChannelNr60gDash20Dash66960Dash6480 captures enum value "60g-20-66960-6480" + WritableInterfaceRfChannelNr60gDash20Dash66960Dash6480 string = "60g-20-66960-6480" + + // WritableInterfaceRfChannelNr60gDash25Dash61560Dash6480 captures enum value "60g-25-61560-6480" + WritableInterfaceRfChannelNr60gDash25Dash61560Dash6480 string = "60g-25-61560-6480" + + // WritableInterfaceRfChannelNr60gDash26Dash63720Dash6480 captures enum value "60g-26-63720-6480" + WritableInterfaceRfChannelNr60gDash26Dash63720Dash6480 string = "60g-26-63720-6480" + + // WritableInterfaceRfChannelNr60gDash27Dash65880Dash6480 captures enum value "60g-27-65880-6480" + WritableInterfaceRfChannelNr60gDash27Dash65880Dash6480 string = "60g-27-65880-6480" +) + +// prop value enum +func (m *WritableInterface) validateRfChannelEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableInterfaceTypeRfChannelPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableInterface) validateRfChannel(formats strfmt.Registry) error { + if swag.IsZero(m.RfChannel) { // not required + return nil + } + + // value enum + if err := m.validateRfChannelEnum("rf_channel", "body", m.RfChannel); err != nil { + return err + } + + return nil +} + +var writableInterfaceTypeRfRolePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ap","station"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceTypeRfRolePropEnum = append(writableInterfaceTypeRfRolePropEnum, v) + } +} + +const ( + + // WritableInterfaceRfRoleAp captures enum value "ap" + WritableInterfaceRfRoleAp string = "ap" + + // WritableInterfaceRfRoleStation captures enum value "station" + WritableInterfaceRfRoleStation string = "station" +) + +// prop value enum +func (m *WritableInterface) validateRfRoleEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableInterfaceTypeRfRolePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableInterface) validateRfRole(formats strfmt.Registry) error { + if swag.IsZero(m.RfRole) { // not required + return nil + } + + // value enum + if err := m.validateRfRoleEnum("rf_role", "body", m.RfRole); err != nil { + return err + } + + return nil +} + func (m *WritableInterface) validateTaggedVlans(formats strfmt.Registry) error { if swag.IsZero(m.TaggedVlans) { // not required return nil @@ -422,11 +1145,27 @@ func (m *WritableInterface) validateTags(formats strfmt.Registry) error { return nil } +func (m *WritableInterface) validateTxPower(formats strfmt.Registry) error { + if swag.IsZero(m.TxPower) { // not required + return nil + } + + if err := validate.MinimumInt("tx_power", "body", *m.TxPower, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("tx_power", "body", *m.TxPower, 127, false); err != nil { + return err + } + + return nil +} + var writableInterfaceTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["virtual","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-sfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["virtual","bridge","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-qsfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","cisco-stackwise-80","cisco-stackwise-160","cisco-stackwise-320","cisco-stackwise-480","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -439,6 +1178,9 @@ const ( // WritableInterfaceTypeVirtual captures enum value "virtual" WritableInterfaceTypeVirtual string = "virtual" + // WritableInterfaceTypeBridge captures enum value "bridge" + WritableInterfaceTypeBridge string = "bridge" + // WritableInterfaceTypeLag captures enum value "lag" WritableInterfaceTypeLag string = "lag" @@ -589,8 +1331,8 @@ const ( // WritableInterfaceTypeNr64gfcDashQsfpp captures enum value "64gfc-qsfpp" WritableInterfaceTypeNr64gfcDashQsfpp string = "64gfc-qsfpp" - // WritableInterfaceTypeNr128gfcDashSfp28 captures enum value "128gfc-sfp28" - WritableInterfaceTypeNr128gfcDashSfp28 string = "128gfc-sfp28" + // WritableInterfaceTypeNr128gfcDashQsfp28 captures enum value "128gfc-qsfp28" + WritableInterfaceTypeNr128gfcDashQsfp28 string = "128gfc-qsfp28" // WritableInterfaceTypeInfinibandDashSdr captures enum value "infiniband-sdr" WritableInterfaceTypeInfinibandDashSdr string = "infiniband-sdr" @@ -646,6 +1388,18 @@ const ( // WritableInterfaceTypeCiscoDashFlexstackDashPlus captures enum value "cisco-flexstack-plus" WritableInterfaceTypeCiscoDashFlexstackDashPlus string = "cisco-flexstack-plus" + // WritableInterfaceTypeCiscoDashStackwiseDash80 captures enum value "cisco-stackwise-80" + WritableInterfaceTypeCiscoDashStackwiseDash80 string = "cisco-stackwise-80" + + // WritableInterfaceTypeCiscoDashStackwiseDash160 captures enum value "cisco-stackwise-160" + WritableInterfaceTypeCiscoDashStackwiseDash160 string = "cisco-stackwise-160" + + // WritableInterfaceTypeCiscoDashStackwiseDash320 captures enum value "cisco-stackwise-320" + WritableInterfaceTypeCiscoDashStackwiseDash320 string = "cisco-stackwise-320" + + // WritableInterfaceTypeCiscoDashStackwiseDash480 captures enum value "cisco-stackwise-480" + WritableInterfaceTypeCiscoDashStackwiseDash480 string = "cisco-stackwise-480" + // WritableInterfaceTypeJuniperDashVcp captures enum value "juniper-vcp" WritableInterfaceTypeJuniperDashVcp string = "juniper-vcp" @@ -699,6 +1453,18 @@ func (m *WritableInterface) validateURL(formats strfmt.Registry) error { return nil } +func (m *WritableInterface) validateWirelessLans(formats strfmt.Registry) error { + if swag.IsZero(m.WirelessLans) { // not required + return nil + } + + if err := validate.UniqueItems("wireless_lans", "body", m.WirelessLans); err != nil { + return err + } + + return nil +} + // ContextValidate validate this writable interface based on the context it is used func (m *WritableInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -711,14 +1477,6 @@ func (m *WritableInterface) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -731,6 +1489,10 @@ func (m *WritableInterface) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateCountFhrpGroups(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCountIpaddresses(ctx, formats); err != nil { res = append(res, err) } @@ -751,6 +1513,14 @@ func (m *WritableInterface) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -790,37 +1560,32 @@ func (m *WritableInterface) contextValidateCable(ctx context.Context, formats st return nil } -func (m *WritableInterface) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { +func (m *WritableInterface) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil } -func (m *WritableInterface) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { +func (m *WritableInterface) contextValidateConnectedEndpointReachable(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoint_reachable", "body", m.ConnectedEndpointReachable); err != nil { return err } return nil } -func (m *WritableInterface) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritableInterface) contextValidateConnectedEndpointReachable(ctx context.Context, formats strfmt.Registry) error { +func (m *WritableInterface) contextValidateConnectedEndpointType(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoint_reachable", "body", m.ConnectedEndpointReachable); err != nil { + if err := validate.ReadOnly(ctx, "connected_endpoint_type", "body", string(m.ConnectedEndpointType)); err != nil { return err } return nil } -func (m *WritableInterface) contextValidateConnectedEndpointType(ctx context.Context, formats strfmt.Registry) error { +func (m *WritableInterface) contextValidateCountFhrpGroups(ctx context.Context, formats strfmt.Registry) error { - if err := validate.ReadOnly(ctx, "connected_endpoint_type", "body", string(m.ConnectedEndpointType)); err != nil { + if err := validate.ReadOnly(ctx, "count_fhrp_groups", "body", int64(m.CountFhrpGroups)); err != nil { return err } @@ -872,6 +1637,20 @@ func (m *WritableInterface) contextValidateLastUpdated(ctx context.Context, form return nil } +func (m *WritableInterface) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableInterface) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritableInterface) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface_template.go index c4a28dda7..e26e741ce 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_interface_template.go @@ -78,7 +78,7 @@ type WritableInterfaceTemplate struct { // Type // Required: true - // Enum: [virtual lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-sfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] + // Enum: [virtual bridge lag 100base-tx 1000base-t 2.5gbase-t 5gbase-t 10gbase-t 10gbase-cx4 1000base-x-gbic 1000base-x-sfp 10gbase-x-sfpp 10gbase-x-xfp 10gbase-x-xenpak 10gbase-x-x2 25gbase-x-sfp28 50gbase-x-sfp56 40gbase-x-qsfpp 50gbase-x-sfp28 100gbase-x-cfp 100gbase-x-cfp2 200gbase-x-cfp2 100gbase-x-cfp4 100gbase-x-cpak 100gbase-x-qsfp28 200gbase-x-qsfp56 400gbase-x-qsfpdd 400gbase-x-osfp ieee802.11a ieee802.11g ieee802.11n ieee802.11ac ieee802.11ad ieee802.11ax ieee802.15.1 gsm cdma lte sonet-oc3 sonet-oc12 sonet-oc48 sonet-oc192 sonet-oc768 sonet-oc1920 sonet-oc3840 1gfc-sfp 2gfc-sfp 4gfc-sfp 8gfc-sfpp 16gfc-sfpp 32gfc-sfp28 64gfc-qsfpp 128gfc-qsfp28 infiniband-sdr infiniband-ddr infiniband-qdr infiniband-fdr10 infiniband-fdr infiniband-edr infiniband-hdr infiniband-ndr infiniband-xdr t1 e1 t3 e3 xdsl cisco-stackwise cisco-stackwise-plus cisco-flexstack cisco-flexstack-plus cisco-stackwise-80 cisco-stackwise-160 cisco-stackwise-320 cisco-stackwise-480 juniper-vcp extreme-summitstack extreme-summitstack-128 extreme-summitstack-256 extreme-summitstack-512 other] Type *string `json:"type"` // Url @@ -207,7 +207,7 @@ var writableInterfaceTemplateTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["virtual","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-sfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["virtual","bridge","lag","100base-tx","1000base-t","2.5gbase-t","5gbase-t","10gbase-t","10gbase-cx4","1000base-x-gbic","1000base-x-sfp","10gbase-x-sfpp","10gbase-x-xfp","10gbase-x-xenpak","10gbase-x-x2","25gbase-x-sfp28","50gbase-x-sfp56","40gbase-x-qsfpp","50gbase-x-sfp28","100gbase-x-cfp","100gbase-x-cfp2","200gbase-x-cfp2","100gbase-x-cfp4","100gbase-x-cpak","100gbase-x-qsfp28","200gbase-x-qsfp56","400gbase-x-qsfpdd","400gbase-x-osfp","ieee802.11a","ieee802.11g","ieee802.11n","ieee802.11ac","ieee802.11ad","ieee802.11ax","ieee802.15.1","gsm","cdma","lte","sonet-oc3","sonet-oc12","sonet-oc48","sonet-oc192","sonet-oc768","sonet-oc1920","sonet-oc3840","1gfc-sfp","2gfc-sfp","4gfc-sfp","8gfc-sfpp","16gfc-sfpp","32gfc-sfp28","64gfc-qsfpp","128gfc-qsfp28","infiniband-sdr","infiniband-ddr","infiniband-qdr","infiniband-fdr10","infiniband-fdr","infiniband-edr","infiniband-hdr","infiniband-ndr","infiniband-xdr","t1","e1","t3","e3","xdsl","cisco-stackwise","cisco-stackwise-plus","cisco-flexstack","cisco-flexstack-plus","cisco-stackwise-80","cisco-stackwise-160","cisco-stackwise-320","cisco-stackwise-480","juniper-vcp","extreme-summitstack","extreme-summitstack-128","extreme-summitstack-256","extreme-summitstack-512","other"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -220,6 +220,9 @@ const ( // WritableInterfaceTemplateTypeVirtual captures enum value "virtual" WritableInterfaceTemplateTypeVirtual string = "virtual" + // WritableInterfaceTemplateTypeBridge captures enum value "bridge" + WritableInterfaceTemplateTypeBridge string = "bridge" + // WritableInterfaceTemplateTypeLag captures enum value "lag" WritableInterfaceTemplateTypeLag string = "lag" @@ -370,8 +373,8 @@ const ( // WritableInterfaceTemplateTypeNr64gfcDashQsfpp captures enum value "64gfc-qsfpp" WritableInterfaceTemplateTypeNr64gfcDashQsfpp string = "64gfc-qsfpp" - // WritableInterfaceTemplateTypeNr128gfcDashSfp28 captures enum value "128gfc-sfp28" - WritableInterfaceTemplateTypeNr128gfcDashSfp28 string = "128gfc-sfp28" + // WritableInterfaceTemplateTypeNr128gfcDashQsfp28 captures enum value "128gfc-qsfp28" + WritableInterfaceTemplateTypeNr128gfcDashQsfp28 string = "128gfc-qsfp28" // WritableInterfaceTemplateTypeInfinibandDashSdr captures enum value "infiniband-sdr" WritableInterfaceTemplateTypeInfinibandDashSdr string = "infiniband-sdr" @@ -427,6 +430,18 @@ const ( // WritableInterfaceTemplateTypeCiscoDashFlexstackDashPlus captures enum value "cisco-flexstack-plus" WritableInterfaceTemplateTypeCiscoDashFlexstackDashPlus string = "cisco-flexstack-plus" + // WritableInterfaceTemplateTypeCiscoDashStackwiseDash80 captures enum value "cisco-stackwise-80" + WritableInterfaceTemplateTypeCiscoDashStackwiseDash80 string = "cisco-stackwise-80" + + // WritableInterfaceTemplateTypeCiscoDashStackwiseDash160 captures enum value "cisco-stackwise-160" + WritableInterfaceTemplateTypeCiscoDashStackwiseDash160 string = "cisco-stackwise-160" + + // WritableInterfaceTemplateTypeCiscoDashStackwiseDash320 captures enum value "cisco-stackwise-320" + WritableInterfaceTemplateTypeCiscoDashStackwiseDash320 string = "cisco-stackwise-320" + + // WritableInterfaceTemplateTypeCiscoDashStackwiseDash480 captures enum value "cisco-stackwise-480" + WritableInterfaceTemplateTypeCiscoDashStackwiseDash480 string = "cisco-stackwise-480" + // WritableInterfaceTemplateTypeJuniperDashVcp captures enum value "juniper-vcp" WritableInterfaceTemplateTypeJuniperDashVcp string = "juniper-vcp" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_ip_address.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_ip_address.go index ac8956b52..466ca16ed 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_ip_address.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_ip_address.go @@ -74,7 +74,7 @@ type WritableIPAddress struct { // // Hostname or FQDN (not case-sensitive) // Max Length: 255 - // Pattern: ^[0-9A-Za-z._-]+$ + // Pattern: ^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$ DNSName string `json:"dns_name,omitempty"` // Family @@ -234,7 +234,7 @@ func (m *WritableIPAddress) validateDNSName(formats strfmt.Registry) error { return err } - if err := validate.Pattern("dns_name", "body", m.DNSName, `^[0-9A-Za-z._-]+$`); err != nil { + if err := validate.Pattern("dns_name", "body", m.DNSName, `^([0-9A-Za-z_-]+|\*)(\.[0-9A-Za-z_-]+)*\.?$`); err != nil { return err } diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_location.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_location.go index 24c19dd09..4e2e51c55 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_location.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_location.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -91,6 +92,12 @@ type WritableLocation struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + + // Tenant + Tenant *int64 `json:"tenant,omitempty"` + // Url // Read Only: true // Format: uri @@ -125,6 +132,10 @@ func (m *WritableLocation) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -218,6 +229,32 @@ func (m *WritableLocation) validateSlug(formats strfmt.Registry) error { return nil } +func (m *WritableLocation) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableLocation) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -262,6 +299,10 @@ func (m *WritableLocation) ContextValidate(ctx context.Context, formats strfmt.R res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -335,6 +376,26 @@ func (m *WritableLocation) contextValidateRackCount(ctx context.Context, formats return nil } +func (m *WritableLocation) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableLocation) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_platform.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_platform.go index 04e45d22e..80149fe94 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_platform.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_platform.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -92,6 +93,9 @@ type WritablePlatform struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -130,6 +134,10 @@ func (m *WritablePlatform) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -226,6 +234,32 @@ func (m *WritablePlatform) validateSlug(formats strfmt.Registry) error { return nil } +func (m *WritablePlatform) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritablePlatform) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -262,6 +296,10 @@ func (m *WritablePlatform) ContextValidate(ctx context.Context, formats strfmt.R res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -321,6 +359,26 @@ func (m *WritablePlatform) contextValidateLastUpdated(ctx context.Context, forma return nil } +func (m *WritablePlatform) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritablePlatform) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_feed.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_feed.go index 7a21f187d..8fbbc695c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_feed.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_feed.go @@ -48,18 +48,6 @@ type WritablePowerFeed struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Comments Comments string `json:"comments,omitempty"` @@ -100,6 +88,18 @@ type WritablePowerFeed struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -562,14 +562,6 @@ func (m *WritablePowerFeed) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -598,6 +590,14 @@ func (m *WritablePowerFeed) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -637,20 +637,6 @@ func (m *WritablePowerFeed) contextValidateCable(ctx context.Context, formats st return nil } -func (m *WritablePowerFeed) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritablePowerFeed) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *WritablePowerFeed) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -710,6 +696,20 @@ func (m *WritablePowerFeed) contextValidateLastUpdated(ctx context.Context, form return nil } +func (m *WritablePowerFeed) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritablePowerFeed) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritablePowerFeed) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet.go index 8731067f0..187db30ac 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet.go @@ -43,18 +43,6 @@ type WritablePowerOutlet struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -112,6 +100,18 @@ type WritablePowerOutlet struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -132,7 +132,7 @@ type WritablePowerOutlet struct { // Type // // Physical port type - // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] + // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r nema-l22-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o ita-multistandard usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] Type string `json:"type,omitempty"` // Url @@ -363,7 +363,7 @@ var writablePowerOutletTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","nema-l22-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","ita-multistandard","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -547,6 +547,9 @@ const ( // WritablePowerOutletTypeNemaDashL21Dash30r captures enum value "nema-l21-30r" WritablePowerOutletTypeNemaDashL21Dash30r string = "nema-l21-30r" + // WritablePowerOutletTypeNemaDashL22Dash30r captures enum value "nema-l22-30r" + WritablePowerOutletTypeNemaDashL22Dash30r string = "nema-l22-30r" + // WritablePowerOutletTypeCS6360C captures enum value "CS6360C" WritablePowerOutletTypeCS6360C string = "CS6360C" @@ -598,6 +601,9 @@ const ( // WritablePowerOutletTypeItaDasho captures enum value "ita-o" WritablePowerOutletTypeItaDasho string = "ita-o" + // WritablePowerOutletTypeItaDashMultistandard captures enum value "ita-multistandard" + WritablePowerOutletTypeItaDashMultistandard string = "ita-multistandard" + // WritablePowerOutletTypeUsbDasha captures enum value "usb-a" WritablePowerOutletTypeUsbDasha string = "usb-a" @@ -665,14 +671,6 @@ func (m *WritablePowerOutlet) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -701,6 +699,14 @@ func (m *WritablePowerOutlet) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -740,20 +746,6 @@ func (m *WritablePowerOutlet) contextValidateCable(ctx context.Context, formats return nil } -func (m *WritablePowerOutlet) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritablePowerOutlet) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *WritablePowerOutlet) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -813,6 +805,20 @@ func (m *WritablePowerOutlet) contextValidateLastUpdated(ctx context.Context, fo return nil } +func (m *WritablePowerOutlet) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritablePowerOutlet) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritablePowerOutlet) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet_template.go index ae94dfb8a..25748123e 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_outlet_template.go @@ -83,7 +83,7 @@ type WritablePowerOutletTemplate struct { PowerPort *int64 `json:"power_port,omitempty"` // Type - // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] + // Enum: [iec-60320-c5 iec-60320-c7 iec-60320-c13 iec-60320-c15 iec-60320-c19 iec-60320-c21 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15r nema-5-15r nema-5-20r nema-5-30r nema-5-50r nema-6-15r nema-6-20r nema-6-30r nema-6-50r nema-10-30r nema-10-50r nema-14-20r nema-14-30r nema-14-50r nema-14-60r nema-15-15r nema-15-20r nema-15-30r nema-15-50r nema-15-60r nema-l1-15r nema-l5-15r nema-l5-20r nema-l5-30r nema-l5-50r nema-l6-15r nema-l6-20r nema-l6-30r nema-l6-50r nema-l10-30r nema-l14-20r nema-l14-30r nema-l14-50r nema-l14-60r nema-l15-20r nema-l15-30r nema-l15-50r nema-l15-60r nema-l21-20r nema-l21-30r nema-l22-30r CS6360C CS6364C CS8164C CS8264C CS8364C CS8464C ita-e ita-f ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o ita-multistandard usb-a usb-micro-b usb-c dc-terminal hdot-cx saf-d-grid hardwired] Type string `json:"type,omitempty"` // Url @@ -261,7 +261,7 @@ var writablePowerOutletTemplateTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c5","iec-60320-c7","iec-60320-c13","iec-60320-c15","iec-60320-c19","iec-60320-c21","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15r","nema-5-15r","nema-5-20r","nema-5-30r","nema-5-50r","nema-6-15r","nema-6-20r","nema-6-30r","nema-6-50r","nema-10-30r","nema-10-50r","nema-14-20r","nema-14-30r","nema-14-50r","nema-14-60r","nema-15-15r","nema-15-20r","nema-15-30r","nema-15-50r","nema-15-60r","nema-l1-15r","nema-l5-15r","nema-l5-20r","nema-l5-30r","nema-l5-50r","nema-l6-15r","nema-l6-20r","nema-l6-30r","nema-l6-50r","nema-l10-30r","nema-l14-20r","nema-l14-30r","nema-l14-50r","nema-l14-60r","nema-l15-20r","nema-l15-30r","nema-l15-50r","nema-l15-60r","nema-l21-20r","nema-l21-30r","nema-l22-30r","CS6360C","CS6364C","CS8164C","CS8264C","CS8364C","CS8464C","ita-e","ita-f","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","ita-multistandard","usb-a","usb-micro-b","usb-c","dc-terminal","hdot-cx","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -445,6 +445,9 @@ const ( // WritablePowerOutletTemplateTypeNemaDashL21Dash30r captures enum value "nema-l21-30r" WritablePowerOutletTemplateTypeNemaDashL21Dash30r string = "nema-l21-30r" + // WritablePowerOutletTemplateTypeNemaDashL22Dash30r captures enum value "nema-l22-30r" + WritablePowerOutletTemplateTypeNemaDashL22Dash30r string = "nema-l22-30r" + // WritablePowerOutletTemplateTypeCS6360C captures enum value "CS6360C" WritablePowerOutletTemplateTypeCS6360C string = "CS6360C" @@ -496,6 +499,9 @@ const ( // WritablePowerOutletTemplateTypeItaDasho captures enum value "ita-o" WritablePowerOutletTemplateTypeItaDasho string = "ita-o" + // WritablePowerOutletTemplateTypeItaDashMultistandard captures enum value "ita-multistandard" + WritablePowerOutletTemplateTypeItaDashMultistandard string = "ita-multistandard" + // WritablePowerOutletTemplateTypeUsbDasha captures enum value "usb-a" WritablePowerOutletTemplateTypeUsbDasha string = "usb-a" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_panel.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_panel.go index 48fa7087f..1da5770ab 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_panel.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_panel.go @@ -35,6 +35,11 @@ import ( // swagger:model WritablePowerPanel type WritablePowerPanel struct { + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -46,6 +51,11 @@ type WritablePowerPanel struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Location Location *int64 `json:"location,omitempty"` @@ -76,6 +86,14 @@ type WritablePowerPanel struct { func (m *WritablePowerPanel) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -98,6 +116,30 @@ func (m *WritablePowerPanel) Validate(formats strfmt.Registry) error { return nil } +func (m *WritablePowerPanel) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPanel) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPanel) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -166,6 +208,10 @@ func (m *WritablePowerPanel) validateURL(formats strfmt.Registry) error { func (m *WritablePowerPanel) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -174,6 +220,10 @@ func (m *WritablePowerPanel) ContextValidate(ctx context.Context, formats strfmt res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidatePowerfeedCount(ctx, formats); err != nil { res = append(res, err) } @@ -192,6 +242,15 @@ func (m *WritablePowerPanel) ContextValidate(ctx context.Context, formats strfmt return nil } +func (m *WritablePowerPanel) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPanel) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -210,6 +269,15 @@ func (m *WritablePowerPanel) contextValidateID(ctx context.Context, formats strf return nil } +func (m *WritablePowerPanel) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPanel) contextValidatePowerfeedCount(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "powerfeed_count", "body", int64(m.PowerfeedCount)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port.go index 78c60ccda..002889441 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port.go @@ -50,18 +50,6 @@ type WritablePowerPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Connected endpoint // // @@ -113,6 +101,18 @@ type WritablePowerPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -137,7 +137,7 @@ type WritablePowerPort struct { // Type // // Physical port type - // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] + // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p nema-l22-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] Type string `json:"type,omitempty"` // Url @@ -359,7 +359,7 @@ var writablePowerPortTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","nema-l22-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -543,6 +543,9 @@ const ( // WritablePowerPortTypeNemaDashL21Dash30p captures enum value "nema-l21-30p" WritablePowerPortTypeNemaDashL21Dash30p string = "nema-l21-30p" + // WritablePowerPortTypeNemaDashL22Dash30p captures enum value "nema-l22-30p" + WritablePowerPortTypeNemaDashL22Dash30p string = "nema-l22-30p" + // WritablePowerPortTypeCs6361c captures enum value "cs6361c" WritablePowerPortTypeCs6361c string = "cs6361c" @@ -685,14 +688,6 @@ func (m *WritablePowerPort) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateConnectedEndpoint(ctx, formats); err != nil { res = append(res, err) } @@ -721,6 +716,14 @@ func (m *WritablePowerPort) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -760,20 +763,6 @@ func (m *WritablePowerPort) contextValidateCable(ctx context.Context, formats st return nil } -func (m *WritablePowerPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritablePowerPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *WritablePowerPort) contextValidateConnectedEndpoint(ctx context.Context, formats strfmt.Registry) error { return nil @@ -833,6 +822,20 @@ func (m *WritablePowerPort) contextValidateLastUpdated(ctx context.Context, form return nil } +func (m *WritablePowerPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritablePowerPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port_template.go index 3697c655d..8c7367e71 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_power_port_template.go @@ -88,7 +88,7 @@ type WritablePowerPortTemplate struct { Name *string `json:"name"` // Type - // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] + // Enum: [iec-60320-c6 iec-60320-c8 iec-60320-c14 iec-60320-c16 iec-60320-c20 iec-60320-c22 iec-60309-p-n-e-4h iec-60309-p-n-e-6h iec-60309-p-n-e-9h iec-60309-2p-e-4h iec-60309-2p-e-6h iec-60309-2p-e-9h iec-60309-3p-e-4h iec-60309-3p-e-6h iec-60309-3p-e-9h iec-60309-3p-n-e-4h iec-60309-3p-n-e-6h iec-60309-3p-n-e-9h nema-1-15p nema-5-15p nema-5-20p nema-5-30p nema-5-50p nema-6-15p nema-6-20p nema-6-30p nema-6-50p nema-10-30p nema-10-50p nema-14-20p nema-14-30p nema-14-50p nema-14-60p nema-15-15p nema-15-20p nema-15-30p nema-15-50p nema-15-60p nema-l1-15p nema-l5-15p nema-l5-20p nema-l5-30p nema-l5-50p nema-l6-15p nema-l6-20p nema-l6-30p nema-l6-50p nema-l10-30p nema-l14-20p nema-l14-30p nema-l14-50p nema-l14-60p nema-l15-20p nema-l15-30p nema-l15-50p nema-l15-60p nema-l21-20p nema-l21-30p nema-l22-30p cs6361c cs6365c cs8165c cs8265c cs8365c cs8465c ita-c ita-e ita-f ita-ef ita-g ita-h ita-i ita-j ita-k ita-l ita-m ita-n ita-o usb-a usb-b usb-c usb-mini-a usb-mini-b usb-micro-a usb-micro-b usb-micro-ab usb-3-b usb-3-micro-b dc-terminal saf-d-grid hardwired] Type string `json:"type,omitempty"` // Url @@ -257,7 +257,7 @@ var writablePowerPortTemplateTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["iec-60320-c6","iec-60320-c8","iec-60320-c14","iec-60320-c16","iec-60320-c20","iec-60320-c22","iec-60309-p-n-e-4h","iec-60309-p-n-e-6h","iec-60309-p-n-e-9h","iec-60309-2p-e-4h","iec-60309-2p-e-6h","iec-60309-2p-e-9h","iec-60309-3p-e-4h","iec-60309-3p-e-6h","iec-60309-3p-e-9h","iec-60309-3p-n-e-4h","iec-60309-3p-n-e-6h","iec-60309-3p-n-e-9h","nema-1-15p","nema-5-15p","nema-5-20p","nema-5-30p","nema-5-50p","nema-6-15p","nema-6-20p","nema-6-30p","nema-6-50p","nema-10-30p","nema-10-50p","nema-14-20p","nema-14-30p","nema-14-50p","nema-14-60p","nema-15-15p","nema-15-20p","nema-15-30p","nema-15-50p","nema-15-60p","nema-l1-15p","nema-l5-15p","nema-l5-20p","nema-l5-30p","nema-l5-50p","nema-l6-15p","nema-l6-20p","nema-l6-30p","nema-l6-50p","nema-l10-30p","nema-l14-20p","nema-l14-30p","nema-l14-50p","nema-l14-60p","nema-l15-20p","nema-l15-30p","nema-l15-50p","nema-l15-60p","nema-l21-20p","nema-l21-30p","nema-l22-30p","cs6361c","cs6365c","cs8165c","cs8265c","cs8365c","cs8465c","ita-c","ita-e","ita-f","ita-ef","ita-g","ita-h","ita-i","ita-j","ita-k","ita-l","ita-m","ita-n","ita-o","usb-a","usb-b","usb-c","usb-mini-a","usb-mini-b","usb-micro-a","usb-micro-b","usb-micro-ab","usb-3-b","usb-3-micro-b","dc-terminal","saf-d-grid","hardwired"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -441,6 +441,9 @@ const ( // WritablePowerPortTemplateTypeNemaDashL21Dash30p captures enum value "nema-l21-30p" WritablePowerPortTemplateTypeNemaDashL21Dash30p string = "nema-l21-30p" + // WritablePowerPortTemplateTypeNemaDashL22Dash30p captures enum value "nema-l22-30p" + WritablePowerPortTemplateTypeNemaDashL22Dash30p string = "nema-l22-30p" + // WritablePowerPortTemplateTypeCs6361c captures enum value "cs6361c" WritablePowerPortTemplateTypeCs6361c string = "cs6361c" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack.go index c657f3fa6..abfd36b7a 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack.go @@ -67,8 +67,6 @@ type WritableRack struct { Display string `json:"display,omitempty"` // Facility ID - // - // Locally-assigned identifier // Max Length: 50 FacilityID *string `json:"facility_id,omitempty"` @@ -82,7 +80,8 @@ type WritableRack struct { LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Location - Location *int64 `json:"location,omitempty"` + // Required: true + Location *int64 `json:"location"` // Name // Required: true @@ -178,6 +177,10 @@ func (m *WritableRack) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -280,6 +283,15 @@ func (m *WritableRack) validateLastUpdated(formats strfmt.Registry) error { return nil } +func (m *WritableRack) validateLocation(formats strfmt.Registry) error { + + if err := validate.Required("location", "body", m.Location); err != nil { + return err + } + + return nil +} + func (m *WritableRack) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack_reservation.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack_reservation.go index df311e9c0..6bece7c08 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack_reservation.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rack_reservation.go @@ -57,6 +57,11 @@ type WritableRackReservation struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Rack // Required: true Rack *int64 `json:"rack"` @@ -93,6 +98,10 @@ func (m *WritableRackReservation) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateRack(formats); err != nil { res = append(res, err) } @@ -148,6 +157,18 @@ func (m *WritableRackReservation) validateDescription(formats strfmt.Registry) e return nil } +func (m *WritableRackReservation) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableRackReservation) validateRack(formats strfmt.Registry) error { if err := validate.Required("rack", "body", m.Rack); err != nil { @@ -244,6 +265,10 @@ func (m *WritableRackReservation) ContextValidate(ctx context.Context, formats s res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTags(ctx, formats); err != nil { res = append(res, err) } @@ -285,6 +310,15 @@ func (m *WritableRackReservation) contextValidateID(ctx context.Context, formats return nil } +func (m *WritableRackReservation) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *WritableRackReservation) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port.go index 4b647b038..1ecaf5f3f 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port.go @@ -43,18 +43,6 @@ type WritableRearPort struct { // cable Cable *NestedCable `json:"cable,omitempty"` - // Cable peer - // - // - // Return the appropriate serializer for the cable termination model. - // - // Read Only: true - CablePeer map[string]*string `json:"cable_peer,omitempty"` - - // Cable peer type - // Read Only: true - CablePeerType string `json:"cable_peer_type,omitempty"` - // Color // Max Length: 6 // Pattern: ^[0-9a-f]{6}$ @@ -95,6 +83,18 @@ type WritableRearPort struct { // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Link peer + // + // + // Return the appropriate serializer for the link termination model. + // + // Read Only: true + LinkPeer map[string]*string `json:"link_peer,omitempty"` + + // Link peer type + // Read Only: true + LinkPeerType string `json:"link_peer_type,omitempty"` + // Mark connected // // Treat as if a cable is connected @@ -116,7 +116,7 @@ type WritableRearPort struct { // Type // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Type *string `json:"type"` // Url @@ -338,7 +338,7 @@ var writableRearPortTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -408,12 +408,24 @@ const ( // WritableRearPortTypeLc captures enum value "lc" WritableRearPortTypeLc string = "lc" + // WritableRearPortTypeLcDashPc captures enum value "lc-pc" + WritableRearPortTypeLcDashPc string = "lc-pc" + + // WritableRearPortTypeLcDashUpc captures enum value "lc-upc" + WritableRearPortTypeLcDashUpc string = "lc-upc" + // WritableRearPortTypeLcDashApc captures enum value "lc-apc" WritableRearPortTypeLcDashApc string = "lc-apc" // WritableRearPortTypeLsh captures enum value "lsh" WritableRearPortTypeLsh string = "lsh" + // WritableRearPortTypeLshDashPc captures enum value "lsh-pc" + WritableRearPortTypeLshDashPc string = "lsh-pc" + + // WritableRearPortTypeLshDashUpc captures enum value "lsh-upc" + WritableRearPortTypeLshDashUpc string = "lsh-upc" + // WritableRearPortTypeLshDashApc captures enum value "lsh-apc" WritableRearPortTypeLshDashApc string = "lsh-apc" @@ -426,6 +438,12 @@ const ( // WritableRearPortTypeSc captures enum value "sc" WritableRearPortTypeSc string = "sc" + // WritableRearPortTypeScDashPc captures enum value "sc-pc" + WritableRearPortTypeScDashPc string = "sc-pc" + + // WritableRearPortTypeScDashUpc captures enum value "sc-upc" + WritableRearPortTypeScDashUpc string = "sc-upc" + // WritableRearPortTypeScDashApc captures enum value "sc-apc" WritableRearPortTypeScDashApc string = "sc-apc" @@ -503,27 +521,27 @@ func (m *WritableRearPort) ContextValidate(ctx context.Context, formats strfmt.R res = append(res, err) } - if err := m.contextValidateCablePeer(ctx, formats); err != nil { + if err := m.contextValidateCreated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCablePeerType(ctx, formats); err != nil { + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateCreated(ctx, formats); err != nil { + if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateDisplay(ctx, formats); err != nil { + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateID(ctx, formats); err != nil { + if err := m.contextValidateLinkPeer(ctx, formats); err != nil { res = append(res, err) } - if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + if err := m.contextValidateLinkPeerType(ctx, formats); err != nil { res = append(res, err) } @@ -566,20 +584,6 @@ func (m *WritableRearPort) contextValidateCable(ctx context.Context, formats str return nil } -func (m *WritableRearPort) contextValidateCablePeer(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *WritableRearPort) contextValidateCablePeerType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "cable_peer_type", "body", string(m.CablePeerType)); err != nil { - return err - } - - return nil -} - func (m *WritableRearPort) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { @@ -616,6 +620,20 @@ func (m *WritableRearPort) contextValidateLastUpdated(ctx context.Context, forma return nil } +func (m *WritableRearPort) contextValidateLinkPeer(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *WritableRearPort) contextValidateLinkPeerType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "link_peer_type", "body", string(m.LinkPeerType)); err != nil { + return err + } + + return nil +} + func (m *WritableRearPort) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Tags); i++ { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port_template.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port_template.go index 20a179e28..91fc8e781 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port_template.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_rear_port_template.go @@ -85,7 +85,7 @@ type WritableRearPortTemplate struct { // Type // Required: true - // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-apc lsh lsh-apc mpo mtrj sc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] + // Enum: [8p8c 8p6c 8p4c 8p2c 6p6c 6p4c 6p2c 4p4c 4p2c gg45 tera-4p tera-2p tera-1p 110-punch bnc f n mrj21 fc lc lc-pc lc-upc lc-apc lsh lsh-pc lsh-upc lsh-apc mpo mtrj sc sc-pc sc-upc sc-apc st cs sn sma-905 sma-906 urm-p2 urm-p4 urm-p8 splice] Type *string `json:"type"` // Url @@ -254,7 +254,7 @@ var writableRearPortTemplateTypeTypePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-apc","lsh","lsh-apc","mpo","mtrj","sc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["8p8c","8p6c","8p4c","8p2c","6p6c","6p4c","6p2c","4p4c","4p2c","gg45","tera-4p","tera-2p","tera-1p","110-punch","bnc","f","n","mrj21","fc","lc","lc-pc","lc-upc","lc-apc","lsh","lsh-pc","lsh-upc","lsh-apc","mpo","mtrj","sc","sc-pc","sc-upc","sc-apc","st","cs","sn","sma-905","sma-906","urm-p2","urm-p4","urm-p8","splice"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -324,12 +324,24 @@ const ( // WritableRearPortTemplateTypeLc captures enum value "lc" WritableRearPortTemplateTypeLc string = "lc" + // WritableRearPortTemplateTypeLcDashPc captures enum value "lc-pc" + WritableRearPortTemplateTypeLcDashPc string = "lc-pc" + + // WritableRearPortTemplateTypeLcDashUpc captures enum value "lc-upc" + WritableRearPortTemplateTypeLcDashUpc string = "lc-upc" + // WritableRearPortTemplateTypeLcDashApc captures enum value "lc-apc" WritableRearPortTemplateTypeLcDashApc string = "lc-apc" // WritableRearPortTemplateTypeLsh captures enum value "lsh" WritableRearPortTemplateTypeLsh string = "lsh" + // WritableRearPortTemplateTypeLshDashPc captures enum value "lsh-pc" + WritableRearPortTemplateTypeLshDashPc string = "lsh-pc" + + // WritableRearPortTemplateTypeLshDashUpc captures enum value "lsh-upc" + WritableRearPortTemplateTypeLshDashUpc string = "lsh-upc" + // WritableRearPortTemplateTypeLshDashApc captures enum value "lsh-apc" WritableRearPortTemplateTypeLshDashApc string = "lsh-apc" @@ -342,6 +354,12 @@ const ( // WritableRearPortTemplateTypeSc captures enum value "sc" WritableRearPortTemplateTypeSc string = "sc" + // WritableRearPortTemplateTypeScDashPc captures enum value "sc-pc" + WritableRearPortTemplateTypeScDashPc string = "sc-pc" + + // WritableRearPortTemplateTypeScDashUpc captures enum value "sc-upc" + WritableRearPortTemplateTypeScDashUpc string = "sc-upc" + // WritableRearPortTemplateTypeScDashApc captures enum value "sc-apc" WritableRearPortTemplateTypeScDashApc string = "sc-apc" diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_region.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_region.go index 0b764b071..66356eb90 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_region.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_region.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -83,6 +84,9 @@ type WritableRegion struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -113,6 +117,10 @@ func (m *WritableRegion) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -197,6 +205,32 @@ func (m *WritableRegion) validateSlug(formats strfmt.Registry) error { return nil } +func (m *WritableRegion) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableRegion) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -237,6 +271,10 @@ func (m *WritableRegion) ContextValidate(ctx context.Context, formats strfmt.Reg res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -301,6 +339,26 @@ func (m *WritableRegion) contextValidateSiteCount(ctx context.Context, formats s return nil } +func (m *WritableRegion) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableRegion) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_service.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_service.go index 199fefbda..c77dcd227 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_service.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_service.go @@ -80,7 +80,7 @@ type WritableService struct { // Protocol // Required: true - // Enum: [tcp udp] + // Enum: [tcp udp sctp] Protocol *string `json:"protocol"` // tags @@ -231,7 +231,7 @@ var writableServiceTypeProtocolPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["tcp","udp"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["tcp","udp","sctp"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -246,6 +246,9 @@ const ( // WritableServiceProtocolUDP captures enum value "udp" WritableServiceProtocolUDP string = "udp" + + // WritableServiceProtocolSctp captures enum value "sctp" + WritableServiceProtocolSctp string = "sctp" ) // prop value enum diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_site.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_site.go index 089bc5769..fcbe6b26c 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_site.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_site.go @@ -43,6 +43,10 @@ type WritableSite struct { // Minimum: 1 Asn *int64 `json:"asn,omitempty"` + // asns + // Unique: true + Asns []int64 `json:"asns"` + // Circuit count // Read Only: true CircuitCount int64 `json:"circuit_count,omitempty"` @@ -178,6 +182,10 @@ func (m *WritableSite) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateAsns(formats); err != nil { + res = append(res, err) + } + if err := m.validateContactEmail(formats); err != nil { res = append(res, err) } @@ -256,6 +264,18 @@ func (m *WritableSite) validateAsn(formats strfmt.Registry) error { return nil } +func (m *WritableSite) validateAsns(formats strfmt.Registry) error { + if swag.IsZero(m.Asns) { // not required + return nil + } + + if err := validate.UniqueItems("asns", "body", m.Asns); err != nil { + return err + } + + return nil +} + func (m *WritableSite) validateContactEmail(formats strfmt.Registry) error { if swag.IsZero(m.ContactEmail) { // not required return nil diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_site_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_site_group.go index ba0c443bd..80f6e9bde 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_site_group.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_site_group.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -83,6 +84,9 @@ type WritableSiteGroup struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Url // Read Only: true // Format: uri @@ -113,6 +117,10 @@ func (m *WritableSiteGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -197,6 +205,32 @@ func (m *WritableSiteGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *WritableSiteGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableSiteGroup) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -237,6 +271,10 @@ func (m *WritableSiteGroup) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateURL(ctx, formats); err != nil { res = append(res, err) } @@ -301,6 +339,26 @@ func (m *WritableSiteGroup) contextValidateSiteCount(ctx context.Context, format return nil } +func (m *WritableSiteGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableSiteGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_tenant_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_tenant_group.go index 667fb3026..ebfe9b36e 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_tenant_group.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_tenant_group.go @@ -22,6 +22,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -79,6 +80,9 @@ type WritableTenantGroup struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // tags + Tags []*NestedTag `json:"tags"` + // Tenant count // Read Only: true TenantCount int64 `json:"tenant_count,omitempty"` @@ -113,6 +117,10 @@ func (m *WritableTenantGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -197,6 +205,32 @@ func (m *WritableTenantGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *WritableTenantGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableTenantGroup) validateURL(formats strfmt.Registry) error { if swag.IsZero(m.URL) { // not required return nil @@ -233,6 +267,10 @@ func (m *WritableTenantGroup) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateTenantCount(ctx, formats); err != nil { res = append(res, err) } @@ -292,6 +330,26 @@ func (m *WritableTenantGroup) contextValidateLastUpdated(ctx context.Context, fo return nil } +func (m *WritableTenantGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + func (m *WritableTenantGroup) contextValidateTenantCount(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "tenant_count", "body", int64(m.TenantCount)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_v_l_a_n.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_v_l_a_n.go index 38f3b7d28..c5d487936 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_v_l_a_n.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_v_l_a_n.go @@ -53,7 +53,8 @@ type WritableVLAN struct { Display string `json:"display,omitempty"` // Group - Group *int64 `json:"group,omitempty"` + // Required: true + Group *int64 `json:"group"` // Id // Read Only: true @@ -114,6 +115,10 @@ func (m *WritableVLAN) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateGroup(formats); err != nil { + res = append(res, err) + } + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } @@ -168,6 +173,15 @@ func (m *WritableVLAN) validateDescription(formats strfmt.Registry) error { return nil } +func (m *WritableVLAN) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + return nil +} + func (m *WritableVLAN) validateLastUpdated(formats strfmt.Registry) error { if swag.IsZero(m.LastUpdated) { // not required return nil diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_virtual_chassis.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_virtual_chassis.go index 60d728eb1..494526ac0 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_virtual_chassis.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_virtual_chassis.go @@ -35,6 +35,11 @@ import ( // swagger:model WritableVirtualChassis type WritableVirtualChassis struct { + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -50,6 +55,11 @@ type WritableVirtualChassis struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Master Master *int64 `json:"master,omitempty"` @@ -76,10 +86,18 @@ type WritableVirtualChassis struct { func (m *WritableVirtualChassis) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDomain(formats); err != nil { res = append(res, err) } + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -98,6 +116,18 @@ func (m *WritableVirtualChassis) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableVirtualChassis) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableVirtualChassis) validateDomain(formats strfmt.Registry) error { if swag.IsZero(m.Domain) { // not required return nil @@ -110,6 +140,18 @@ func (m *WritableVirtualChassis) validateDomain(formats strfmt.Registry) error { return nil } +func (m *WritableVirtualChassis) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableVirtualChassis) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -169,6 +211,10 @@ func (m *WritableVirtualChassis) validateURL(formats strfmt.Registry) error { func (m *WritableVirtualChassis) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisplay(ctx, formats); err != nil { res = append(res, err) } @@ -177,6 +223,10 @@ func (m *WritableVirtualChassis) ContextValidate(ctx context.Context, formats st res = append(res, err) } + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateMemberCount(ctx, formats); err != nil { res = append(res, err) } @@ -195,6 +245,15 @@ func (m *WritableVirtualChassis) ContextValidate(ctx context.Context, formats st return nil } +func (m *WritableVirtualChassis) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + func (m *WritableVirtualChassis) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { @@ -213,6 +272,15 @@ func (m *WritableVirtualChassis) contextValidateID(ctx context.Context, formats return nil } +func (m *WritableVirtualChassis) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + func (m *WritableVirtualChassis) contextValidateMemberCount(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "member_count", "body", int64(m.MemberCount)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_vm_interface.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_vm_interface.go index 122ce2c87..426591287 100644 --- a/vendor/github.com/smutel/go-netbox/netbox/models/writable_vm_interface.go +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_vm_interface.go @@ -36,6 +36,13 @@ import ( // swagger:model WritableVMInterface type WritableVMInterface struct { + // Bridge interface + Bridge *int64 `json:"bridge,omitempty"` + + // Count fhrp groups + // Read Only: true + CountFhrpGroups int64 `json:"count_fhrp_groups,omitempty"` + // Count ipaddresses // Read Only: true CountIpaddresses int64 `json:"count_ipaddresses,omitempty"` @@ -336,6 +343,10 @@ func (m *WritableVMInterface) validateVirtualMachine(formats strfmt.Registry) er func (m *WritableVMInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCountFhrpGroups(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateCountIpaddresses(ctx, formats); err != nil { res = append(res, err) } @@ -370,6 +381,15 @@ func (m *WritableVMInterface) ContextValidate(ctx context.Context, formats strfm return nil } +func (m *WritableVMInterface) contextValidateCountFhrpGroups(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "count_fhrp_groups", "body", int64(m.CountFhrpGroups)); err != nil { + return err + } + + return nil +} + func (m *WritableVMInterface) contextValidateCountIpaddresses(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "count_ipaddresses", "body", int64(m.CountIpaddresses)); err != nil { diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n.go new file mode 100644 index 000000000..8de42415a --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n.go @@ -0,0 +1,454 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableWirelessLAN writable wireless l a n +// +// swagger:model WritableWirelessLAN +type WritableWirelessLAN struct { + + // Auth cipher + // Enum: [auto tkip aes] + AuthCipher string `json:"auth_cipher,omitempty"` + + // Pre-shared key + // Max Length: 64 + AuthPsk string `json:"auth_psk,omitempty"` + + // Auth type + // Enum: [open wep wpa-personal wpa-enterprise] + AuthType string `json:"auth_type,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Group + Group *int64 `json:"group,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // SSID + // Required: true + // Max Length: 32 + // Min Length: 1 + Ssid *string `json:"ssid"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` + + // VLAN + Vlan *int64 `json:"vlan,omitempty"` +} + +// Validate validates this writable wireless l a n +func (m *WritableWirelessLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthCipher(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthPsk(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSsid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var writableWirelessLANTypeAuthCipherPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["auto","tkip","aes"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableWirelessLANTypeAuthCipherPropEnum = append(writableWirelessLANTypeAuthCipherPropEnum, v) + } +} + +const ( + + // WritableWirelessLANAuthCipherAuto captures enum value "auto" + WritableWirelessLANAuthCipherAuto string = "auto" + + // WritableWirelessLANAuthCipherTkip captures enum value "tkip" + WritableWirelessLANAuthCipherTkip string = "tkip" + + // WritableWirelessLANAuthCipherAes captures enum value "aes" + WritableWirelessLANAuthCipherAes string = "aes" +) + +// prop value enum +func (m *WritableWirelessLAN) validateAuthCipherEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableWirelessLANTypeAuthCipherPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableWirelessLAN) validateAuthCipher(formats strfmt.Registry) error { + if swag.IsZero(m.AuthCipher) { // not required + return nil + } + + // value enum + if err := m.validateAuthCipherEnum("auth_cipher", "body", m.AuthCipher); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) validateAuthPsk(formats strfmt.Registry) error { + if swag.IsZero(m.AuthPsk) { // not required + return nil + } + + if err := validate.MaxLength("auth_psk", "body", m.AuthPsk, 64); err != nil { + return err + } + + return nil +} + +var writableWirelessLANTypeAuthTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["open","wep","wpa-personal","wpa-enterprise"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableWirelessLANTypeAuthTypePropEnum = append(writableWirelessLANTypeAuthTypePropEnum, v) + } +} + +const ( + + // WritableWirelessLANAuthTypeOpen captures enum value "open" + WritableWirelessLANAuthTypeOpen string = "open" + + // WritableWirelessLANAuthTypeWep captures enum value "wep" + WritableWirelessLANAuthTypeWep string = "wep" + + // WritableWirelessLANAuthTypeWpaDashPersonal captures enum value "wpa-personal" + WritableWirelessLANAuthTypeWpaDashPersonal string = "wpa-personal" + + // WritableWirelessLANAuthTypeWpaDashEnterprise captures enum value "wpa-enterprise" + WritableWirelessLANAuthTypeWpaDashEnterprise string = "wpa-enterprise" +) + +// prop value enum +func (m *WritableWirelessLAN) validateAuthTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableWirelessLANTypeAuthTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableWirelessLAN) validateAuthType(formats strfmt.Registry) error { + if swag.IsZero(m.AuthType) { // not required + return nil + } + + // value enum + if err := m.validateAuthTypeEnum("auth_type", "body", m.AuthType); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) validateSsid(formats strfmt.Registry) error { + + if err := validate.Required("ssid", "body", m.Ssid); err != nil { + return err + } + + if err := validate.MinLength("ssid", "body", *m.Ssid, 1); err != nil { + return err + } + + if err := validate.MaxLength("ssid", "body", *m.Ssid, 32); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableWirelessLAN) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable wireless l a n based on the context it is used +func (m *WritableWirelessLAN) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableWirelessLAN) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLAN) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableWirelessLAN) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableWirelessLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableWirelessLAN) UnmarshalBinary(b []byte) error { + var res WritableWirelessLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n_group.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n_group.go new file mode 100644 index 000000000..f7bdc5dc8 --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_l_a_n_group.go @@ -0,0 +1,401 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableWirelessLANGroup writable wireless l a n group +// +// swagger:model WritableWirelessLANGroup +type WritableWirelessLANGroup struct { + + // depth + // Read Only: true + Depth int64 `json:"_depth,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Parent + // Required: true + Parent *int64 `json:"parent"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` + + // Wirelesslan count + // Read Only: true + WirelesslanCount int64 `json:"wirelesslan_count,omitempty"` +} + +// Validate validates this writable wireless l a n group +func (m *WritableWirelessLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableWirelessLANGroup) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 100); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", *m.Slug, 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", *m.Slug, 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", *m.Slug, `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableWirelessLANGroup) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable wireless l a n group based on the context it is used +func (m *WritableWirelessLANGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepth(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWirelesslanCount(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateDepth(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "_depth", "body", int64(m.Depth)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLANGroup) contextValidateWirelesslanCount(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "wirelesslan_count", "body", int64(m.WirelesslanCount)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableWirelessLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableWirelessLANGroup) UnmarshalBinary(b []byte) error { + var res WritableWirelessLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_link.go b/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_link.go new file mode 100644 index 000000000..01d4e835e --- /dev/null +++ b/vendor/github.com/smutel/go-netbox/netbox/models/writable_wireless_link.go @@ -0,0 +1,528 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com> +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableWirelessLink writable wireless link +// +// swagger:model WritableWirelessLink +type WritableWirelessLink struct { + + // Auth cipher + // Enum: [auto tkip aes] + AuthCipher string `json:"auth_cipher,omitempty"` + + // Pre-shared key + // Max Length: 64 + AuthPsk string `json:"auth_psk,omitempty"` + + // Auth type + // Enum: [open wep wpa-personal wpa-enterprise] + AuthType string `json:"auth_type,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // Display + // Read Only: true + Display string `json:"display,omitempty"` + + // Id + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface a + // Required: true + Interfacea *int64 `json:"interface_a"` + + // Interface b + // Required: true + Interfaceb *int64 `json:"interface_b"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // SSID + // Max Length: 32 + Ssid string `json:"ssid,omitempty"` + + // Status + // Enum: [connected planned decommissioning] + Status string `json:"status,omitempty"` + + // tags + Tags []*NestedTag `json:"tags"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this writable wireless link +func (m *WritableWirelessLink) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthCipher(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthPsk(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAuthType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfacea(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInterfaceb(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSsid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var writableWirelessLinkTypeAuthCipherPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["auto","tkip","aes"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableWirelessLinkTypeAuthCipherPropEnum = append(writableWirelessLinkTypeAuthCipherPropEnum, v) + } +} + +const ( + + // WritableWirelessLinkAuthCipherAuto captures enum value "auto" + WritableWirelessLinkAuthCipherAuto string = "auto" + + // WritableWirelessLinkAuthCipherTkip captures enum value "tkip" + WritableWirelessLinkAuthCipherTkip string = "tkip" + + // WritableWirelessLinkAuthCipherAes captures enum value "aes" + WritableWirelessLinkAuthCipherAes string = "aes" +) + +// prop value enum +func (m *WritableWirelessLink) validateAuthCipherEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableWirelessLinkTypeAuthCipherPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableWirelessLink) validateAuthCipher(formats strfmt.Registry) error { + if swag.IsZero(m.AuthCipher) { // not required + return nil + } + + // value enum + if err := m.validateAuthCipherEnum("auth_cipher", "body", m.AuthCipher); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateAuthPsk(formats strfmt.Registry) error { + if swag.IsZero(m.AuthPsk) { // not required + return nil + } + + if err := validate.MaxLength("auth_psk", "body", m.AuthPsk, 64); err != nil { + return err + } + + return nil +} + +var writableWirelessLinkTypeAuthTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["open","wep","wpa-personal","wpa-enterprise"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableWirelessLinkTypeAuthTypePropEnum = append(writableWirelessLinkTypeAuthTypePropEnum, v) + } +} + +const ( + + // WritableWirelessLinkAuthTypeOpen captures enum value "open" + WritableWirelessLinkAuthTypeOpen string = "open" + + // WritableWirelessLinkAuthTypeWep captures enum value "wep" + WritableWirelessLinkAuthTypeWep string = "wep" + + // WritableWirelessLinkAuthTypeWpaDashPersonal captures enum value "wpa-personal" + WritableWirelessLinkAuthTypeWpaDashPersonal string = "wpa-personal" + + // WritableWirelessLinkAuthTypeWpaDashEnterprise captures enum value "wpa-enterprise" + WritableWirelessLinkAuthTypeWpaDashEnterprise string = "wpa-enterprise" +) + +// prop value enum +func (m *WritableWirelessLink) validateAuthTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableWirelessLinkTypeAuthTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableWirelessLink) validateAuthType(formats strfmt.Registry) error { + if swag.IsZero(m.AuthType) { // not required + return nil + } + + // value enum + if err := m.validateAuthTypeEnum("auth_type", "body", m.AuthType); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateCreated(formats strfmt.Registry) error { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 200); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateInterfacea(formats strfmt.Registry) error { + + if err := validate.Required("interface_a", "body", m.Interfacea); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateInterfaceb(formats strfmt.Registry) error { + + if err := validate.Required("interface_b", "body", m.Interfaceb); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateLastUpdated(formats strfmt.Registry) error { + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateSsid(formats strfmt.Registry) error { + if swag.IsZero(m.Ssid) { // not required + return nil + } + + if err := validate.MaxLength("ssid", "body", m.Ssid, 32); err != nil { + return err + } + + return nil +} + +var writableWirelessLinkTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["connected","planned","decommissioning"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableWirelessLinkTypeStatusPropEnum = append(writableWirelessLinkTypeStatusPropEnum, v) + } +} + +const ( + + // WritableWirelessLinkStatusConnected captures enum value "connected" + WritableWirelessLinkStatusConnected string = "connected" + + // WritableWirelessLinkStatusPlanned captures enum value "planned" + WritableWirelessLinkStatusPlanned string = "planned" + + // WritableWirelessLinkStatusDecommissioning captures enum value "decommissioning" + WritableWirelessLinkStatusDecommissioning string = "decommissioning" +) + +// prop value enum +func (m *WritableWirelessLink) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, writableWirelessLinkTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *WritableWirelessLink) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableWirelessLink) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this writable wireless link based on the context it is used +func (m *WritableWirelessLink) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDisplay(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastUpdated(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableWirelessLink) contextValidateCreated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "created", "body", strfmt.Date(m.Created)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) contextValidateDisplay(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "display", "body", string(m.Display)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) contextValidateLastUpdated(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_updated", "body", strfmt.DateTime(m.LastUpdated)); err != nil { + return err + } + + return nil +} + +func (m *WritableWirelessLink) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *WritableWirelessLink) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableWirelessLink) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableWirelessLink) UnmarshalBinary(b []byte) error { + var res WritableWirelessLink + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/.golangci.yml b/vendor/github.com/vmihailenco/msgpack/v4/.golangci.yml new file mode 100644 index 000000000..98d6cb779 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/.golangci.yml @@ -0,0 +1,12 @@ +run: + concurrency: 8 + deadline: 5m + tests: false +linters: + enable-all: true + disable: + - gochecknoglobals + - gocognit + - godox + - wsl + - funlen diff --git a/vendor/github.com/vmihailenco/msgpack/v4/.travis.yml b/vendor/github.com/vmihailenco/msgpack/v4/.travis.yml new file mode 100644 index 000000000..b35bf5484 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +language: go + +go: + - 1.11.x + - 1.12.x + - 1.13.x + - 1.14.x + - tip + +matrix: + allow_failures: + - go: tip + +env: + - GO111MODULE=on + +go_import_path: github.com/vmihailenco/msgpack + +before_install: + - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0 diff --git a/vendor/github.com/vmihailenco/msgpack/v4/CHANGELOG.md b/vendor/github.com/vmihailenco/msgpack/v4/CHANGELOG.md new file mode 100644 index 000000000..fac97090e --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/CHANGELOG.md @@ -0,0 +1,24 @@ +## v4 + +- Encode, Decode, Marshal, and Unmarshal are changed to accept single argument. EncodeMulti and DecodeMulti are added as replacement. +- Added EncodeInt8/16/32/64 and EncodeUint8/16/32/64. +- Encoder changed to preserve type of numbers instead of chosing most compact encoding. The old behavior can be achieved with Encoder.UseCompactEncoding. + +## v3.3 + +- `msgpack:",inline"` tag is restored to force inlining structs. + +## v3.2 + +- Decoding extension types returns pointer to the value instead of the value. Fixes #153 + +## v3 + +- gopkg.in is not supported any more. Update import path to github.com/vmihailenco/msgpack. +- Msgpack maps are decoded into map[string]interface{} by default. +- EncodeSliceLen is removed in favor of EncodeArrayLen. DecodeSliceLen is removed in favor of DecodeArrayLen. +- Embedded structs are automatically inlined where possible. +- Time is encoded using extension as described in https://github.com/msgpack/msgpack/pull/209. Old format is supported as well. +- EncodeInt8/16/32/64 is replaced with EncodeInt. EncodeUint8/16/32/64 is replaced with EncodeUint. There should be no performance differences. +- DecodeInterface can now return int8/16/32 and uint8/16/32. +- PeekCode returns codes.Code instead of byte. diff --git a/vendor/github.com/PuerkitoBio/urlesc/LICENSE b/vendor/github.com/vmihailenco/msgpack/v4/LICENSE similarity index 83% rename from vendor/github.com/PuerkitoBio/urlesc/LICENSE rename to vendor/github.com/vmihailenco/msgpack/v4/LICENSE index 744875676..b749d0707 100644 --- a/vendor/github.com/PuerkitoBio/urlesc/LICENSE +++ b/vendor/github.com/vmihailenco/msgpack/v4/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2013 The github.com/vmihailenco/msgpack Authors. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,9 +11,6 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT diff --git a/vendor/github.com/vmihailenco/msgpack/v4/Makefile b/vendor/github.com/vmihailenco/msgpack/v4/Makefile new file mode 100644 index 000000000..57914e333 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/Makefile @@ -0,0 +1,6 @@ +all: + go test ./... + go test ./... -short -race + go test ./... -run=NONE -bench=. -benchmem + env GOOS=linux GOARCH=386 go test ./... + golangci-lint run diff --git a/vendor/github.com/vmihailenco/msgpack/v4/README.md b/vendor/github.com/vmihailenco/msgpack/v4/README.md new file mode 100644 index 000000000..a5b1004e0 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/README.md @@ -0,0 +1,72 @@ +# MessagePack encoding for Golang + +[![Build Status](https://travis-ci.org/vmihailenco/msgpack.svg?branch=v2)](https://travis-ci.org/vmihailenco/msgpack) +[![GoDoc](https://godoc.org/github.com/vmihailenco/msgpack?status.svg)](https://godoc.org/github.com/vmihailenco/msgpack) + +Supports: +- Primitives, arrays, maps, structs, time.Time and interface{}. +- Appengine *datastore.Key and datastore.Cursor. +- [CustomEncoder](https://godoc.org/github.com/vmihailenco/msgpack#example-CustomEncoder)/CustomDecoder interfaces for custom encoding. +- [Extensions](https://godoc.org/github.com/vmihailenco/msgpack#example-RegisterExt) to encode type information. +- Renaming fields via `msgpack:"my_field_name"` and alias via `msgpack:"alias:another_name"`. +- Omitting individual empty fields via `msgpack:",omitempty"` tag or all [empty fields in a struct](https://godoc.org/github.com/vmihailenco/msgpack#example-Marshal--OmitEmpty). +- [Map keys sorting](https://godoc.org/github.com/vmihailenco/msgpack#Encoder.SortMapKeys). +- Encoding/decoding all [structs as arrays](https://godoc.org/github.com/vmihailenco/msgpack#Encoder.UseArrayForStructs) or [individual structs](https://godoc.org/github.com/vmihailenco/msgpack#example-Marshal--AsArray). +- [Encoder.UseJSONTag](https://godoc.org/github.com/vmihailenco/msgpack#Encoder.UseJSONTag) with [Decoder.UseJSONTag](https://godoc.org/github.com/vmihailenco/msgpack#Decoder.UseJSONTag) can turn msgpack into drop-in replacement for JSON. +- Simple but very fast and efficient [queries](https://godoc.org/github.com/vmihailenco/msgpack#example-Decoder-Query). + +API docs: https://godoc.org/github.com/vmihailenco/msgpack. +Examples: https://godoc.org/github.com/vmihailenco/msgpack#pkg-examples. + +## Installation + +This project uses [Go Modules](https://github.com/golang/go/wiki/Modules) and semantic import versioning since v4: + +``` shell +go mod init github.com/my/repo +go get github.com/vmihailenco/msgpack/v4 +``` + +## Quickstart + +``` go +import "github.com/vmihailenco/msgpack/v4" + +func ExampleMarshal() { + type Item struct { + Foo string + } + + b, err := msgpack.Marshal(&Item{Foo: "bar"}) + if err != nil { + panic(err) + } + + var item Item + err = msgpack.Unmarshal(b, &item) + if err != nil { + panic(err) + } + fmt.Println(item.Foo) + // Output: bar +} +``` + +## Benchmark + +``` +BenchmarkStructVmihailencoMsgpack-4 200000 12814 ns/op 2128 B/op 26 allocs/op +BenchmarkStructUgorjiGoMsgpack-4 100000 17678 ns/op 3616 B/op 70 allocs/op +BenchmarkStructUgorjiGoCodec-4 100000 19053 ns/op 7346 B/op 23 allocs/op +BenchmarkStructJSON-4 20000 69438 ns/op 7864 B/op 26 allocs/op +BenchmarkStructGOB-4 10000 104331 ns/op 14664 B/op 278 allocs/op +``` + +## Howto + +Please go through [examples](https://godoc.org/github.com/vmihailenco/msgpack#pkg-examples) to get an idea how to use this package. + +## See also + +- [Golang PostgreSQL ORM](https://github.com/go-pg/pg) +- [Golang message task queue](https://github.com/vmihailenco/taskq) diff --git a/vendor/github.com/vmihailenco/msgpack/v4/appengine.go b/vendor/github.com/vmihailenco/msgpack/v4/appengine.go new file mode 100644 index 000000000..e8e91e53f --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/appengine.go @@ -0,0 +1,64 @@ +// +build appengine + +package msgpack + +import ( + "reflect" + + ds "google.golang.org/appengine/datastore" +) + +func init() { + Register((*ds.Key)(nil), encodeDatastoreKeyValue, decodeDatastoreKeyValue) + Register((*ds.Cursor)(nil), encodeDatastoreCursorValue, decodeDatastoreCursorValue) +} + +func EncodeDatastoreKey(e *Encoder, key *ds.Key) error { + if key == nil { + return e.EncodeNil() + } + return e.EncodeString(key.Encode()) +} + +func encodeDatastoreKeyValue(e *Encoder, v reflect.Value) error { + key := v.Interface().(*ds.Key) + return EncodeDatastoreKey(e, key) +} + +func DecodeDatastoreKey(d *Decoder) (*ds.Key, error) { + v, err := d.DecodeString() + if err != nil { + return nil, err + } + if v == "" { + return nil, nil + } + return ds.DecodeKey(v) +} + +func decodeDatastoreKeyValue(d *Decoder, v reflect.Value) error { + key, err := DecodeDatastoreKey(d) + if err != nil { + return err + } + v.Set(reflect.ValueOf(key)) + return nil +} + +func encodeDatastoreCursorValue(e *Encoder, v reflect.Value) error { + cursor := v.Interface().(ds.Cursor) + return e.Encode(cursor.String()) +} + +func decodeDatastoreCursorValue(d *Decoder, v reflect.Value) error { + s, err := d.DecodeString() + if err != nil { + return err + } + cursor, err := ds.DecodeCursor(s) + if err != nil { + return err + } + v.Set(reflect.ValueOf(cursor)) + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/codes/codes.go b/vendor/github.com/vmihailenco/msgpack/v4/codes/codes.go new file mode 100644 index 000000000..28e0a5a88 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/codes/codes.go @@ -0,0 +1,90 @@ +package codes + +type Code byte + +var ( + PosFixedNumHigh Code = 0x7f + NegFixedNumLow Code = 0xe0 + + Nil Code = 0xc0 + + False Code = 0xc2 + True Code = 0xc3 + + Float Code = 0xca + Double Code = 0xcb + + Uint8 Code = 0xcc + Uint16 Code = 0xcd + Uint32 Code = 0xce + Uint64 Code = 0xcf + + Int8 Code = 0xd0 + Int16 Code = 0xd1 + Int32 Code = 0xd2 + Int64 Code = 0xd3 + + FixedStrLow Code = 0xa0 + FixedStrHigh Code = 0xbf + FixedStrMask Code = 0x1f + Str8 Code = 0xd9 + Str16 Code = 0xda + Str32 Code = 0xdb + + Bin8 Code = 0xc4 + Bin16 Code = 0xc5 + Bin32 Code = 0xc6 + + FixedArrayLow Code = 0x90 + FixedArrayHigh Code = 0x9f + FixedArrayMask Code = 0xf + Array16 Code = 0xdc + Array32 Code = 0xdd + + FixedMapLow Code = 0x80 + FixedMapHigh Code = 0x8f + FixedMapMask Code = 0xf + Map16 Code = 0xde + Map32 Code = 0xdf + + FixExt1 Code = 0xd4 + FixExt2 Code = 0xd5 + FixExt4 Code = 0xd6 + FixExt8 Code = 0xd7 + FixExt16 Code = 0xd8 + Ext8 Code = 0xc7 + Ext16 Code = 0xc8 + Ext32 Code = 0xc9 +) + +func IsFixedNum(c Code) bool { + return c <= PosFixedNumHigh || c >= NegFixedNumLow +} + +func IsFixedMap(c Code) bool { + return c >= FixedMapLow && c <= FixedMapHigh +} + +func IsFixedArray(c Code) bool { + return c >= FixedArrayLow && c <= FixedArrayHigh +} + +func IsFixedString(c Code) bool { + return c >= FixedStrLow && c <= FixedStrHigh +} + +func IsString(c Code) bool { + return IsFixedString(c) || c == Str8 || c == Str16 || c == Str32 +} + +func IsBin(c Code) bool { + return c == Bin8 || c == Bin16 || c == Bin32 +} + +func IsFixedExt(c Code) bool { + return c >= FixExt1 && c <= FixExt16 +} + +func IsExt(c Code) bool { + return IsFixedExt(c) || c == Ext8 || c == Ext16 || c == Ext32 +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/decode.go b/vendor/github.com/vmihailenco/msgpack/v4/decode.go new file mode 100644 index 000000000..1711675e9 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/decode.go @@ -0,0 +1,617 @@ +package msgpack + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "io" + "reflect" + "sync" + "time" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +const ( + looseIfaceFlag uint32 = 1 << iota + decodeUsingJSONFlag + disallowUnknownFieldsFlag +) + +const ( + bytesAllocLimit = 1e6 // 1mb + sliceAllocLimit = 1e4 + maxMapSize = 1e6 +) + +type bufReader interface { + io.Reader + io.ByteScanner +} + +//------------------------------------------------------------------------------ + +var decPool = sync.Pool{ + New: func() interface{} { + return NewDecoder(nil) + }, +} + +// Unmarshal decodes the MessagePack-encoded data and stores the result +// in the value pointed to by v. +func Unmarshal(data []byte, v interface{}) error { + dec := decPool.Get().(*Decoder) + + if r, ok := dec.r.(*bytes.Reader); ok { + r.Reset(data) + } else { + dec.Reset(bytes.NewReader(data)) + } + err := dec.Decode(v) + + decPool.Put(dec) + + return err +} + +// A Decoder reads and decodes MessagePack values from an input stream. +type Decoder struct { + r io.Reader + s io.ByteScanner + buf []byte + + extLen int + rec []byte // accumulates read data if not nil + + intern []string + flags uint32 + decodeMapFunc func(*Decoder) (interface{}, error) +} + +// NewDecoder returns a new decoder that reads from r. +// +// The decoder introduces its own buffering and may read data from r +// beyond the MessagePack values requested. Buffering can be disabled +// by passing a reader that implements io.ByteScanner interface. +func NewDecoder(r io.Reader) *Decoder { + d := new(Decoder) + d.Reset(r) + return d +} + +// Reset discards any buffered data, resets all state, and switches the buffered +// reader to read from r. +func (d *Decoder) Reset(r io.Reader) { + if br, ok := r.(bufReader); ok { + d.r = br + d.s = br + } else if br, ok := d.r.(*bufio.Reader); ok { + br.Reset(r) + } else { + br := bufio.NewReader(r) + d.r = br + d.s = br + } + + if d.intern != nil { + d.intern = d.intern[:0] + } + + //TODO: + //d.useLoose = false + //d.useJSONTag = false + //d.disallowUnknownFields = false + //d.decodeMapFunc = nil +} + +func (d *Decoder) SetDecodeMapFunc(fn func(*Decoder) (interface{}, error)) { + d.decodeMapFunc = fn +} + +// UseDecodeInterfaceLoose causes decoder to use DecodeInterfaceLoose +// to decode msgpack value into Go interface{}. +func (d *Decoder) UseDecodeInterfaceLoose(on bool) *Decoder { + if on { + d.flags |= looseIfaceFlag + } else { + d.flags &= ^looseIfaceFlag + } + return d +} + +// UseJSONTag causes the Decoder to use json struct tag as fallback option +// if there is no msgpack tag. +func (d *Decoder) UseJSONTag(on bool) *Decoder { + if on { + d.flags |= decodeUsingJSONFlag + } else { + d.flags &= ^decodeUsingJSONFlag + } + return d +} + +// DisallowUnknownFields causes the Decoder to return an error when the destination +// is a struct and the input contains object keys which do not match any +// non-ignored, exported fields in the destination. +func (d *Decoder) DisallowUnknownFields() { + if true { + d.flags |= disallowUnknownFieldsFlag + } else { + d.flags &= ^disallowUnknownFieldsFlag + } +} + +// Buffered returns a reader of the data remaining in the Decoder's buffer. +// The reader is valid until the next call to Decode. +func (d *Decoder) Buffered() io.Reader { + return d.r +} + +//nolint:gocyclo +func (d *Decoder) Decode(v interface{}) error { + var err error + switch v := v.(type) { + case *string: + if v != nil { + *v, err = d.DecodeString() + return err + } + case *[]byte: + if v != nil { + return d.decodeBytesPtr(v) + } + case *int: + if v != nil { + *v, err = d.DecodeInt() + return err + } + case *int8: + if v != nil { + *v, err = d.DecodeInt8() + return err + } + case *int16: + if v != nil { + *v, err = d.DecodeInt16() + return err + } + case *int32: + if v != nil { + *v, err = d.DecodeInt32() + return err + } + case *int64: + if v != nil { + *v, err = d.DecodeInt64() + return err + } + case *uint: + if v != nil { + *v, err = d.DecodeUint() + return err + } + case *uint8: + if v != nil { + *v, err = d.DecodeUint8() + return err + } + case *uint16: + if v != nil { + *v, err = d.DecodeUint16() + return err + } + case *uint32: + if v != nil { + *v, err = d.DecodeUint32() + return err + } + case *uint64: + if v != nil { + *v, err = d.DecodeUint64() + return err + } + case *bool: + if v != nil { + *v, err = d.DecodeBool() + return err + } + case *float32: + if v != nil { + *v, err = d.DecodeFloat32() + return err + } + case *float64: + if v != nil { + *v, err = d.DecodeFloat64() + return err + } + case *[]string: + return d.decodeStringSlicePtr(v) + case *map[string]string: + return d.decodeMapStringStringPtr(v) + case *map[string]interface{}: + return d.decodeMapStringInterfacePtr(v) + case *time.Duration: + if v != nil { + vv, err := d.DecodeInt64() + *v = time.Duration(vv) + return err + } + case *time.Time: + if v != nil { + *v, err = d.DecodeTime() + return err + } + } + + vv := reflect.ValueOf(v) + if !vv.IsValid() { + return errors.New("msgpack: Decode(nil)") + } + if vv.Kind() != reflect.Ptr { + return fmt.Errorf("msgpack: Decode(nonsettable %T)", v) + } + vv = vv.Elem() + if !vv.IsValid() { + return fmt.Errorf("msgpack: Decode(nonsettable %T)", v) + } + return d.DecodeValue(vv) +} + +func (d *Decoder) DecodeMulti(v ...interface{}) error { + for _, vv := range v { + if err := d.Decode(vv); err != nil { + return err + } + } + return nil +} + +func (d *Decoder) decodeInterfaceCond() (interface{}, error) { + if d.flags&looseIfaceFlag != 0 { + return d.DecodeInterfaceLoose() + } + return d.DecodeInterface() +} + +func (d *Decoder) DecodeValue(v reflect.Value) error { + decode := getDecoder(v.Type()) + return decode(d, v) +} + +func (d *Decoder) DecodeNil() error { + c, err := d.readCode() + if err != nil { + return err + } + if c != codes.Nil { + return fmt.Errorf("msgpack: invalid code=%x decoding nil", c) + } + return nil +} + +func (d *Decoder) decodeNilValue(v reflect.Value) error { + err := d.DecodeNil() + if v.IsNil() { + return err + } + if v.Kind() == reflect.Ptr { + v = v.Elem() + } + v.Set(reflect.Zero(v.Type())) + return err +} + +func (d *Decoder) DecodeBool() (bool, error) { + c, err := d.readCode() + if err != nil { + return false, err + } + return d.bool(c) +} + +func (d *Decoder) bool(c codes.Code) (bool, error) { + if c == codes.False { + return false, nil + } + if c == codes.True { + return true, nil + } + return false, fmt.Errorf("msgpack: invalid code=%x decoding bool", c) +} + +func (d *Decoder) DecodeDuration() (time.Duration, error) { + n, err := d.DecodeInt64() + if err != nil { + return 0, err + } + return time.Duration(n), nil +} + +// DecodeInterface decodes value into interface. It returns following types: +// - nil, +// - bool, +// - int8, int16, int32, int64, +// - uint8, uint16, uint32, uint64, +// - float32 and float64, +// - string, +// - []byte, +// - slices of any of the above, +// - maps of any of the above. +// +// DecodeInterface should be used only when you don't know the type of value +// you are decoding. For example, if you are decoding number it is better to use +// DecodeInt64 for negative numbers and DecodeUint64 for positive numbers. +func (d *Decoder) DecodeInterface() (interface{}, error) { + c, err := d.readCode() + if err != nil { + return nil, err + } + + if codes.IsFixedNum(c) { + return int8(c), nil + } + if codes.IsFixedMap(c) { + err = d.s.UnreadByte() + if err != nil { + return nil, err + } + return d.DecodeMap() + } + if codes.IsFixedArray(c) { + return d.decodeSlice(c) + } + if codes.IsFixedString(c) { + return d.string(c) + } + + switch c { + case codes.Nil: + return nil, nil + case codes.False, codes.True: + return d.bool(c) + case codes.Float: + return d.float32(c) + case codes.Double: + return d.float64(c) + case codes.Uint8: + return d.uint8() + case codes.Uint16: + return d.uint16() + case codes.Uint32: + return d.uint32() + case codes.Uint64: + return d.uint64() + case codes.Int8: + return d.int8() + case codes.Int16: + return d.int16() + case codes.Int32: + return d.int32() + case codes.Int64: + return d.int64() + case codes.Bin8, codes.Bin16, codes.Bin32: + return d.bytes(c, nil) + case codes.Str8, codes.Str16, codes.Str32: + return d.string(c) + case codes.Array16, codes.Array32: + return d.decodeSlice(c) + case codes.Map16, codes.Map32: + err = d.s.UnreadByte() + if err != nil { + return nil, err + } + return d.DecodeMap() + case codes.FixExt1, codes.FixExt2, codes.FixExt4, codes.FixExt8, codes.FixExt16, + codes.Ext8, codes.Ext16, codes.Ext32: + return d.extInterface(c) + } + + return 0, fmt.Errorf("msgpack: unknown code %x decoding interface{}", c) +} + +// DecodeInterfaceLoose is like DecodeInterface except that: +// - int8, int16, and int32 are converted to int64, +// - uint8, uint16, and uint32 are converted to uint64, +// - float32 is converted to float64. +func (d *Decoder) DecodeInterfaceLoose() (interface{}, error) { + c, err := d.readCode() + if err != nil { + return nil, err + } + + if codes.IsFixedNum(c) { + return int64(int8(c)), nil + } + if codes.IsFixedMap(c) { + err = d.s.UnreadByte() + if err != nil { + return nil, err + } + return d.DecodeMap() + } + if codes.IsFixedArray(c) { + return d.decodeSlice(c) + } + if codes.IsFixedString(c) { + return d.string(c) + } + + switch c { + case codes.Nil: + return nil, nil + case codes.False, codes.True: + return d.bool(c) + case codes.Float, codes.Double: + return d.float64(c) + case codes.Uint8, codes.Uint16, codes.Uint32, codes.Uint64: + return d.uint(c) + case codes.Int8, codes.Int16, codes.Int32, codes.Int64: + return d.int(c) + case codes.Bin8, codes.Bin16, codes.Bin32: + return d.bytes(c, nil) + case codes.Str8, codes.Str16, codes.Str32: + return d.string(c) + case codes.Array16, codes.Array32: + return d.decodeSlice(c) + case codes.Map16, codes.Map32: + err = d.s.UnreadByte() + if err != nil { + return nil, err + } + return d.DecodeMap() + case codes.FixExt1, codes.FixExt2, codes.FixExt4, codes.FixExt8, codes.FixExt16, + codes.Ext8, codes.Ext16, codes.Ext32: + return d.extInterface(c) + } + + return 0, fmt.Errorf("msgpack: unknown code %x decoding interface{}", c) +} + +// Skip skips next value. +func (d *Decoder) Skip() error { + c, err := d.readCode() + if err != nil { + return err + } + + if codes.IsFixedNum(c) { + return nil + } + if codes.IsFixedMap(c) { + return d.skipMap(c) + } + if codes.IsFixedArray(c) { + return d.skipSlice(c) + } + if codes.IsFixedString(c) { + return d.skipBytes(c) + } + + switch c { + case codes.Nil, codes.False, codes.True: + return nil + case codes.Uint8, codes.Int8: + return d.skipN(1) + case codes.Uint16, codes.Int16: + return d.skipN(2) + case codes.Uint32, codes.Int32, codes.Float: + return d.skipN(4) + case codes.Uint64, codes.Int64, codes.Double: + return d.skipN(8) + case codes.Bin8, codes.Bin16, codes.Bin32: + return d.skipBytes(c) + case codes.Str8, codes.Str16, codes.Str32: + return d.skipBytes(c) + case codes.Array16, codes.Array32: + return d.skipSlice(c) + case codes.Map16, codes.Map32: + return d.skipMap(c) + case codes.FixExt1, codes.FixExt2, codes.FixExt4, codes.FixExt8, codes.FixExt16, + codes.Ext8, codes.Ext16, codes.Ext32: + return d.skipExt(c) + } + + return fmt.Errorf("msgpack: unknown code %x", c) +} + +// PeekCode returns the next MessagePack code without advancing the reader. +// Subpackage msgpack/codes contains list of available codes. +func (d *Decoder) PeekCode() (codes.Code, error) { + c, err := d.s.ReadByte() + if err != nil { + return 0, err + } + return codes.Code(c), d.s.UnreadByte() +} + +func (d *Decoder) hasNilCode() bool { + code, err := d.PeekCode() + return err == nil && code == codes.Nil +} + +func (d *Decoder) readCode() (codes.Code, error) { + d.extLen = 0 + c, err := d.s.ReadByte() + if err != nil { + return 0, err + } + if d.rec != nil { + d.rec = append(d.rec, c) + } + return codes.Code(c), nil +} + +func (d *Decoder) readFull(b []byte) error { + _, err := io.ReadFull(d.r, b) + if err != nil { + return err + } + if d.rec != nil { + //TODO: read directly into d.rec? + d.rec = append(d.rec, b...) + } + return nil +} + +func (d *Decoder) readN(n int) ([]byte, error) { + var err error + d.buf, err = readN(d.r, d.buf, n) + if err != nil { + return nil, err + } + if d.rec != nil { + //TODO: read directly into d.rec? + d.rec = append(d.rec, d.buf...) + } + return d.buf, nil +} + +func readN(r io.Reader, b []byte, n int) ([]byte, error) { + if b == nil { + if n == 0 { + return make([]byte, 0), nil + } + switch { + case n < 64: + b = make([]byte, 0, 64) + case n <= bytesAllocLimit: + b = make([]byte, 0, n) + default: + b = make([]byte, 0, bytesAllocLimit) + } + } + + if n <= cap(b) { + b = b[:n] + _, err := io.ReadFull(r, b) + return b, err + } + b = b[:cap(b)] + + var pos int + for { + alloc := min(n-len(b), bytesAllocLimit) + b = append(b, make([]byte, alloc)...) + + _, err := io.ReadFull(r, b[pos:]) + if err != nil { + return b, err + } + + if len(b) == n { + break + } + pos = len(b) + } + + return b, nil +} + +func min(a, b int) int { //nolint:unparam + if a <= b { + return a + } + return b +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/decode_map.go b/vendor/github.com/vmihailenco/msgpack/v4/decode_map.go new file mode 100644 index 000000000..16c40fe77 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/decode_map.go @@ -0,0 +1,350 @@ +package msgpack + +import ( + "errors" + "fmt" + "reflect" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +var ( + mapStringStringPtrType = reflect.TypeOf((*map[string]string)(nil)) + mapStringStringType = mapStringStringPtrType.Elem() +) + +var ( + mapStringInterfacePtrType = reflect.TypeOf((*map[string]interface{})(nil)) + mapStringInterfaceType = mapStringInterfacePtrType.Elem() +) + +func decodeMapValue(d *Decoder, v reflect.Value) error { + size, err := d.DecodeMapLen() + if err != nil { + return err + } + + typ := v.Type() + if size == -1 { + v.Set(reflect.Zero(typ)) + return nil + } + + if v.IsNil() { + v.Set(reflect.MakeMap(typ)) + } + if size == 0 { + return nil + } + + return decodeMapValueSize(d, v, size) +} + +func decodeMapValueSize(d *Decoder, v reflect.Value, size int) error { + typ := v.Type() + keyType := typ.Key() + valueType := typ.Elem() + + for i := 0; i < size; i++ { + mk := reflect.New(keyType).Elem() + if err := d.DecodeValue(mk); err != nil { + return err + } + + mv := reflect.New(valueType).Elem() + if err := d.DecodeValue(mv); err != nil { + return err + } + + v.SetMapIndex(mk, mv) + } + + return nil +} + +// DecodeMapLen decodes map length. Length is -1 when map is nil. +func (d *Decoder) DecodeMapLen() (int, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + + if codes.IsExt(c) { + if err = d.skipExtHeader(c); err != nil { + return 0, err + } + + c, err = d.readCode() + if err != nil { + return 0, err + } + } + return d.mapLen(c) +} + +func (d *Decoder) mapLen(c codes.Code) (int, error) { + size, err := d._mapLen(c) + err = expandInvalidCodeMapLenError(c, err) + return size, err +} + +func (d *Decoder) _mapLen(c codes.Code) (int, error) { + if c == codes.Nil { + return -1, nil + } + if c >= codes.FixedMapLow && c <= codes.FixedMapHigh { + return int(c & codes.FixedMapMask), nil + } + if c == codes.Map16 { + size, err := d.uint16() + return int(size), err + } + if c == codes.Map32 { + size, err := d.uint32() + return int(size), err + } + return 0, errInvalidCode +} + +var errInvalidCode = errors.New("invalid code") + +func expandInvalidCodeMapLenError(c codes.Code, err error) error { + if err == errInvalidCode { + return fmt.Errorf("msgpack: invalid code=%x decoding map length", c) + } + return err +} + +func decodeMapStringStringValue(d *Decoder, v reflect.Value) error { + mptr := v.Addr().Convert(mapStringStringPtrType).Interface().(*map[string]string) + return d.decodeMapStringStringPtr(mptr) +} + +func (d *Decoder) decodeMapStringStringPtr(ptr *map[string]string) error { + size, err := d.DecodeMapLen() + if err != nil { + return err + } + if size == -1 { + *ptr = nil + return nil + } + + m := *ptr + if m == nil { + *ptr = make(map[string]string, min(size, maxMapSize)) + m = *ptr + } + + for i := 0; i < size; i++ { + mk, err := d.DecodeString() + if err != nil { + return err + } + mv, err := d.DecodeString() + if err != nil { + return err + } + m[mk] = mv + } + + return nil +} + +func decodeMapStringInterfaceValue(d *Decoder, v reflect.Value) error { + ptr := v.Addr().Convert(mapStringInterfacePtrType).Interface().(*map[string]interface{}) + return d.decodeMapStringInterfacePtr(ptr) +} + +func (d *Decoder) decodeMapStringInterfacePtr(ptr *map[string]interface{}) error { + n, err := d.DecodeMapLen() + if err != nil { + return err + } + if n == -1 { + *ptr = nil + return nil + } + + m := *ptr + if m == nil { + *ptr = make(map[string]interface{}, min(n, maxMapSize)) + m = *ptr + } + + for i := 0; i < n; i++ { + mk, err := d.DecodeString() + if err != nil { + return err + } + mv, err := d.decodeInterfaceCond() + if err != nil { + return err + } + m[mk] = mv + } + + return nil +} + +var errUnsupportedMapKey = errors.New("msgpack: unsupported map key") + +func (d *Decoder) DecodeMap() (interface{}, error) { + if d.decodeMapFunc != nil { + return d.decodeMapFunc(d) + } + + size, err := d.DecodeMapLen() + if err != nil { + return nil, err + } + if size == -1 { + return nil, nil + } + if size == 0 { + return make(map[string]interface{}), nil + } + + code, err := d.PeekCode() + if err != nil { + return nil, err + } + + if codes.IsString(code) || codes.IsBin(code) { + return d.decodeMapStringInterfaceSize(size) + } + + key, err := d.decodeInterfaceCond() + if err != nil { + return nil, err + } + + value, err := d.decodeInterfaceCond() + if err != nil { + return nil, err + } + + keyType := reflect.TypeOf(key) + valueType := reflect.TypeOf(value) + + if !keyType.Comparable() { + return nil, errUnsupportedMapKey + } + + mapType := reflect.MapOf(keyType, valueType) + mapValue := reflect.MakeMap(mapType) + + mapValue.SetMapIndex(reflect.ValueOf(key), reflect.ValueOf(value)) + size-- + + err = decodeMapValueSize(d, mapValue, size) + if err != nil { + return nil, err + } + + return mapValue.Interface(), nil +} + +func (d *Decoder) decodeMapStringInterfaceSize(size int) (map[string]interface{}, error) { + m := make(map[string]interface{}, min(size, maxMapSize)) + for i := 0; i < size; i++ { + mk, err := d.DecodeString() + if err != nil { + return nil, err + } + mv, err := d.decodeInterfaceCond() + if err != nil { + return nil, err + } + m[mk] = mv + } + return m, nil +} + +func (d *Decoder) skipMap(c codes.Code) error { + n, err := d.mapLen(c) + if err != nil { + return err + } + for i := 0; i < n; i++ { + if err := d.Skip(); err != nil { + return err + } + if err := d.Skip(); err != nil { + return err + } + } + return nil +} + +func decodeStructValue(d *Decoder, v reflect.Value) error { + c, err := d.readCode() + if err != nil { + return err + } + + var isArray bool + + n, err := d._mapLen(c) + if err != nil { + var err2 error + n, err2 = d.arrayLen(c) + if err2 != nil { + return expandInvalidCodeMapLenError(c, err) + } + isArray = true + } + if n == -1 { + if err = mustSet(v); err != nil { + return err + } + v.Set(reflect.Zero(v.Type())) + return nil + } + + var fields *fields + if d.flags&decodeUsingJSONFlag != 0 { + fields = jsonStructs.Fields(v.Type()) + } else { + fields = structs.Fields(v.Type()) + } + + if isArray { + for i, f := range fields.List { + if i >= n { + break + } + if err := f.DecodeValue(d, v); err != nil { + return err + } + } + + // Skip extra values. + for i := len(fields.List); i < n; i++ { + if err := d.Skip(); err != nil { + return err + } + } + + return nil + } + + for i := 0; i < n; i++ { + name, err := d.DecodeString() + if err != nil { + return err + } + + if f := fields.Map[name]; f != nil { + if err := f.DecodeValue(d, v); err != nil { + return err + } + } else if d.flags&disallowUnknownFieldsFlag != 0 { + return fmt.Errorf("msgpack: unknown field %q", name) + } else if err := d.Skip(); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/decode_number.go b/vendor/github.com/vmihailenco/msgpack/v4/decode_number.go new file mode 100644 index 000000000..f6b9151f0 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/decode_number.go @@ -0,0 +1,307 @@ +package msgpack + +import ( + "fmt" + "math" + "reflect" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +func (d *Decoder) skipN(n int) error { + _, err := d.readN(n) + return err +} + +func (d *Decoder) uint8() (uint8, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + return uint8(c), nil +} + +func (d *Decoder) int8() (int8, error) { + n, err := d.uint8() + return int8(n), err +} + +func (d *Decoder) uint16() (uint16, error) { + b, err := d.readN(2) + if err != nil { + return 0, err + } + return (uint16(b[0]) << 8) | uint16(b[1]), nil +} + +func (d *Decoder) int16() (int16, error) { + n, err := d.uint16() + return int16(n), err +} + +func (d *Decoder) uint32() (uint32, error) { + b, err := d.readN(4) + if err != nil { + return 0, err + } + n := (uint32(b[0]) << 24) | + (uint32(b[1]) << 16) | + (uint32(b[2]) << 8) | + uint32(b[3]) + return n, nil +} + +func (d *Decoder) int32() (int32, error) { + n, err := d.uint32() + return int32(n), err +} + +func (d *Decoder) uint64() (uint64, error) { + b, err := d.readN(8) + if err != nil { + return 0, err + } + n := (uint64(b[0]) << 56) | + (uint64(b[1]) << 48) | + (uint64(b[2]) << 40) | + (uint64(b[3]) << 32) | + (uint64(b[4]) << 24) | + (uint64(b[5]) << 16) | + (uint64(b[6]) << 8) | + uint64(b[7]) + return n, nil +} + +func (d *Decoder) int64() (int64, error) { + n, err := d.uint64() + return int64(n), err +} + +// DecodeUint64 decodes msgpack int8/16/32/64 and uint8/16/32/64 +// into Go uint64. +func (d *Decoder) DecodeUint64() (uint64, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + return d.uint(c) +} + +func (d *Decoder) uint(c codes.Code) (uint64, error) { + if c == codes.Nil { + return 0, nil + } + if codes.IsFixedNum(c) { + return uint64(int8(c)), nil + } + switch c { + case codes.Uint8: + n, err := d.uint8() + return uint64(n), err + case codes.Int8: + n, err := d.int8() + return uint64(n), err + case codes.Uint16: + n, err := d.uint16() + return uint64(n), err + case codes.Int16: + n, err := d.int16() + return uint64(n), err + case codes.Uint32: + n, err := d.uint32() + return uint64(n), err + case codes.Int32: + n, err := d.int32() + return uint64(n), err + case codes.Uint64, codes.Int64: + return d.uint64() + } + return 0, fmt.Errorf("msgpack: invalid code=%x decoding uint64", c) +} + +// DecodeInt64 decodes msgpack int8/16/32/64 and uint8/16/32/64 +// into Go int64. +func (d *Decoder) DecodeInt64() (int64, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + return d.int(c) +} + +func (d *Decoder) int(c codes.Code) (int64, error) { + if c == codes.Nil { + return 0, nil + } + if codes.IsFixedNum(c) { + return int64(int8(c)), nil + } + switch c { + case codes.Uint8: + n, err := d.uint8() + return int64(n), err + case codes.Int8: + n, err := d.uint8() + return int64(int8(n)), err + case codes.Uint16: + n, err := d.uint16() + return int64(n), err + case codes.Int16: + n, err := d.uint16() + return int64(int16(n)), err + case codes.Uint32: + n, err := d.uint32() + return int64(n), err + case codes.Int32: + n, err := d.uint32() + return int64(int32(n)), err + case codes.Uint64, codes.Int64: + n, err := d.uint64() + return int64(n), err + } + return 0, fmt.Errorf("msgpack: invalid code=%x decoding int64", c) +} + +func (d *Decoder) DecodeFloat32() (float32, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + return d.float32(c) +} + +func (d *Decoder) float32(c codes.Code) (float32, error) { + if c == codes.Float { + n, err := d.uint32() + if err != nil { + return 0, err + } + return math.Float32frombits(n), nil + } + + n, err := d.int(c) + if err != nil { + return 0, fmt.Errorf("msgpack: invalid code=%x decoding float32", c) + } + return float32(n), nil +} + +// DecodeFloat64 decodes msgpack float32/64 into Go float64. +func (d *Decoder) DecodeFloat64() (float64, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + return d.float64(c) +} + +func (d *Decoder) float64(c codes.Code) (float64, error) { + switch c { + case codes.Float: + n, err := d.float32(c) + if err != nil { + return 0, err + } + return float64(n), nil + case codes.Double: + n, err := d.uint64() + if err != nil { + return 0, err + } + return math.Float64frombits(n), nil + } + + n, err := d.int(c) + if err != nil { + return 0, fmt.Errorf("msgpack: invalid code=%x decoding float32", c) + } + return float64(n), nil +} + +func (d *Decoder) DecodeUint() (uint, error) { + n, err := d.DecodeUint64() + return uint(n), err +} + +func (d *Decoder) DecodeUint8() (uint8, error) { + n, err := d.DecodeUint64() + return uint8(n), err +} + +func (d *Decoder) DecodeUint16() (uint16, error) { + n, err := d.DecodeUint64() + return uint16(n), err +} + +func (d *Decoder) DecodeUint32() (uint32, error) { + n, err := d.DecodeUint64() + return uint32(n), err +} + +func (d *Decoder) DecodeInt() (int, error) { + n, err := d.DecodeInt64() + return int(n), err +} + +func (d *Decoder) DecodeInt8() (int8, error) { + n, err := d.DecodeInt64() + return int8(n), err +} + +func (d *Decoder) DecodeInt16() (int16, error) { + n, err := d.DecodeInt64() + return int16(n), err +} + +func (d *Decoder) DecodeInt32() (int32, error) { + n, err := d.DecodeInt64() + return int32(n), err +} + +func decodeFloat32Value(d *Decoder, v reflect.Value) error { + f, err := d.DecodeFloat32() + if err != nil { + return err + } + if err = mustSet(v); err != nil { + return err + } + v.SetFloat(float64(f)) + return nil +} + +func decodeFloat64Value(d *Decoder, v reflect.Value) error { + f, err := d.DecodeFloat64() + if err != nil { + return err + } + if err = mustSet(v); err != nil { + return err + } + v.SetFloat(f) + return nil +} + +func decodeInt64Value(d *Decoder, v reflect.Value) error { + n, err := d.DecodeInt64() + if err != nil { + return err + } + if err = mustSet(v); err != nil { + return err + } + v.SetInt(n) + return nil +} + +func decodeUint64Value(d *Decoder, v reflect.Value) error { + n, err := d.DecodeUint64() + if err != nil { + return err + } + if err = mustSet(v); err != nil { + return err + } + v.SetUint(n) + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/decode_query.go b/vendor/github.com/vmihailenco/msgpack/v4/decode_query.go new file mode 100644 index 000000000..80cd80e78 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/decode_query.go @@ -0,0 +1,158 @@ +package msgpack + +import ( + "fmt" + "strconv" + "strings" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +type queryResult struct { + query string + key string + hasAsterisk bool + + values []interface{} +} + +func (q *queryResult) nextKey() { + ind := strings.IndexByte(q.query, '.') + if ind == -1 { + q.key = q.query + q.query = "" + return + } + q.key = q.query[:ind] + q.query = q.query[ind+1:] +} + +// Query extracts data specified by the query from the msgpack stream skipping +// any other data. Query consists of map keys and array indexes separated with dot, +// e.g. key1.0.key2. +func (d *Decoder) Query(query string) ([]interface{}, error) { + res := queryResult{ + query: query, + } + if err := d.query(&res); err != nil { + return nil, err + } + return res.values, nil +} + +func (d *Decoder) query(q *queryResult) error { + q.nextKey() + if q.key == "" { + v, err := d.decodeInterfaceCond() + if err != nil { + return err + } + q.values = append(q.values, v) + return nil + } + + code, err := d.PeekCode() + if err != nil { + return err + } + + switch { + case code == codes.Map16 || code == codes.Map32 || codes.IsFixedMap(code): + err = d.queryMapKey(q) + case code == codes.Array16 || code == codes.Array32 || codes.IsFixedArray(code): + err = d.queryArrayIndex(q) + default: + err = fmt.Errorf("msgpack: unsupported code=%x decoding key=%q", code, q.key) + } + return err +} + +func (d *Decoder) queryMapKey(q *queryResult) error { + n, err := d.DecodeMapLen() + if err != nil { + return err + } + if n == -1 { + return nil + } + + for i := 0; i < n; i++ { + k, err := d.bytesNoCopy() + if err != nil { + return err + } + + if string(k) == q.key { + if err := d.query(q); err != nil { + return err + } + if q.hasAsterisk { + return d.skipNext((n - i - 1) * 2) + } + return nil + } + + if err := d.Skip(); err != nil { + return err + } + } + + return nil +} + +func (d *Decoder) queryArrayIndex(q *queryResult) error { + n, err := d.DecodeArrayLen() + if err != nil { + return err + } + if n == -1 { + return nil + } + + if q.key == "*" { + q.hasAsterisk = true + + query := q.query + for i := 0; i < n; i++ { + q.query = query + if err := d.query(q); err != nil { + return err + } + } + + q.hasAsterisk = false + return nil + } + + ind, err := strconv.Atoi(q.key) + if err != nil { + return err + } + + for i := 0; i < n; i++ { + if i == ind { + if err := d.query(q); err != nil { + return err + } + if q.hasAsterisk { + return d.skipNext(n - i - 1) + } + return nil + } + + if err := d.Skip(); err != nil { + return err + } + } + + return nil +} + +func (d *Decoder) skipNext(n int) error { + for i := 0; i < n; i++ { + if err := d.Skip(); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/decode_slice.go b/vendor/github.com/vmihailenco/msgpack/v4/decode_slice.go new file mode 100644 index 000000000..adf17ae5c --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/decode_slice.go @@ -0,0 +1,191 @@ +package msgpack + +import ( + "fmt" + "reflect" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +var sliceStringPtrType = reflect.TypeOf((*[]string)(nil)) + +// DecodeArrayLen decodes array length. Length is -1 when array is nil. +func (d *Decoder) DecodeArrayLen() (int, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + return d.arrayLen(c) +} + +func (d *Decoder) arrayLen(c codes.Code) (int, error) { + if c == codes.Nil { + return -1, nil + } else if c >= codes.FixedArrayLow && c <= codes.FixedArrayHigh { + return int(c & codes.FixedArrayMask), nil + } + switch c { + case codes.Array16: + n, err := d.uint16() + return int(n), err + case codes.Array32: + n, err := d.uint32() + return int(n), err + } + return 0, fmt.Errorf("msgpack: invalid code=%x decoding array length", c) +} + +func decodeStringSliceValue(d *Decoder, v reflect.Value) error { + ptr := v.Addr().Convert(sliceStringPtrType).Interface().(*[]string) + return d.decodeStringSlicePtr(ptr) +} + +func (d *Decoder) decodeStringSlicePtr(ptr *[]string) error { + n, err := d.DecodeArrayLen() + if err != nil { + return err + } + if n == -1 { + return nil + } + + ss := makeStrings(*ptr, n) + for i := 0; i < n; i++ { + s, err := d.DecodeString() + if err != nil { + return err + } + ss = append(ss, s) + } + *ptr = ss + + return nil +} + +func makeStrings(s []string, n int) []string { + if n > sliceAllocLimit { + n = sliceAllocLimit + } + + if s == nil { + return make([]string, 0, n) + } + + if cap(s) >= n { + return s[:0] + } + + s = s[:cap(s)] + s = append(s, make([]string, n-len(s))...) + return s[:0] +} + +func decodeSliceValue(d *Decoder, v reflect.Value) error { + n, err := d.DecodeArrayLen() + if err != nil { + return err + } + + if n == -1 { + v.Set(reflect.Zero(v.Type())) + return nil + } + if n == 0 && v.IsNil() { + v.Set(reflect.MakeSlice(v.Type(), 0, 0)) + return nil + } + + if v.Cap() >= n { + v.Set(v.Slice(0, n)) + } else if v.Len() < v.Cap() { + v.Set(v.Slice(0, v.Cap())) + } + + for i := 0; i < n; i++ { + if i >= v.Len() { + v.Set(growSliceValue(v, n)) + } + elem := v.Index(i) + if err := d.DecodeValue(elem); err != nil { + return err + } + } + + return nil +} + +func growSliceValue(v reflect.Value, n int) reflect.Value { + diff := n - v.Len() + if diff > sliceAllocLimit { + diff = sliceAllocLimit + } + v = reflect.AppendSlice(v, reflect.MakeSlice(v.Type(), diff, diff)) + return v +} + +func decodeArrayValue(d *Decoder, v reflect.Value) error { + n, err := d.DecodeArrayLen() + if err != nil { + return err + } + + if n == -1 { + return nil + } + if n > v.Len() { + return fmt.Errorf("%s len is %d, but msgpack has %d elements", v.Type(), v.Len(), n) + } + + for i := 0; i < n; i++ { + sv := v.Index(i) + if err := d.DecodeValue(sv); err != nil { + return err + } + } + + return nil +} + +func (d *Decoder) DecodeSlice() ([]interface{}, error) { + c, err := d.readCode() + if err != nil { + return nil, err + } + return d.decodeSlice(c) +} + +func (d *Decoder) decodeSlice(c codes.Code) ([]interface{}, error) { + n, err := d.arrayLen(c) + if err != nil { + return nil, err + } + if n == -1 { + return nil, nil + } + + s := make([]interface{}, 0, min(n, sliceAllocLimit)) + for i := 0; i < n; i++ { + v, err := d.decodeInterfaceCond() + if err != nil { + return nil, err + } + s = append(s, v) + } + + return s, nil +} + +func (d *Decoder) skipSlice(c codes.Code) error { + n, err := d.arrayLen(c) + if err != nil { + return err + } + + for i := 0; i < n; i++ { + if err := d.Skip(); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/decode_string.go b/vendor/github.com/vmihailenco/msgpack/v4/decode_string.go new file mode 100644 index 000000000..c5adf3865 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/decode_string.go @@ -0,0 +1,186 @@ +package msgpack + +import ( + "fmt" + "reflect" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +func (d *Decoder) bytesLen(c codes.Code) (int, error) { + if c == codes.Nil { + return -1, nil + } + + if codes.IsFixedString(c) { + return int(c & codes.FixedStrMask), nil + } + + switch c { + case codes.Str8, codes.Bin8: + n, err := d.uint8() + return int(n), err + case codes.Str16, codes.Bin16: + n, err := d.uint16() + return int(n), err + case codes.Str32, codes.Bin32: + n, err := d.uint32() + return int(n), err + } + + return 0, fmt.Errorf("msgpack: invalid code=%x decoding bytes length", c) +} + +func (d *Decoder) DecodeString() (string, error) { + c, err := d.readCode() + if err != nil { + return "", err + } + return d.string(c) +} + +func (d *Decoder) string(c codes.Code) (string, error) { + n, err := d.bytesLen(c) + if err != nil { + return "", err + } + return d.stringWithLen(n) +} + +func (d *Decoder) stringWithLen(n int) (string, error) { + if n <= 0 { + return "", nil + } + b, err := d.readN(n) + return string(b), err +} + +func decodeStringValue(d *Decoder, v reflect.Value) error { + if err := mustSet(v); err != nil { + return err + } + + s, err := d.DecodeString() + if err != nil { + return err + } + + v.SetString(s) + return nil +} + +func (d *Decoder) DecodeBytesLen() (int, error) { + c, err := d.readCode() + if err != nil { + return 0, err + } + return d.bytesLen(c) +} + +func (d *Decoder) DecodeBytes() ([]byte, error) { + c, err := d.readCode() + if err != nil { + return nil, err + } + return d.bytes(c, nil) +} + +func (d *Decoder) bytes(c codes.Code, b []byte) ([]byte, error) { + n, err := d.bytesLen(c) + if err != nil { + return nil, err + } + if n == -1 { + return nil, nil + } + return readN(d.r, b, n) +} + +func (d *Decoder) bytesNoCopy() ([]byte, error) { + c, err := d.readCode() + if err != nil { + return nil, err + } + n, err := d.bytesLen(c) + if err != nil { + return nil, err + } + if n == -1 { + return nil, nil + } + return d.readN(n) +} + +func (d *Decoder) decodeBytesPtr(ptr *[]byte) error { + c, err := d.readCode() + if err != nil { + return err + } + return d.bytesPtr(c, ptr) +} + +func (d *Decoder) bytesPtr(c codes.Code, ptr *[]byte) error { + n, err := d.bytesLen(c) + if err != nil { + return err + } + if n == -1 { + *ptr = nil + return nil + } + + *ptr, err = readN(d.r, *ptr, n) + return err +} + +func (d *Decoder) skipBytes(c codes.Code) error { + n, err := d.bytesLen(c) + if err != nil { + return err + } + if n <= 0 { + return nil + } + return d.skipN(n) +} + +func decodeBytesValue(d *Decoder, v reflect.Value) error { + if err := mustSet(v); err != nil { + return err + } + + c, err := d.readCode() + if err != nil { + return err + } + + b, err := d.bytes(c, v.Bytes()) + if err != nil { + return err + } + + v.SetBytes(b) + + return nil +} + +func decodeByteArrayValue(d *Decoder, v reflect.Value) error { + c, err := d.readCode() + if err != nil { + return err + } + + n, err := d.bytesLen(c) + if err != nil { + return err + } + if n == -1 { + return nil + } + if n > v.Len() { + return fmt.Errorf("%s len is %d, but msgpack has %d elements", v.Type(), v.Len(), n) + } + + b := v.Slice(0, n).Bytes() + return d.readFull(b) +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/decode_value.go b/vendor/github.com/vmihailenco/msgpack/v4/decode_value.go new file mode 100644 index 000000000..810d3be8f --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/decode_value.go @@ -0,0 +1,276 @@ +package msgpack + +import ( + "encoding" + "errors" + "fmt" + "reflect" +) + +var interfaceType = reflect.TypeOf((*interface{})(nil)).Elem() +var stringType = reflect.TypeOf((*string)(nil)).Elem() + +var valueDecoders []decoderFunc + +//nolint:gochecknoinits +func init() { + valueDecoders = []decoderFunc{ + reflect.Bool: decodeBoolValue, + reflect.Int: decodeInt64Value, + reflect.Int8: decodeInt64Value, + reflect.Int16: decodeInt64Value, + reflect.Int32: decodeInt64Value, + reflect.Int64: decodeInt64Value, + reflect.Uint: decodeUint64Value, + reflect.Uint8: decodeUint64Value, + reflect.Uint16: decodeUint64Value, + reflect.Uint32: decodeUint64Value, + reflect.Uint64: decodeUint64Value, + reflect.Float32: decodeFloat32Value, + reflect.Float64: decodeFloat64Value, + reflect.Complex64: decodeUnsupportedValue, + reflect.Complex128: decodeUnsupportedValue, + reflect.Array: decodeArrayValue, + reflect.Chan: decodeUnsupportedValue, + reflect.Func: decodeUnsupportedValue, + reflect.Interface: decodeInterfaceValue, + reflect.Map: decodeMapValue, + reflect.Ptr: decodeUnsupportedValue, + reflect.Slice: decodeSliceValue, + reflect.String: decodeStringValue, + reflect.Struct: decodeStructValue, + reflect.UnsafePointer: decodeUnsupportedValue, + } +} + +func mustSet(v reflect.Value) error { + if !v.CanSet() { + return fmt.Errorf("msgpack: Decode(nonsettable %s)", v.Type()) + } + return nil +} + +func getDecoder(typ reflect.Type) decoderFunc { + if v, ok := typeDecMap.Load(typ); ok { + return v.(decoderFunc) + } + fn := _getDecoder(typ) + typeDecMap.Store(typ, fn) + return fn +} + +func _getDecoder(typ reflect.Type) decoderFunc { + kind := typ.Kind() + + if typ.Implements(customDecoderType) { + return decodeCustomValue + } + if typ.Implements(unmarshalerType) { + return unmarshalValue + } + if typ.Implements(binaryUnmarshalerType) { + return unmarshalBinaryValue + } + + // Addressable struct field value. + if kind != reflect.Ptr { + ptr := reflect.PtrTo(typ) + if ptr.Implements(customDecoderType) { + return decodeCustomValueAddr + } + if ptr.Implements(unmarshalerType) { + return unmarshalValueAddr + } + if ptr.Implements(binaryUnmarshalerType) { + return unmarshalBinaryValueAddr + } + } + + switch kind { + case reflect.Ptr: + return ptrDecoderFunc(typ) + case reflect.Slice: + elem := typ.Elem() + if elem.Kind() == reflect.Uint8 { + return decodeBytesValue + } + if elem == stringType { + return decodeStringSliceValue + } + case reflect.Array: + if typ.Elem().Kind() == reflect.Uint8 { + return decodeByteArrayValue + } + case reflect.Map: + if typ.Key() == stringType { + switch typ.Elem() { + case stringType: + return decodeMapStringStringValue + case interfaceType: + return decodeMapStringInterfaceValue + } + } + } + + return valueDecoders[kind] +} + +func ptrDecoderFunc(typ reflect.Type) decoderFunc { + decoder := getDecoder(typ.Elem()) + return func(d *Decoder, v reflect.Value) error { + if d.hasNilCode() { + if err := mustSet(v); err != nil { + return err + } + if !v.IsNil() { + v.Set(reflect.Zero(v.Type())) + } + return d.DecodeNil() + } + if v.IsNil() { + if err := mustSet(v); err != nil { + return err + } + v.Set(reflect.New(v.Type().Elem())) + } + return decoder(d, v.Elem()) + } +} + +func decodeCustomValueAddr(d *Decoder, v reflect.Value) error { + if !v.CanAddr() { + return fmt.Errorf("msgpack: Decode(nonaddressable %T)", v.Interface()) + } + return decodeCustomValue(d, v.Addr()) +} + +func decodeCustomValue(d *Decoder, v reflect.Value) error { + if d.hasNilCode() { + return d.decodeNilValue(v) + } + + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + + decoder := v.Interface().(CustomDecoder) + return decoder.DecodeMsgpack(d) +} + +func unmarshalValueAddr(d *Decoder, v reflect.Value) error { + if !v.CanAddr() { + return fmt.Errorf("msgpack: Decode(nonaddressable %T)", v.Interface()) + } + return unmarshalValue(d, v.Addr()) +} + +func unmarshalValue(d *Decoder, v reflect.Value) error { + if d.extLen == 0 || d.extLen == 1 { + if d.hasNilCode() { + return d.decodeNilValue(v) + } + } + + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + + var b []byte + + if d.extLen != 0 { + var err error + b, err = d.readN(d.extLen) + if err != nil { + return err + } + } else { + d.rec = make([]byte, 0, 64) + if err := d.Skip(); err != nil { + return err + } + b = d.rec + d.rec = nil + } + + unmarshaler := v.Interface().(Unmarshaler) + return unmarshaler.UnmarshalMsgpack(b) +} + +func decodeBoolValue(d *Decoder, v reflect.Value) error { + flag, err := d.DecodeBool() + if err != nil { + return err + } + if err = mustSet(v); err != nil { + return err + } + v.SetBool(flag) + return nil +} + +func decodeInterfaceValue(d *Decoder, v reflect.Value) error { + if v.IsNil() { + return d.interfaceValue(v) + } + + elem := v.Elem() + if !elem.CanAddr() { + if d.hasNilCode() { + v.Set(reflect.Zero(v.Type())) + return d.DecodeNil() + } + } + + return d.DecodeValue(elem) +} + +func (d *Decoder) interfaceValue(v reflect.Value) error { + vv, err := d.decodeInterfaceCond() + if err != nil { + return err + } + + if vv != nil { + if v.Type() == errorType { + if vv, ok := vv.(string); ok { + v.Set(reflect.ValueOf(errors.New(vv))) + return nil + } + } + + v.Set(reflect.ValueOf(vv)) + } + + return nil +} + +func decodeUnsupportedValue(d *Decoder, v reflect.Value) error { + return fmt.Errorf("msgpack: Decode(unsupported %s)", v.Type()) +} + +//------------------------------------------------------------------------------ + +func unmarshalBinaryValueAddr(d *Decoder, v reflect.Value) error { + if !v.CanAddr() { + return fmt.Errorf("msgpack: Decode(nonaddressable %T)", v.Interface()) + } + return unmarshalBinaryValue(d, v.Addr()) +} + +func unmarshalBinaryValue(d *Decoder, v reflect.Value) error { + if d.hasNilCode() { + return d.decodeNilValue(v) + } + + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + + data, err := d.DecodeBytes() + if err != nil { + return err + } + + unmarshaler := v.Interface().(encoding.BinaryUnmarshaler) + return unmarshaler.UnmarshalBinary(data) +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/encode.go b/vendor/github.com/vmihailenco/msgpack/v4/encode.go new file mode 100644 index 000000000..37f098701 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/encode.go @@ -0,0 +1,241 @@ +package msgpack + +import ( + "bytes" + "io" + "reflect" + "sync" + "time" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +const ( + sortMapKeysFlag uint32 = 1 << iota + structAsArrayFlag + encodeUsingJSONFlag + useCompactIntsFlag + useCompactFloatsFlag +) + +type writer interface { + io.Writer + WriteByte(byte) error +} + +type byteWriter struct { + io.Writer + + buf [1]byte +} + +func newByteWriter(w io.Writer) *byteWriter { + bw := new(byteWriter) + bw.Reset(w) + return bw +} + +func (bw *byteWriter) Reset(w io.Writer) { + bw.Writer = w +} + +func (bw *byteWriter) WriteByte(c byte) error { + bw.buf[0] = c + _, err := bw.Write(bw.buf[:]) + return err +} + +//------------------------------------------------------------------------------ + +var encPool = sync.Pool{ + New: func() interface{} { + return NewEncoder(nil) + }, +} + +// Marshal returns the MessagePack encoding of v. +func Marshal(v interface{}) ([]byte, error) { + enc := encPool.Get().(*Encoder) + + var buf bytes.Buffer + enc.Reset(&buf) + + err := enc.Encode(v) + b := buf.Bytes() + + encPool.Put(enc) + + if err != nil { + return nil, err + } + return b, err +} + +type Encoder struct { + w writer + + buf []byte + timeBuf []byte + bootstrap [9 + 12]byte + + intern map[string]int + + flags uint32 +} + +// NewEncoder returns a new encoder that writes to w. +func NewEncoder(w io.Writer) *Encoder { + e := new(Encoder) + e.buf = e.bootstrap[:9] + e.timeBuf = e.bootstrap[9 : 9+12] + e.Reset(w) + return e +} + +func (e *Encoder) Reset(w io.Writer) { + if bw, ok := w.(writer); ok { + e.w = bw + } else if bw, ok := e.w.(*byteWriter); ok { + bw.Reset(w) + } else { + e.w = newByteWriter(w) + } + + for k := range e.intern { + delete(e.intern, k) + } + + //TODO: + //e.sortMapKeys = false + //e.structAsArray = false + //e.useJSONTag = false + //e.useCompact = false +} + +// SortMapKeys causes the Encoder to encode map keys in increasing order. +// Supported map types are: +// - map[string]string +// - map[string]interface{} +func (e *Encoder) SortMapKeys(on bool) *Encoder { + if on { + e.flags |= sortMapKeysFlag + } else { + e.flags &= ^sortMapKeysFlag + } + return e +} + +// StructAsArray causes the Encoder to encode Go structs as msgpack arrays. +func (e *Encoder) StructAsArray(on bool) *Encoder { + if on { + e.flags |= structAsArrayFlag + } else { + e.flags &= ^structAsArrayFlag + } + return e +} + +// UseJSONTag causes the Encoder to use json struct tag as fallback option +// if there is no msgpack tag. +func (e *Encoder) UseJSONTag(on bool) *Encoder { + if on { + e.flags |= encodeUsingJSONFlag + } else { + e.flags &= ^encodeUsingJSONFlag + } + return e +} + +// UseCompactEncoding causes the Encoder to chose the most compact encoding. +// For example, it allows to encode small Go int64 as msgpack int8 saving 7 bytes. +func (e *Encoder) UseCompactEncoding(on bool) *Encoder { + if on { + e.flags |= useCompactIntsFlag + } else { + e.flags &= ^useCompactIntsFlag + } + return e +} + +// UseCompactFloats causes the Encoder to chose a compact integer encoding +// for floats that can be represented as integers. +func (e *Encoder) UseCompactFloats(on bool) { + if on { + e.flags |= useCompactFloatsFlag + } else { + e.flags &= ^useCompactFloatsFlag + } +} + +func (e *Encoder) Encode(v interface{}) error { + switch v := v.(type) { + case nil: + return e.EncodeNil() + case string: + return e.EncodeString(v) + case []byte: + return e.EncodeBytes(v) + case int: + return e.encodeInt64Cond(int64(v)) + case int64: + return e.encodeInt64Cond(v) + case uint: + return e.encodeUint64Cond(uint64(v)) + case uint64: + return e.encodeUint64Cond(v) + case bool: + return e.EncodeBool(v) + case float32: + return e.EncodeFloat32(v) + case float64: + return e.EncodeFloat64(v) + case time.Duration: + return e.encodeInt64Cond(int64(v)) + case time.Time: + return e.EncodeTime(v) + } + return e.EncodeValue(reflect.ValueOf(v)) +} + +func (e *Encoder) EncodeMulti(v ...interface{}) error { + for _, vv := range v { + if err := e.Encode(vv); err != nil { + return err + } + } + return nil +} + +func (e *Encoder) EncodeValue(v reflect.Value) error { + fn := getEncoder(v.Type()) + return fn(e, v) +} + +func (e *Encoder) EncodeNil() error { + return e.writeCode(codes.Nil) +} + +func (e *Encoder) EncodeBool(value bool) error { + if value { + return e.writeCode(codes.True) + } + return e.writeCode(codes.False) +} + +func (e *Encoder) EncodeDuration(d time.Duration) error { + return e.EncodeInt(int64(d)) +} + +func (e *Encoder) writeCode(c codes.Code) error { + return e.w.WriteByte(byte(c)) +} + +func (e *Encoder) write(b []byte) error { + _, err := e.w.Write(b) + return err +} + +func (e *Encoder) writeString(s string) error { + _, err := e.w.Write(stringToBytes(s)) + return err +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/encode_map.go b/vendor/github.com/vmihailenco/msgpack/v4/encode_map.go new file mode 100644 index 000000000..d9b954d86 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/encode_map.go @@ -0,0 +1,172 @@ +package msgpack + +import ( + "reflect" + "sort" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +func encodeMapValue(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + + if err := e.EncodeMapLen(v.Len()); err != nil { + return err + } + + for _, key := range v.MapKeys() { + if err := e.EncodeValue(key); err != nil { + return err + } + if err := e.EncodeValue(v.MapIndex(key)); err != nil { + return err + } + } + + return nil +} + +func encodeMapStringStringValue(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + + if err := e.EncodeMapLen(v.Len()); err != nil { + return err + } + + m := v.Convert(mapStringStringType).Interface().(map[string]string) + if e.flags&sortMapKeysFlag != 0 { + return e.encodeSortedMapStringString(m) + } + + for mk, mv := range m { + if err := e.EncodeString(mk); err != nil { + return err + } + if err := e.EncodeString(mv); err != nil { + return err + } + } + + return nil +} + +func encodeMapStringInterfaceValue(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + + if err := e.EncodeMapLen(v.Len()); err != nil { + return err + } + + m := v.Convert(mapStringInterfaceType).Interface().(map[string]interface{}) + if e.flags&sortMapKeysFlag != 0 { + return e.encodeSortedMapStringInterface(m) + } + + for mk, mv := range m { + if err := e.EncodeString(mk); err != nil { + return err + } + if err := e.Encode(mv); err != nil { + return err + } + } + + return nil +} + +func (e *Encoder) encodeSortedMapStringString(m map[string]string) error { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + err := e.EncodeString(k) + if err != nil { + return err + } + if err = e.EncodeString(m[k]); err != nil { + return err + } + } + + return nil +} + +func (e *Encoder) encodeSortedMapStringInterface(m map[string]interface{}) error { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + err := e.EncodeString(k) + if err != nil { + return err + } + if err = e.Encode(m[k]); err != nil { + return err + } + } + + return nil +} + +func (e *Encoder) EncodeMapLen(l int) error { + if l < 16 { + return e.writeCode(codes.FixedMapLow | codes.Code(l)) + } + if l < 65536 { + return e.write2(codes.Map16, uint16(l)) + } + return e.write4(codes.Map32, uint32(l)) +} + +func encodeStructValue(e *Encoder, strct reflect.Value) error { + var structFields *fields + if e.flags&encodeUsingJSONFlag != 0 { + structFields = jsonStructs.Fields(strct.Type()) + } else { + structFields = structs.Fields(strct.Type()) + } + + if e.flags&structAsArrayFlag != 0 || structFields.AsArray { + return encodeStructValueAsArray(e, strct, structFields.List) + } + fields := structFields.OmitEmpty(strct) + + if err := e.EncodeMapLen(len(fields)); err != nil { + return err + } + + for _, f := range fields { + if err := e.EncodeString(f.name); err != nil { + return err + } + if err := f.EncodeValue(e, strct); err != nil { + return err + } + } + + return nil +} + +func encodeStructValueAsArray(e *Encoder, strct reflect.Value, fields []*field) error { + if err := e.EncodeArrayLen(len(fields)); err != nil { + return err + } + for _, f := range fields { + if err := f.EncodeValue(e, strct); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/encode_number.go b/vendor/github.com/vmihailenco/msgpack/v4/encode_number.go new file mode 100644 index 000000000..bf3c2f851 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/encode_number.go @@ -0,0 +1,244 @@ +package msgpack + +import ( + "math" + "reflect" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +// EncodeUint8 encodes an uint8 in 2 bytes preserving type of the number. +func (e *Encoder) EncodeUint8(n uint8) error { + return e.write1(codes.Uint8, n) +} + +func (e *Encoder) encodeUint8Cond(n uint8) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeUint(uint64(n)) + } + return e.EncodeUint8(n) +} + +// EncodeUint16 encodes an uint16 in 3 bytes preserving type of the number. +func (e *Encoder) EncodeUint16(n uint16) error { + return e.write2(codes.Uint16, n) +} + +func (e *Encoder) encodeUint16Cond(n uint16) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeUint(uint64(n)) + } + return e.EncodeUint16(n) +} + +// EncodeUint32 encodes an uint16 in 5 bytes preserving type of the number. +func (e *Encoder) EncodeUint32(n uint32) error { + return e.write4(codes.Uint32, n) +} + +func (e *Encoder) encodeUint32Cond(n uint32) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeUint(uint64(n)) + } + return e.EncodeUint32(n) +} + +// EncodeUint64 encodes an uint16 in 9 bytes preserving type of the number. +func (e *Encoder) EncodeUint64(n uint64) error { + return e.write8(codes.Uint64, n) +} + +func (e *Encoder) encodeUint64Cond(n uint64) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeUint(n) + } + return e.EncodeUint64(n) +} + +// EncodeInt8 encodes an int8 in 2 bytes preserving type of the number. +func (e *Encoder) EncodeInt8(n int8) error { + return e.write1(codes.Int8, uint8(n)) +} + +func (e *Encoder) encodeInt8Cond(n int8) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeInt(int64(n)) + } + return e.EncodeInt8(n) +} + +// EncodeInt16 encodes an int16 in 3 bytes preserving type of the number. +func (e *Encoder) EncodeInt16(n int16) error { + return e.write2(codes.Int16, uint16(n)) +} + +func (e *Encoder) encodeInt16Cond(n int16) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeInt(int64(n)) + } + return e.EncodeInt16(n) +} + +// EncodeInt32 encodes an int32 in 5 bytes preserving type of the number. +func (e *Encoder) EncodeInt32(n int32) error { + return e.write4(codes.Int32, uint32(n)) +} + +func (e *Encoder) encodeInt32Cond(n int32) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeInt(int64(n)) + } + return e.EncodeInt32(n) +} + +// EncodeInt64 encodes an int64 in 9 bytes preserving type of the number. +func (e *Encoder) EncodeInt64(n int64) error { + return e.write8(codes.Int64, uint64(n)) +} + +func (e *Encoder) encodeInt64Cond(n int64) error { + if e.flags&useCompactIntsFlag != 0 { + return e.EncodeInt(n) + } + return e.EncodeInt64(n) +} + +// EncodeUnsignedNumber encodes an uint64 in 1, 2, 3, 5, or 9 bytes. +// Type of the number is lost during encoding. +func (e *Encoder) EncodeUint(n uint64) error { + if n <= math.MaxInt8 { + return e.w.WriteByte(byte(n)) + } + if n <= math.MaxUint8 { + return e.EncodeUint8(uint8(n)) + } + if n <= math.MaxUint16 { + return e.EncodeUint16(uint16(n)) + } + if n <= math.MaxUint32 { + return e.EncodeUint32(uint32(n)) + } + return e.EncodeUint64(n) +} + +// EncodeNumber encodes an int64 in 1, 2, 3, 5, or 9 bytes. +// Type of the number is lost during encoding. +func (e *Encoder) EncodeInt(n int64) error { + if n >= 0 { + return e.EncodeUint(uint64(n)) + } + if n >= int64(int8(codes.NegFixedNumLow)) { + return e.w.WriteByte(byte(n)) + } + if n >= math.MinInt8 { + return e.EncodeInt8(int8(n)) + } + if n >= math.MinInt16 { + return e.EncodeInt16(int16(n)) + } + if n >= math.MinInt32 { + return e.EncodeInt32(int32(n)) + } + return e.EncodeInt64(n) +} + +func (e *Encoder) EncodeFloat32(n float32) error { + if e.flags&useCompactFloatsFlag != 0 { + if float32(int64(n)) == n { + return e.EncodeInt(int64(n)) + } + } + return e.write4(codes.Float, math.Float32bits(n)) +} + +func (e *Encoder) EncodeFloat64(n float64) error { + if e.flags&useCompactFloatsFlag != 0 { + // Both NaN and Inf convert to int64(-0x8000000000000000) + // If n is NaN then it never compares true with any other value + // If n is Inf then it doesn't convert from int64 back to +/-Inf + // In both cases the comparison works. + if float64(int64(n)) == n { + return e.EncodeInt(int64(n)) + } + } + return e.write8(codes.Double, math.Float64bits(n)) +} + +func (e *Encoder) write1(code codes.Code, n uint8) error { + e.buf = e.buf[:2] + e.buf[0] = byte(code) + e.buf[1] = n + return e.write(e.buf) +} + +func (e *Encoder) write2(code codes.Code, n uint16) error { + e.buf = e.buf[:3] + e.buf[0] = byte(code) + e.buf[1] = byte(n >> 8) + e.buf[2] = byte(n) + return e.write(e.buf) +} + +func (e *Encoder) write4(code codes.Code, n uint32) error { + e.buf = e.buf[:5] + e.buf[0] = byte(code) + e.buf[1] = byte(n >> 24) + e.buf[2] = byte(n >> 16) + e.buf[3] = byte(n >> 8) + e.buf[4] = byte(n) + return e.write(e.buf) +} + +func (e *Encoder) write8(code codes.Code, n uint64) error { + e.buf = e.buf[:9] + e.buf[0] = byte(code) + e.buf[1] = byte(n >> 56) + e.buf[2] = byte(n >> 48) + e.buf[3] = byte(n >> 40) + e.buf[4] = byte(n >> 32) + e.buf[5] = byte(n >> 24) + e.buf[6] = byte(n >> 16) + e.buf[7] = byte(n >> 8) + e.buf[8] = byte(n) + return e.write(e.buf) +} + +func encodeUint8CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint8Cond(uint8(v.Uint())) +} + +func encodeUint16CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint16Cond(uint16(v.Uint())) +} + +func encodeUint32CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint32Cond(uint32(v.Uint())) +} + +func encodeUint64CondValue(e *Encoder, v reflect.Value) error { + return e.encodeUint64Cond(v.Uint()) +} + +func encodeInt8CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt8Cond(int8(v.Int())) +} + +func encodeInt16CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt16Cond(int16(v.Int())) +} + +func encodeInt32CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt32Cond(int32(v.Int())) +} + +func encodeInt64CondValue(e *Encoder, v reflect.Value) error { + return e.encodeInt64Cond(v.Int()) +} + +func encodeFloat32Value(e *Encoder, v reflect.Value) error { + return e.EncodeFloat32(float32(v.Float())) +} + +func encodeFloat64Value(e *Encoder, v reflect.Value) error { + return e.EncodeFloat64(v.Float()) +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/encode_slice.go b/vendor/github.com/vmihailenco/msgpack/v4/encode_slice.go new file mode 100644 index 000000000..69a9618e0 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/encode_slice.go @@ -0,0 +1,131 @@ +package msgpack + +import ( + "reflect" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +var sliceStringType = reflect.TypeOf(([]string)(nil)) + +func encodeStringValue(e *Encoder, v reflect.Value) error { + return e.EncodeString(v.String()) +} + +func encodeByteSliceValue(e *Encoder, v reflect.Value) error { + return e.EncodeBytes(v.Bytes()) +} + +func encodeByteArrayValue(e *Encoder, v reflect.Value) error { + if err := e.EncodeBytesLen(v.Len()); err != nil { + return err + } + + if v.CanAddr() { + b := v.Slice(0, v.Len()).Bytes() + return e.write(b) + } + + e.buf = grow(e.buf, v.Len()) + reflect.Copy(reflect.ValueOf(e.buf), v) + return e.write(e.buf) +} + +func grow(b []byte, n int) []byte { + if cap(b) >= n { + return b[:n] + } + b = b[:cap(b)] + b = append(b, make([]byte, n-len(b))...) + return b +} + +func (e *Encoder) EncodeBytesLen(l int) error { + if l < 256 { + return e.write1(codes.Bin8, uint8(l)) + } + if l < 65536 { + return e.write2(codes.Bin16, uint16(l)) + } + return e.write4(codes.Bin32, uint32(l)) +} + +func (e *Encoder) encodeStrLen(l int) error { + if l < 32 { + return e.writeCode(codes.FixedStrLow | codes.Code(l)) + } + if l < 256 { + return e.write1(codes.Str8, uint8(l)) + } + if l < 65536 { + return e.write2(codes.Str16, uint16(l)) + } + return e.write4(codes.Str32, uint32(l)) +} + +func (e *Encoder) EncodeString(v string) error { + if err := e.encodeStrLen(len(v)); err != nil { + return err + } + return e.writeString(v) +} + +func (e *Encoder) EncodeBytes(v []byte) error { + if v == nil { + return e.EncodeNil() + } + if err := e.EncodeBytesLen(len(v)); err != nil { + return err + } + return e.write(v) +} + +func (e *Encoder) EncodeArrayLen(l int) error { + if l < 16 { + return e.writeCode(codes.FixedArrayLow | codes.Code(l)) + } + if l < 65536 { + return e.write2(codes.Array16, uint16(l)) + } + return e.write4(codes.Array32, uint32(l)) +} + +func encodeStringSliceValue(e *Encoder, v reflect.Value) error { + ss := v.Convert(sliceStringType).Interface().([]string) + return e.encodeStringSlice(ss) +} + +func (e *Encoder) encodeStringSlice(s []string) error { + if s == nil { + return e.EncodeNil() + } + if err := e.EncodeArrayLen(len(s)); err != nil { + return err + } + for _, v := range s { + if err := e.EncodeString(v); err != nil { + return err + } + } + return nil +} + +func encodeSliceValue(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + return encodeArrayValue(e, v) +} + +func encodeArrayValue(e *Encoder, v reflect.Value) error { + l := v.Len() + if err := e.EncodeArrayLen(l); err != nil { + return err + } + for i := 0; i < l; i++ { + if err := e.EncodeValue(v.Index(i)); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/encode_value.go b/vendor/github.com/vmihailenco/msgpack/v4/encode_value.go new file mode 100644 index 000000000..335fcdb7e --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/encode_value.go @@ -0,0 +1,216 @@ +package msgpack + +import ( + "encoding" + "fmt" + "reflect" +) + +var valueEncoders []encoderFunc + +//nolint:gochecknoinits +func init() { + valueEncoders = []encoderFunc{ + reflect.Bool: encodeBoolValue, + reflect.Int: encodeInt64CondValue, + reflect.Int8: encodeInt8CondValue, + reflect.Int16: encodeInt16CondValue, + reflect.Int32: encodeInt32CondValue, + reflect.Int64: encodeInt64CondValue, + reflect.Uint: encodeUint64CondValue, + reflect.Uint8: encodeUint8CondValue, + reflect.Uint16: encodeUint16CondValue, + reflect.Uint32: encodeUint32CondValue, + reflect.Uint64: encodeUint64CondValue, + reflect.Float32: encodeFloat32Value, + reflect.Float64: encodeFloat64Value, + reflect.Complex64: encodeUnsupportedValue, + reflect.Complex128: encodeUnsupportedValue, + reflect.Array: encodeArrayValue, + reflect.Chan: encodeUnsupportedValue, + reflect.Func: encodeUnsupportedValue, + reflect.Interface: encodeInterfaceValue, + reflect.Map: encodeMapValue, + reflect.Ptr: encodeUnsupportedValue, + reflect.Slice: encodeSliceValue, + reflect.String: encodeStringValue, + reflect.Struct: encodeStructValue, + reflect.UnsafePointer: encodeUnsupportedValue, + } +} + +func getEncoder(typ reflect.Type) encoderFunc { + if v, ok := typeEncMap.Load(typ); ok { + return v.(encoderFunc) + } + fn := _getEncoder(typ) + typeEncMap.Store(typ, fn) + return fn +} + +func _getEncoder(typ reflect.Type) encoderFunc { + kind := typ.Kind() + + if kind == reflect.Ptr { + if _, ok := typeEncMap.Load(typ.Elem()); ok { + return ptrEncoderFunc(typ) + } + } + + if typ.Implements(customEncoderType) { + return encodeCustomValue + } + if typ.Implements(marshalerType) { + return marshalValue + } + if typ.Implements(binaryMarshalerType) { + return marshalBinaryValue + } + + // Addressable struct field value. + if kind != reflect.Ptr { + ptr := reflect.PtrTo(typ) + if ptr.Implements(customEncoderType) { + return encodeCustomValuePtr + } + if ptr.Implements(marshalerType) { + return marshalValuePtr + } + if ptr.Implements(binaryMarshalerType) { + return marshalBinaryValuePtr + } + } + + if typ == errorType { + return encodeErrorValue + } + + switch kind { + case reflect.Ptr: + return ptrEncoderFunc(typ) + case reflect.Slice: + elem := typ.Elem() + if elem.Kind() == reflect.Uint8 { + return encodeByteSliceValue + } + if elem == stringType { + return encodeStringSliceValue + } + case reflect.Array: + if typ.Elem().Kind() == reflect.Uint8 { + return encodeByteArrayValue + } + case reflect.Map: + if typ.Key() == stringType { + switch typ.Elem() { + case stringType: + return encodeMapStringStringValue + case interfaceType: + return encodeMapStringInterfaceValue + } + } + } + + return valueEncoders[kind] +} + +func ptrEncoderFunc(typ reflect.Type) encoderFunc { + encoder := getEncoder(typ.Elem()) + return func(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + return encoder(e, v.Elem()) + } +} + +func encodeCustomValuePtr(e *Encoder, v reflect.Value) error { + if !v.CanAddr() { + return fmt.Errorf("msgpack: Encode(non-addressable %T)", v.Interface()) + } + encoder := v.Addr().Interface().(CustomEncoder) + return encoder.EncodeMsgpack(e) +} + +func encodeCustomValue(e *Encoder, v reflect.Value) error { + if nilable(v) && v.IsNil() { + return e.EncodeNil() + } + + encoder := v.Interface().(CustomEncoder) + return encoder.EncodeMsgpack(e) +} + +func marshalValuePtr(e *Encoder, v reflect.Value) error { + if !v.CanAddr() { + return fmt.Errorf("msgpack: Encode(non-addressable %T)", v.Interface()) + } + return marshalValue(e, v.Addr()) +} + +func marshalValue(e *Encoder, v reflect.Value) error { + if nilable(v) && v.IsNil() { + return e.EncodeNil() + } + + marshaler := v.Interface().(Marshaler) + b, err := marshaler.MarshalMsgpack() + if err != nil { + return err + } + _, err = e.w.Write(b) + return err +} + +func encodeBoolValue(e *Encoder, v reflect.Value) error { + return e.EncodeBool(v.Bool()) +} + +func encodeInterfaceValue(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + return e.EncodeValue(v.Elem()) +} + +func encodeErrorValue(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + return e.EncodeString(v.Interface().(error).Error()) +} + +func encodeUnsupportedValue(e *Encoder, v reflect.Value) error { + return fmt.Errorf("msgpack: Encode(unsupported %s)", v.Type()) +} + +func nilable(v reflect.Value) bool { + switch v.Kind() { + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + return true + } + return false +} + +//------------------------------------------------------------------------------ + +func marshalBinaryValuePtr(e *Encoder, v reflect.Value) error { + if !v.CanAddr() { + return fmt.Errorf("msgpack: Encode(non-addressable %T)", v.Interface()) + } + return marshalBinaryValue(e, v.Addr()) +} + +func marshalBinaryValue(e *Encoder, v reflect.Value) error { + if nilable(v) && v.IsNil() { + return e.EncodeNil() + } + + marshaler := v.Interface().(encoding.BinaryMarshaler) + data, err := marshaler.MarshalBinary() + if err != nil { + return err + } + + return e.EncodeBytes(data) +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/ext.go b/vendor/github.com/vmihailenco/msgpack/v4/ext.go new file mode 100644 index 000000000..17e709bc8 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/ext.go @@ -0,0 +1,244 @@ +package msgpack + +import ( + "bytes" + "fmt" + "reflect" + "sync" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +type extInfo struct { + Type reflect.Type + Decoder decoderFunc +} + +var extTypes = make(map[int8]*extInfo) + +var bufferPool = &sync.Pool{ + New: func() interface{} { + return new(bytes.Buffer) + }, +} + +// RegisterExt records a type, identified by a value for that type, +// under the provided id. That id will identify the concrete type of a value +// sent or received as an interface variable. Only types that will be +// transferred as implementations of interface values need to be registered. +// Expecting to be used only during initialization, it panics if the mapping +// between types and ids is not a bijection. +func RegisterExt(id int8, value interface{}) { + typ := reflect.TypeOf(value) + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + ptr := reflect.PtrTo(typ) + + if _, ok := extTypes[id]; ok { + panic(fmt.Errorf("msgpack: ext with id=%d is already registered", id)) + } + + registerExt(id, ptr, getEncoder(ptr), getDecoder(ptr)) + registerExt(id, typ, getEncoder(typ), getDecoder(typ)) +} + +func registerExt(id int8, typ reflect.Type, enc encoderFunc, dec decoderFunc) { + if enc != nil { + typeEncMap.Store(typ, makeExtEncoder(id, enc)) + } + if dec != nil { + extTypes[id] = &extInfo{ + Type: typ, + Decoder: dec, + } + typeDecMap.Store(typ, makeExtDecoder(id, dec)) + } +} + +func (e *Encoder) EncodeExtHeader(typeID int8, length int) error { + if err := e.encodeExtLen(length); err != nil { + return err + } + if err := e.w.WriteByte(byte(typeID)); err != nil { + return err + } + return nil +} + +func makeExtEncoder(typeID int8, enc encoderFunc) encoderFunc { + return func(e *Encoder, v reflect.Value) error { + buf := bufferPool.Get().(*bytes.Buffer) + defer bufferPool.Put(buf) + buf.Reset() + + oldw := e.w + e.w = buf + err := enc(e, v) + e.w = oldw + + if err != nil { + return err + } + + err = e.EncodeExtHeader(typeID, buf.Len()) + if err != nil { + return err + } + return e.write(buf.Bytes()) + } +} + +func makeExtDecoder(typeID int8, dec decoderFunc) decoderFunc { + return func(d *Decoder, v reflect.Value) error { + c, err := d.PeekCode() + if err != nil { + return err + } + + if !codes.IsExt(c) { + return dec(d, v) + } + + id, extLen, err := d.DecodeExtHeader() + if err != nil { + return err + } + + if id != typeID { + return fmt.Errorf("msgpack: got ext type=%d, wanted %d", id, typeID) + } + + d.extLen = extLen + return dec(d, v) + } +} + +func (e *Encoder) encodeExtLen(l int) error { + switch l { + case 1: + return e.writeCode(codes.FixExt1) + case 2: + return e.writeCode(codes.FixExt2) + case 4: + return e.writeCode(codes.FixExt4) + case 8: + return e.writeCode(codes.FixExt8) + case 16: + return e.writeCode(codes.FixExt16) + } + if l < 256 { + return e.write1(codes.Ext8, uint8(l)) + } + if l < 65536 { + return e.write2(codes.Ext16, uint16(l)) + } + return e.write4(codes.Ext32, uint32(l)) +} + +func (d *Decoder) parseExtLen(c codes.Code) (int, error) { + switch c { + case codes.FixExt1: + return 1, nil + case codes.FixExt2: + return 2, nil + case codes.FixExt4: + return 4, nil + case codes.FixExt8: + return 8, nil + case codes.FixExt16: + return 16, nil + case codes.Ext8: + n, err := d.uint8() + return int(n), err + case codes.Ext16: + n, err := d.uint16() + return int(n), err + case codes.Ext32: + n, err := d.uint32() + return int(n), err + default: + return 0, fmt.Errorf("msgpack: invalid code=%x decoding ext length", c) + } +} + +func (d *Decoder) extHeader(c codes.Code) (int8, int, error) { + length, err := d.parseExtLen(c) + if err != nil { + return 0, 0, err + } + + typeID, err := d.readCode() + if err != nil { + return 0, 0, err + } + + return int8(typeID), length, nil +} + +func (d *Decoder) DecodeExtHeader() (typeID int8, length int, err error) { + c, err := d.readCode() + if err != nil { + return + } + return d.extHeader(c) +} + +func (d *Decoder) extInterface(c codes.Code) (interface{}, error) { + extID, extLen, err := d.extHeader(c) + if err != nil { + return nil, err + } + + info, ok := extTypes[extID] + if !ok { + return nil, fmt.Errorf("msgpack: unknown ext id=%d", extID) + } + + v := reflect.New(info.Type) + + d.extLen = extLen + err = info.Decoder(d, v.Elem()) + d.extLen = 0 + if err != nil { + return nil, err + } + + return v.Interface(), nil +} + +func (d *Decoder) skipExt(c codes.Code) error { + n, err := d.parseExtLen(c) + if err != nil { + return err + } + return d.skipN(n + 1) +} + +func (d *Decoder) skipExtHeader(c codes.Code) error { + // Read ext type. + _, err := d.readCode() + if err != nil { + return err + } + // Read ext body len. + for i := 0; i < extHeaderLen(c); i++ { + _, err := d.readCode() + if err != nil { + return err + } + } + return nil +} + +func extHeaderLen(c codes.Code) int { + switch c { + case codes.Ext8: + return 1 + case codes.Ext16: + return 2 + case codes.Ext32: + return 4 + } + return 0 +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/go.mod b/vendor/github.com/vmihailenco/msgpack/v4/go.mod new file mode 100644 index 000000000..d935fa654 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/go.mod @@ -0,0 +1,13 @@ +module github.com/vmihailenco/msgpack/v4 + +require ( + github.com/davecgh/go-spew v1.1.1 + github.com/golang/protobuf v1.3.4 // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/vmihailenco/tagparser v0.1.1 + golang.org/x/net v0.0.0-20200301022130-244492dfa37a // indirect + google.golang.org/appengine v1.6.5 + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 +) + +go 1.11 diff --git a/vendor/github.com/vmihailenco/msgpack/v4/go.sum b/vendor/github.com/vmihailenco/msgpack/v4/go.sum new file mode 100644 index 000000000..be608ec08 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/go.sum @@ -0,0 +1,24 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/vmihailenco/msgpack/v4/intern.go b/vendor/github.com/vmihailenco/msgpack/v4/intern.go new file mode 100644 index 000000000..6ca569273 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/intern.go @@ -0,0 +1,236 @@ +package msgpack + +import ( + "encoding/binary" + "errors" + "fmt" + "math" + "reflect" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +var internStringExtID int8 = -128 + +var errUnexpectedCode = errors.New("msgpack: unexpected code") + +func encodeInternInterfaceValue(e *Encoder, v reflect.Value) error { + if v.IsNil() { + return e.EncodeNil() + } + + v = v.Elem() + if v.Kind() == reflect.String { + return encodeInternStringValue(e, v) + } + return e.EncodeValue(v) +} + +func encodeInternStringValue(e *Encoder, v reflect.Value) error { + s := v.String() + + if s != "" { + if idx, ok := e.intern[s]; ok { + return e.internStringIndex(idx) + } + + if e.intern == nil { + e.intern = make(map[string]int) + } + + idx := len(e.intern) + e.intern[s] = idx + } + + return e.EncodeString(s) +} + +func (e *Encoder) internStringIndex(idx int) error { + if idx < math.MaxUint8 { + if err := e.writeCode(codes.FixExt1); err != nil { + return err + } + if err := e.w.WriteByte(byte(internStringExtID)); err != nil { + return err + } + return e.w.WriteByte(byte(idx)) + } + + if idx < math.MaxUint16 { + if err := e.writeCode(codes.FixExt2); err != nil { + return err + } + if err := e.w.WriteByte(byte(internStringExtID)); err != nil { + return err + } + if err := e.w.WriteByte(byte(idx >> 8)); err != nil { + return err + } + return e.w.WriteByte(byte(idx)) + } + + if int64(idx) < math.MaxUint32 { + if err := e.writeCode(codes.FixExt4); err != nil { + return err + } + if err := e.w.WriteByte(byte(internStringExtID)); err != nil { + return err + } + if err := e.w.WriteByte(byte(idx >> 24)); err != nil { + return err + } + if err := e.w.WriteByte(byte(idx >> 16)); err != nil { + return err + } + if err := e.w.WriteByte(byte(idx >> 8)); err != nil { + return err + } + return e.w.WriteByte(byte(idx)) + } + + return fmt.Errorf("msgpack: intern string index=%d is too large", idx) +} + +//------------------------------------------------------------------------------ + +func decodeInternInterfaceValue(d *Decoder, v reflect.Value) error { + c, err := d.readCode() + if err != nil { + return err + } + + s, err := d.internString(c) + if err == nil { + v.Set(reflect.ValueOf(s)) + return nil + } + if err != nil && err != errUnexpectedCode { + return err + } + + if err := d.s.UnreadByte(); err != nil { + return err + } + + return decodeInterfaceValue(d, v) +} + +func decodeInternStringValue(d *Decoder, v reflect.Value) error { + if err := mustSet(v); err != nil { + return err + } + + c, err := d.readCode() + if err != nil { + return err + } + + s, err := d.internString(c) + if err != nil { + if err == errUnexpectedCode { + return fmt.Errorf("msgpack: invalid code=%x decoding intern string", c) + } + return err + } + + v.SetString(s) + return nil +} + +func (d *Decoder) internString(c codes.Code) (string, error) { + if codes.IsFixedString(c) { + n := int(c & codes.FixedStrMask) + return d.internStringWithLen(n) + } + + switch c { + case codes.FixExt1, codes.FixExt2, codes.FixExt4: + typeID, length, err := d.extHeader(c) + if err != nil { + return "", err + } + if typeID != internStringExtID { + err := fmt.Errorf("msgpack: got ext type=%d, wanted %d", + typeID, internStringExtID) + return "", err + } + + idx, err := d.internStringIndex(length) + if err != nil { + return "", err + } + + return d.internStringAtIndex(idx) + case codes.Str8, codes.Bin8: + n, err := d.uint8() + if err != nil { + return "", err + } + return d.internStringWithLen(int(n)) + case codes.Str16, codes.Bin16: + n, err := d.uint16() + if err != nil { + return "", err + } + return d.internStringWithLen(int(n)) + case codes.Str32, codes.Bin32: + n, err := d.uint32() + if err != nil { + return "", err + } + return d.internStringWithLen(int(n)) + } + + return "", errUnexpectedCode +} + +func (d *Decoder) internStringIndex(length int) (int, error) { + switch length { + case 1: + c, err := d.s.ReadByte() + if err != nil { + return 0, err + } + return int(c), nil + case 2: + b, err := d.readN(2) + if err != nil { + return 0, err + } + n := binary.BigEndian.Uint16(b) + return int(n), nil + case 4: + b, err := d.readN(4) + if err != nil { + return 0, err + } + n := binary.BigEndian.Uint32(b) + return int(n), nil + } + + err := fmt.Errorf("msgpack: unsupported intern string index length=%d", length) + return 0, err +} + +func (d *Decoder) internStringAtIndex(idx int) (string, error) { + if idx >= len(d.intern) { + err := fmt.Errorf("msgpack: intern string with index=%d does not exist", idx) + return "", err + } + return d.intern[idx], nil +} + +func (d *Decoder) internStringWithLen(n int) (string, error) { + if n <= 0 { + return "", nil + } + + s, err := d.stringWithLen(n) + if err != nil { + return "", err + } + + d.intern = append(d.intern, s) + + return s, nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/msgpack.go b/vendor/github.com/vmihailenco/msgpack/v4/msgpack.go new file mode 100644 index 000000000..220b43c47 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/msgpack.go @@ -0,0 +1,17 @@ +package msgpack + +type Marshaler interface { + MarshalMsgpack() ([]byte, error) +} + +type Unmarshaler interface { + UnmarshalMsgpack([]byte) error +} + +type CustomEncoder interface { + EncodeMsgpack(*Encoder) error +} + +type CustomDecoder interface { + DecodeMsgpack(*Decoder) error +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/safe.go b/vendor/github.com/vmihailenco/msgpack/v4/safe.go new file mode 100644 index 000000000..8352c9dce --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/safe.go @@ -0,0 +1,13 @@ +// +build appengine + +package msgpack + +// bytesToString converts byte slice to string. +func bytesToString(b []byte) string { + return string(b) +} + +// stringToBytes converts string to byte slice. +func stringToBytes(s string) []byte { + return []byte(s) +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/time.go b/vendor/github.com/vmihailenco/msgpack/v4/time.go new file mode 100644 index 000000000..bf53eb2a3 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/time.go @@ -0,0 +1,149 @@ +package msgpack + +import ( + "encoding/binary" + "fmt" + "reflect" + "time" + + "github.com/vmihailenco/msgpack/v4/codes" +) + +var timeExtID int8 = -1 + +var timePtrType = reflect.TypeOf((*time.Time)(nil)) + +//nolint:gochecknoinits +func init() { + registerExt(timeExtID, timePtrType.Elem(), encodeTimeValue, decodeTimeValue) +} + +func (e *Encoder) EncodeTime(tm time.Time) error { + b := e.encodeTime(tm) + if err := e.encodeExtLen(len(b)); err != nil { + return err + } + if err := e.w.WriteByte(byte(timeExtID)); err != nil { + return err + } + return e.write(b) +} + +func (e *Encoder) encodeTime(tm time.Time) []byte { + secs := uint64(tm.Unix()) + if secs>>34 == 0 { + data := uint64(tm.Nanosecond())<<34 | secs + if data&0xffffffff00000000 == 0 { + b := e.timeBuf[:4] + binary.BigEndian.PutUint32(b, uint32(data)) + return b + } + b := e.timeBuf[:8] + binary.BigEndian.PutUint64(b, data) + return b + } + + b := e.timeBuf[:12] + binary.BigEndian.PutUint32(b, uint32(tm.Nanosecond())) + binary.BigEndian.PutUint64(b[4:], secs) + return b +} + +func (d *Decoder) DecodeTime() (time.Time, error) { + tm, err := d.decodeTime() + if err != nil { + return tm, err + } + + if tm.IsZero() { + // Assume that zero time does not have timezone information. + return tm.UTC(), nil + } + return tm, nil +} + +func (d *Decoder) decodeTime() (time.Time, error) { + extLen := d.extLen + d.extLen = 0 + if extLen == 0 { + c, err := d.readCode() + if err != nil { + return time.Time{}, err + } + + // Legacy format. + if c == codes.FixedArrayLow|2 { + sec, err := d.DecodeInt64() + if err != nil { + return time.Time{}, err + } + + nsec, err := d.DecodeInt64() + if err != nil { + return time.Time{}, err + } + + return time.Unix(sec, nsec), nil + } + + if codes.IsString(c) { + s, err := d.string(c) + if err != nil { + return time.Time{}, err + } + return time.Parse(time.RFC3339Nano, s) + } + + extLen, err = d.parseExtLen(c) + if err != nil { + return time.Time{}, err + } + + // Skip ext id. + _, err = d.s.ReadByte() + if err != nil { + return time.Time{}, nil + } + } + + b, err := d.readN(extLen) + if err != nil { + return time.Time{}, err + } + + switch len(b) { + case 4: + sec := binary.BigEndian.Uint32(b) + return time.Unix(int64(sec), 0), nil + case 8: + sec := binary.BigEndian.Uint64(b) + nsec := int64(sec >> 34) + sec &= 0x00000003ffffffff + return time.Unix(int64(sec), nsec), nil + case 12: + nsec := binary.BigEndian.Uint32(b) + sec := binary.BigEndian.Uint64(b[4:]) + return time.Unix(int64(sec), int64(nsec)), nil + default: + err = fmt.Errorf("msgpack: invalid ext len=%d decoding time", extLen) + return time.Time{}, err + } +} + +func encodeTimeValue(e *Encoder, v reflect.Value) error { + tm := v.Interface().(time.Time) + b := e.encodeTime(tm) + return e.write(b) +} + +func decodeTimeValue(d *Decoder, v reflect.Value) error { + tm, err := d.DecodeTime() + if err != nil { + return err + } + + ptr := v.Addr().Interface().(*time.Time) + *ptr = tm + + return nil +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/types.go b/vendor/github.com/vmihailenco/msgpack/v4/types.go new file mode 100644 index 000000000..08cf099dd --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/types.go @@ -0,0 +1,382 @@ +package msgpack + +import ( + "encoding" + "fmt" + "log" + "reflect" + "sync" + + "github.com/vmihailenco/tagparser" +) + +var errorType = reflect.TypeOf((*error)(nil)).Elem() + +var ( + customEncoderType = reflect.TypeOf((*CustomEncoder)(nil)).Elem() + customDecoderType = reflect.TypeOf((*CustomDecoder)(nil)).Elem() +) + +var ( + marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() + unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() +) + +var ( + binaryMarshalerType = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem() + binaryUnmarshalerType = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem() +) + +type ( + encoderFunc func(*Encoder, reflect.Value) error + decoderFunc func(*Decoder, reflect.Value) error +) + +var ( + typeEncMap sync.Map + typeDecMap sync.Map +) + +// Register registers encoder and decoder functions for a value. +// This is low level API and in most cases you should prefer implementing +// Marshaler/CustomEncoder and Unmarshaler/CustomDecoder interfaces. +func Register(value interface{}, enc encoderFunc, dec decoderFunc) { + typ := reflect.TypeOf(value) + if enc != nil { + typeEncMap.Store(typ, enc) + } + if dec != nil { + typeDecMap.Store(typ, dec) + } +} + +//------------------------------------------------------------------------------ + +var ( + structs = newStructCache(false) + jsonStructs = newStructCache(true) +) + +type structCache struct { + m sync.Map + + useJSONTag bool +} + +func newStructCache(useJSONTag bool) *structCache { + return &structCache{ + useJSONTag: useJSONTag, + } +} + +func (m *structCache) Fields(typ reflect.Type) *fields { + if v, ok := m.m.Load(typ); ok { + return v.(*fields) + } + + fs := getFields(typ, m.useJSONTag) + m.m.Store(typ, fs) + return fs +} + +//------------------------------------------------------------------------------ + +type field struct { + name string + index []int + omitEmpty bool + encoder encoderFunc + decoder decoderFunc +} + +func (f *field) Omit(strct reflect.Value) bool { + v, isNil := fieldByIndex(strct, f.index) + if isNil { + return true + } + return f.omitEmpty && isEmptyValue(v) +} + +func (f *field) EncodeValue(e *Encoder, strct reflect.Value) error { + v, isNil := fieldByIndex(strct, f.index) + if isNil { + return e.EncodeNil() + } + return f.encoder(e, v) +} + +func (f *field) DecodeValue(d *Decoder, strct reflect.Value) error { + v := fieldByIndexAlloc(strct, f.index) + return f.decoder(d, v) +} + +//------------------------------------------------------------------------------ + +type fields struct { + Type reflect.Type + Map map[string]*field + List []*field + AsArray bool + + hasOmitEmpty bool +} + +func newFields(typ reflect.Type) *fields { + return &fields{ + Type: typ, + Map: make(map[string]*field, typ.NumField()), + List: make([]*field, 0, typ.NumField()), + } +} + +func (fs *fields) Add(field *field) { + fs.warnIfFieldExists(field.name) + fs.Map[field.name] = field + fs.List = append(fs.List, field) + if field.omitEmpty { + fs.hasOmitEmpty = true + } +} + +func (fs *fields) warnIfFieldExists(name string) { + if _, ok := fs.Map[name]; ok { + log.Printf("msgpack: %s already has field=%s", fs.Type, name) + } +} + +func (fs *fields) OmitEmpty(strct reflect.Value) []*field { + if !fs.hasOmitEmpty { + return fs.List + } + + fields := make([]*field, 0, len(fs.List)) + + for _, f := range fs.List { + if !f.Omit(strct) { + fields = append(fields, f) + } + } + + return fields +} + +func getFields(typ reflect.Type, useJSONTag bool) *fields { + fs := newFields(typ) + + var omitEmpty bool + for i := 0; i < typ.NumField(); i++ { + f := typ.Field(i) + + tagStr := f.Tag.Get("msgpack") + if useJSONTag && tagStr == "" { + tagStr = f.Tag.Get("json") + } + + tag := tagparser.Parse(tagStr) + if tag.Name == "-" { + continue + } + + if f.Name == "_msgpack" { + if tag.HasOption("asArray") { + fs.AsArray = true + } + if tag.HasOption("omitempty") { + omitEmpty = true + } + } + + if f.PkgPath != "" && !f.Anonymous { + continue + } + + field := &field{ + name: tag.Name, + index: f.Index, + omitEmpty: omitEmpty || tag.HasOption("omitempty"), + } + + if tag.HasOption("intern") { + switch f.Type.Kind() { + case reflect.Interface: + field.encoder = encodeInternInterfaceValue + field.decoder = decodeInternInterfaceValue + case reflect.String: + field.encoder = encodeInternStringValue + field.decoder = decodeInternStringValue + default: + err := fmt.Errorf("msgpack: intern strings are not supported on %s", f.Type) + panic(err) + } + } else { + field.encoder = getEncoder(f.Type) + field.decoder = getDecoder(f.Type) + } + + if field.name == "" { + field.name = f.Name + } + + if f.Anonymous && !tag.HasOption("noinline") { + inline := tag.HasOption("inline") + if inline { + inlineFields(fs, f.Type, field, useJSONTag) + } else { + inline = shouldInline(fs, f.Type, field, useJSONTag) + } + + if inline { + if _, ok := fs.Map[field.name]; ok { + log.Printf("msgpack: %s already has field=%s", fs.Type, field.name) + } + fs.Map[field.name] = field + continue + } + } + + fs.Add(field) + + if alias, ok := tag.Options["alias"]; ok { + fs.warnIfFieldExists(alias) + fs.Map[alias] = field + } + } + return fs +} + +var ( + encodeStructValuePtr uintptr + decodeStructValuePtr uintptr +) + +//nolint:gochecknoinits +func init() { + encodeStructValuePtr = reflect.ValueOf(encodeStructValue).Pointer() + decodeStructValuePtr = reflect.ValueOf(decodeStructValue).Pointer() +} + +func inlineFields(fs *fields, typ reflect.Type, f *field, useJSONTag bool) { + inlinedFields := getFields(typ, useJSONTag).List + for _, field := range inlinedFields { + if _, ok := fs.Map[field.name]; ok { + // Don't inline shadowed fields. + continue + } + field.index = append(f.index, field.index...) + fs.Add(field) + } +} + +func shouldInline(fs *fields, typ reflect.Type, f *field, useJSONTag bool) bool { + var encoder encoderFunc + var decoder decoderFunc + + if typ.Kind() == reflect.Struct { + encoder = f.encoder + decoder = f.decoder + } else { + for typ.Kind() == reflect.Ptr { + typ = typ.Elem() + encoder = getEncoder(typ) + decoder = getDecoder(typ) + } + if typ.Kind() != reflect.Struct { + return false + } + } + + if reflect.ValueOf(encoder).Pointer() != encodeStructValuePtr { + return false + } + if reflect.ValueOf(decoder).Pointer() != decodeStructValuePtr { + return false + } + + inlinedFields := getFields(typ, useJSONTag).List + for _, field := range inlinedFields { + if _, ok := fs.Map[field.name]; ok { + // Don't auto inline if there are shadowed fields. + return false + } + } + + for _, field := range inlinedFields { + field.index = append(f.index, field.index...) + fs.Add(field) + } + return true +} + +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} + +func fieldByIndex(v reflect.Value, index []int) (_ reflect.Value, isNil bool) { + if len(index) == 1 { + return v.Field(index[0]), false + } + + for i, idx := range index { + if i > 0 { + if v.Kind() == reflect.Ptr { + if v.IsNil() { + return v, true + } + v = v.Elem() + } + } + v = v.Field(idx) + } + + return v, false +} + +func fieldByIndexAlloc(v reflect.Value, index []int) reflect.Value { + if len(index) == 1 { + return v.Field(index[0]) + } + + for i, idx := range index { + if i > 0 { + var ok bool + v, ok = indirectNew(v) + if !ok { + return v + } + } + v = v.Field(idx) + } + + return v +} + +func indirectNew(v reflect.Value) (reflect.Value, bool) { + if v.Kind() == reflect.Ptr { + if v.IsNil() { + if !v.CanSet() { + return v, false + } + elemType := v.Type().Elem() + if elemType.Kind() != reflect.Struct { + return v, false + } + v.Set(reflect.New(elemType)) + } + v = v.Elem() + } + return v, true +} diff --git a/vendor/github.com/vmihailenco/msgpack/v4/unsafe.go b/vendor/github.com/vmihailenco/msgpack/v4/unsafe.go new file mode 100644 index 000000000..50c0da8b5 --- /dev/null +++ b/vendor/github.com/vmihailenco/msgpack/v4/unsafe.go @@ -0,0 +1,22 @@ +// +build !appengine + +package msgpack + +import ( + "unsafe" +) + +// bytesToString converts byte slice to string. +func bytesToString(b []byte) string { //nolint:deadcode,unused + return *(*string)(unsafe.Pointer(&b)) +} + +// stringToBytes converts string to byte slice. +func stringToBytes(s string) []byte { + return *(*[]byte)(unsafe.Pointer( + &struct { + string + Cap int + }{s, len(s)}, + )) +} diff --git a/vendor/github.com/vmihailenco/tagparser/.travis.yml b/vendor/github.com/vmihailenco/tagparser/.travis.yml new file mode 100644 index 000000000..ec5384523 --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/.travis.yml @@ -0,0 +1,24 @@ +dist: xenial +sudo: false +language: go + +go: + - 1.11.x + - 1.12.x + - tip + +matrix: + allow_failures: + - go: tip + +env: + - GO111MODULE=on + +go_import_path: github.com/vmihailenco/tagparser + +before_install: + - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.17.1 + +script: + - make + - golangci-lint run diff --git a/vendor/github.com/vmihailenco/tagparser/LICENSE b/vendor/github.com/vmihailenco/tagparser/LICENSE new file mode 100644 index 000000000..3fc93fdff --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2019 The github.com/vmihailenco/tagparser Authors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/vmihailenco/tagparser/Makefile b/vendor/github.com/vmihailenco/tagparser/Makefile new file mode 100644 index 000000000..fe9dc5bdb --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/Makefile @@ -0,0 +1,8 @@ +all: + go test ./... + go test ./... -short -race + go test ./... -run=NONE -bench=. -benchmem + env GOOS=linux GOARCH=386 go test ./... + go vet ./... + go get github.com/gordonklaus/ineffassign + ineffassign . diff --git a/vendor/github.com/vmihailenco/tagparser/README.md b/vendor/github.com/vmihailenco/tagparser/README.md new file mode 100644 index 000000000..411aa5444 --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/README.md @@ -0,0 +1,24 @@ +# Opinionated Golang tag parser + +[![Build Status](https://travis-ci.org/vmihailenco/tagparser.png?branch=master)](https://travis-ci.org/vmihailenco/tagparser) +[![GoDoc](https://godoc.org/github.com/vmihailenco/tagparser?status.svg)](https://godoc.org/github.com/vmihailenco/tagparser) + +## Installation + +Install: + +```shell +go get -u github.com/vmihailenco/tagparser +``` + +## Quickstart + +```go +func ExampleParse() { + tag := tagparser.Parse("some_name,key:value,key2:'complex value'") + fmt.Println(tag.Name) + fmt.Println(tag.Options) + // Output: some_name + // map[key:value key2:'complex value'] +} +``` diff --git a/vendor/github.com/vmihailenco/tagparser/go.mod b/vendor/github.com/vmihailenco/tagparser/go.mod new file mode 100644 index 000000000..961a46ddb --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/go.mod @@ -0,0 +1,3 @@ +module github.com/vmihailenco/tagparser + +go 1.13 diff --git a/vendor/github.com/vmihailenco/tagparser/internal/parser/parser.go b/vendor/github.com/vmihailenco/tagparser/internal/parser/parser.go new file mode 100644 index 000000000..2de1c6f7b --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/internal/parser/parser.go @@ -0,0 +1,82 @@ +package parser + +import ( + "bytes" + + "github.com/vmihailenco/tagparser/internal" +) + +type Parser struct { + b []byte + i int +} + +func New(b []byte) *Parser { + return &Parser{ + b: b, + } +} + +func NewString(s string) *Parser { + return New(internal.StringToBytes(s)) +} + +func (p *Parser) Bytes() []byte { + return p.b[p.i:] +} + +func (p *Parser) Valid() bool { + return p.i < len(p.b) +} + +func (p *Parser) Read() byte { + if p.Valid() { + c := p.b[p.i] + p.Advance() + return c + } + return 0 +} + +func (p *Parser) Peek() byte { + if p.Valid() { + return p.b[p.i] + } + return 0 +} + +func (p *Parser) Advance() { + p.i++ +} + +func (p *Parser) Skip(skip byte) bool { + if p.Peek() == skip { + p.Advance() + return true + } + return false +} + +func (p *Parser) SkipBytes(skip []byte) bool { + if len(skip) > len(p.b[p.i:]) { + return false + } + if !bytes.Equal(p.b[p.i:p.i+len(skip)], skip) { + return false + } + p.i += len(skip) + return true +} + +func (p *Parser) ReadSep(sep byte) ([]byte, bool) { + ind := bytes.IndexByte(p.b[p.i:], sep) + if ind == -1 { + b := p.b[p.i:] + p.i = len(p.b) + return b, false + } + + b := p.b[p.i : p.i+ind] + p.i += ind + 1 + return b, true +} diff --git a/vendor/github.com/vmihailenco/tagparser/internal/safe.go b/vendor/github.com/vmihailenco/tagparser/internal/safe.go new file mode 100644 index 000000000..870fe541f --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/internal/safe.go @@ -0,0 +1,11 @@ +// +build appengine + +package internal + +func BytesToString(b []byte) string { + return string(b) +} + +func StringToBytes(s string) []byte { + return []byte(s) +} diff --git a/vendor/github.com/vmihailenco/tagparser/internal/unsafe.go b/vendor/github.com/vmihailenco/tagparser/internal/unsafe.go new file mode 100644 index 000000000..f8bc18d91 --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/internal/unsafe.go @@ -0,0 +1,22 @@ +// +build !appengine + +package internal + +import ( + "unsafe" +) + +// BytesToString converts byte slice to string. +func BytesToString(b []byte) string { + return *(*string)(unsafe.Pointer(&b)) +} + +// StringToBytes converts string to byte slice. +func StringToBytes(s string) []byte { + return *(*[]byte)(unsafe.Pointer( + &struct { + string + Cap int + }{s, len(s)}, + )) +} diff --git a/vendor/github.com/vmihailenco/tagparser/tagparser.go b/vendor/github.com/vmihailenco/tagparser/tagparser.go new file mode 100644 index 000000000..431002aef --- /dev/null +++ b/vendor/github.com/vmihailenco/tagparser/tagparser.go @@ -0,0 +1,181 @@ +package tagparser + +import ( + "strings" + + "github.com/vmihailenco/tagparser/internal/parser" +) + +type Tag struct { + Name string + Options map[string]string +} + +func (t *Tag) HasOption(name string) bool { + _, ok := t.Options[name] + return ok +} + +func Parse(s string) *Tag { + p := &tagParser{ + Parser: parser.NewString(s), + } + p.parseKey() + return &p.Tag +} + +type tagParser struct { + *parser.Parser + + Tag Tag + hasName bool + key string +} + +func (p *tagParser) setTagOption(key, value string) { + key = strings.TrimSpace(key) + value = strings.TrimSpace(value) + + if !p.hasName { + p.hasName = true + if key == "" { + p.Tag.Name = value + return + } + } + if p.Tag.Options == nil { + p.Tag.Options = make(map[string]string) + } + if key == "" { + p.Tag.Options[value] = "" + } else { + p.Tag.Options[key] = value + } +} + +func (p *tagParser) parseKey() { + p.key = "" + + var b []byte + for p.Valid() { + c := p.Read() + switch c { + case ',': + p.Skip(' ') + p.setTagOption("", string(b)) + p.parseKey() + return + case ':': + p.key = string(b) + p.parseValue() + return + case '\'': + p.parseQuotedValue() + return + default: + b = append(b, c) + } + } + + if len(b) > 0 { + p.setTagOption("", string(b)) + } +} + +func (p *tagParser) parseValue() { + const quote = '\'' + + c := p.Peek() + if c == quote { + p.Skip(quote) + p.parseQuotedValue() + return + } + + var b []byte + for p.Valid() { + c = p.Read() + switch c { + case '\\': + b = append(b, p.Read()) + case '(': + b = append(b, c) + b = p.readBrackets(b) + case ',': + p.Skip(' ') + p.setTagOption(p.key, string(b)) + p.parseKey() + return + default: + b = append(b, c) + } + } + p.setTagOption(p.key, string(b)) +} + +func (p *tagParser) readBrackets(b []byte) []byte { + var lvl int +loop: + for p.Valid() { + c := p.Read() + switch c { + case '\\': + b = append(b, p.Read()) + case '(': + b = append(b, c) + lvl++ + case ')': + b = append(b, c) + lvl-- + if lvl < 0 { + break loop + } + default: + b = append(b, c) + } + } + return b +} + +func (p *tagParser) parseQuotedValue() { + const quote = '\'' + + var b []byte + b = append(b, quote) + + for p.Valid() { + bb, ok := p.ReadSep(quote) + if !ok { + b = append(b, bb...) + break + } + + if len(bb) > 0 && bb[len(bb)-1] == '\\' { + b = append(b, bb[:len(bb)-1]...) + b = append(b, quote) + continue + } + + b = append(b, bb...) + b = append(b, quote) + break + } + + p.setTagOption(p.key, string(b)) + if p.Skip(',') { + p.Skip(' ') + } + p.parseKey() +} + +func Unquote(s string) (string, bool) { + const quote = '\'' + + if len(s) < 2 { + return s, false + } + if s[0] == quote && s[len(s)-1] == quote { + return s[1 : len(s)-1], true + } + return s, false +} diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go index 2c861b5cd..96195bcc9 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go @@ -43,7 +43,7 @@ type Unmarshaler interface { } // ValueUnmarshaler is an interface implemented by types that can unmarshal a -// BSON value representaiton of themselves. The BSON bytes and type can be +// BSON value representation of themselves. The BSON bytes and type can be // assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it // wishes to retain the data after returning. type ValueUnmarshaler interface { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go index 32fd14278..20f4797dd 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go @@ -53,7 +53,7 @@ type DefaultValueDecoders struct{} // RegisterDefaultDecoders will register the decoder methods attached to DefaultValueDecoders with // the provided RegistryBuilder. // -// There is no support for decoding map[string]interface{} becuase there is no decoder for +// There is no support for decoding map[string]interface{} because there is no decoder for // interface{}, so users must either register this decoder themselves or use the // EmptyInterfaceDecoder available in the bson package. func (dvd DefaultValueDecoders) RegisterDefaultDecoders(rb *RegistryBuilder) { @@ -1504,6 +1504,18 @@ func (dvd DefaultValueDecoders) UnmarshalerDecodeValue(dc DecodeContext, vr bson return err } + // If the target Go value is a pointer and the BSON field value is empty, set the value to the + // zero value of the pointer (nil) and don't call UnmarshalBSON. UnmarshalBSON has no way to + // change the pointer value from within the function (only the value at the pointer address), + // so it can't set the pointer to "nil" itself. Since the most common Go value for an empty BSON + // field value is "nil", we set "nil" here and don't call UnmarshalBSON. This behavior matches + // the behavior of the Go "encoding/json" unmarshaler when the target Go value is a pointer and + // the JSON field value is "null". + if val.Kind() == reflect.Ptr && len(src) == 0 { + val.Set(reflect.Zero(val.Type())) + return nil + } + fn := val.Convert(tUnmarshaler).MethodByName("UnmarshalBSON") errVal := fn.Call([]reflect.Value{reflect.ValueOf(src)})[0] if !errVal.IsNil() { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go index 02b9341ff..f6f3800d4 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go @@ -298,7 +298,7 @@ func (rb *RegistryBuilder) Build() *Registry { return registry } -// LookupEncoder inspects the registry for an encoder for the given type. The lookup precendence works as follows: +// LookupEncoder inspects the registry for an encoder for the given type. The lookup precedence works as follows: // // 1. An encoder registered for the exact type. If the given type represents an interface, an encoder registered using // RegisterTypeEncoder for the interface will be selected. @@ -376,7 +376,7 @@ func (r *Registry) lookupInterfaceEncoder(t reflect.Type, allowAddr bool) (Value return nil, false } -// LookupDecoder inspects the registry for an decoder for the given type. The lookup precendence works as follows: +// LookupDecoder inspects the registry for an decoder for the given type. The lookup precedence works as follows: // // 1. A decoder registered for the exact type. If the given type represents an interface, a decoder registered using // RegisterTypeDecoder for the interface will be selected. diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go index 8a690e37c..54c76bf74 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go @@ -423,7 +423,7 @@ func (ejp *extJSONParser) readValue(t bsontype.Type) (*extJSONValue, error) { if ejp.canonical { return nil, invalidJSONErrorForType("object", t) } - return nil, invalidJSONErrorForType("ISO-8601 Internet Date/Time Format as decribed in RFC-3339", t) + return nil, invalidJSONErrorForType("ISO-8601 Internet Date/Time Format as described in RFC-3339", t) } ejp.advanceState() diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go index 5e147373b..458588b6b 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go @@ -384,9 +384,13 @@ func (vr *valueReader) ReadBinary() (b []byte, btype byte, err error) { if err != nil { return nil, 0, err } + // Make a copy of the returned byte slice because it's just a subslice from the valueReader's + // buffer and is not safe to return in the unmarshaled value. + cp := make([]byte, len(b)) + copy(cp, b) vr.pop() - return b, btype, nil + return cp, btype, nil } func (vr *valueReader) ReadBoolean() (bool, error) { @@ -737,6 +741,9 @@ func (vr *valueReader) ReadValue() (ValueReader, error) { return vr, nil } +// readBytes reads length bytes from the valueReader starting at the current offset. Note that the +// returned byte slice is a subslice from the valueReader buffer and must be converted or copied +// before returning in an unmarshaled value. func (vr *valueReader) readBytes(length int32) ([]byte, error) { if length < 0 { return nil, fmt.Errorf("invalid length: %d", length) @@ -748,6 +755,7 @@ func (vr *valueReader) readBytes(length int32) ([]byte, error) { start := vr.offset vr.offset += int64(length) + return vr.d[start : start+int64(length)], nil } diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go index a39c4ea4c..f95a08afd 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go @@ -529,7 +529,7 @@ func (vw *valueWriter) WriteDocumentEnd() error { vw.pop() if vw.stack[vw.frame].mode == mCodeWithScope { - // We ignore the error here because of the gaurantee of writeLength. + // We ignore the error here because of the guarantee of writeLength. // See the docs for writeLength for more info. _ = vw.writeLength() vw.pop() diff --git a/vendor/go.mongodb.org/mongo-driver/bson/doc.go b/vendor/go.mongodb.org/mongo-driver/bson/doc.go index 094be934f..5e3825a23 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/doc.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/doc.go @@ -118,7 +118,7 @@ // types, this tag is ignored. // // 3. truncate: If the truncate struct tag is specified on a field with a non-float numeric type, BSON doubles unmarshalled -// into that field will be trucated at the decimal point. For example, if 3.14 is unmarshalled into a field of type int, +// into that field will be truncated at the decimal point. For example, if 3.14 is unmarshalled into a field of type int, // it will be unmarshalled as 3. If this tag is not specified, the decoder will throw an error if the value cannot be // decoded without losing precision. For float64 or non-numeric types, this tag is ignored. // diff --git a/vendor/go.mongodb.org/mongo-driver/bson/marshal.go b/vendor/go.mongodb.org/mongo-driver/bson/marshal.go index 79f038581..db8d8ee92 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/marshal.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/marshal.go @@ -225,10 +225,13 @@ func MarshalExtJSONAppendWithContext(ec bsoncodec.EncodeContext, dst []byte, val return *sw, nil } +// IndentExtJSON will prefix and indent the provided extended JSON src and append it to dst. func IndentExtJSON(dst *bytes.Buffer, src []byte, prefix, indent string) error { return json.Indent(dst, src, prefix, indent) } +// MarshalExtJSONIndent returns the extended JSON encoding of val with each line with prefixed +// and indented. func MarshalExtJSONIndent(val interface{}, canonical, escapeHTML bool, prefix, indent string) ([]byte, error) { marshaled, err := MarshalExtJSON(val, canonical, escapeHTML) if err != nil { diff --git a/vendor/go.mongodb.org/mongo-driver/bson/registry.go b/vendor/go.mongodb.org/mongo-driver/bson/registry.go index 09062d208..16d7573e7 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/registry.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/registry.go @@ -13,7 +13,7 @@ import "go.mongodb.org/mongo-driver/bson/bsoncodec" var DefaultRegistry = NewRegistryBuilder().Build() // NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and -// deocders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the +// decoders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the // PrimitiveCodecs type in this package. func NewRegistryBuilder() *bsoncodec.RegistryBuilder { rb := bsoncodec.NewRegistryBuilder() diff --git a/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go b/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go index 6f9ca04d3..f936ba183 100644 --- a/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go +++ b/vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go @@ -23,7 +23,7 @@ type Unmarshaler interface { } // ValueUnmarshaler is an interface implemented by types that can unmarshal a -// BSON value representaiton of themselves. The BSON bytes and type can be +// BSON value representation of themselves. The BSON bytes and type can be // assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it // wishes to retain the data after returning. type ValueUnmarshaler interface { diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go index b0d45212d..52162f8aa 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go @@ -45,7 +45,7 @@ func (db *DocumentBuilder) AppendInt32(key string, i32 int32) *DocumentBuilder { return db } -// AppendDocument will append a bson embeded document element using key +// AppendDocument will append a bson embedded document element using key // and doc to DocumentBuilder.doc func (db *DocumentBuilder) AppendDocument(key string, doc []byte) *DocumentBuilder { db.doc = AppendDocumentElement(db.doc, key, doc) diff --git a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go index b8db838a5..5b0c3a042 100644 --- a/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go +++ b/vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go @@ -15,7 +15,7 @@ // enough bytes. This library attempts to do no validation, it will only return // false if there are not enough bytes for an item to be read. For example, the // ReadDocument function checks the length, if that length is larger than the -// number of bytes availble, it will return false, if there are enough bytes, it +// number of bytes available, it will return false, if there are enough bytes, it // will return those bytes and true. It is the consumers responsibility to // validate those bytes. // @@ -69,7 +69,7 @@ func AppendHeader(dst []byte, t bsontype.Type, key string) []byte { // was read. // ReadType will return the first byte of the provided []byte as a type. If -// there is no availble byte, false is returned. +// there is no available byte, false is returned. func ReadType(src []byte) (bsontype.Type, []byte, bool) { if len(src) < 1 { return 0, src, false @@ -231,7 +231,7 @@ func AppendDocumentEnd(dst []byte, index int32) ([]byte, error) { // AppendDocument will append doc to dst and return the extended buffer. func AppendDocument(dst []byte, doc []byte) []byte { return append(dst, doc...) } -// AppendDocumentElement will append a BSON embeded document element using key +// AppendDocumentElement will append a BSON embedded document element using key // and doc to dst and return the extended buffer. func AppendDocumentElement(dst []byte, key string, doc []byte) []byte { return AppendDocument(AppendHeader(dst, bsontype.EmbeddedDocument, key), doc) diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go index a3c021d3f..cf66309c4 100644 --- a/vendor/golang.org/x/net/context/context.go +++ b/vendor/golang.org/x/net/context/context.go @@ -21,9 +21,9 @@ // explicitly to each function that needs it. The Context should be the first // parameter, typically named ctx: // -// func DoSomething(ctx context.Context, arg Arg) error { -// // ... use ctx ... -// } +// func DoSomething(ctx context.Context, arg Arg) error { +// // ... use ctx ... +// } // // Do not pass a nil Context, even if a function permits it. Pass context.TODO // if you are unsure about which Context to use. diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go index 344bd1433..0a54bdbcc 100644 --- a/vendor/golang.org/x/net/context/go17.go +++ b/vendor/golang.org/x/net/context/go17.go @@ -54,11 +54,11 @@ func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete: // -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { return WithDeadline(parent, time.Now().Add(timeout)) } diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go index 5270db5db..7b6b68511 100644 --- a/vendor/golang.org/x/net/context/pre_go17.go +++ b/vendor/golang.org/x/net/context/pre_go17.go @@ -264,11 +264,11 @@ func (c *timerCtx) cancel(removeFromParent bool, err error) { // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete: // -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { return WithDeadline(parent, time.Now().Add(timeout)) } diff --git a/vendor/golang.org/x/net/http/httpguts/httplex.go b/vendor/golang.org/x/net/http/httpguts/httplex.go index c79aa73f2..6e071e852 100644 --- a/vendor/golang.org/x/net/http/httpguts/httplex.go +++ b/vendor/golang.org/x/net/http/httpguts/httplex.go @@ -173,13 +173,15 @@ func tokenEqual(t1, t2 string) bool { // isLWS reports whether b is linear white space, according // to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 -// LWS = [CRLF] 1*( SP | HT ) +// +// LWS = [CRLF] 1*( SP | HT ) func isLWS(b byte) bool { return b == ' ' || b == '\t' } // isCTL reports whether b is a control byte, according // to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 -// CTL = +// +// CTL = func isCTL(b byte) bool { const del = 0x7f // a CTL return b < ' ' || b == del @@ -189,12 +191,13 @@ func isCTL(b byte) bool { // HTTP/2 imposes the additional restriction that uppercase ASCII // letters are not allowed. // -// RFC 7230 says: -// header-field = field-name ":" OWS field-value OWS -// field-name = token -// token = 1*tchar -// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / -// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA +// RFC 7230 says: +// +// header-field = field-name ":" OWS field-value OWS +// field-name = token +// token = 1*tchar +// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / +// "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA func ValidHeaderFieldName(v string) bool { if len(v) == 0 { return false @@ -267,27 +270,28 @@ var validHostByte = [256]bool{ // ValidHeaderFieldValue reports whether v is a valid "field-value" according to // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 : // -// message-header = field-name ":" [ field-value ] -// field-value = *( field-content | LWS ) -// field-content = +// message-header = field-name ":" [ field-value ] +// field-value = *( field-content | LWS ) +// field-content = // // http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 : // -// TEXT = -// LWS = [CRLF] 1*( SP | HT ) -// CTL = +// TEXT = +// LWS = [CRLF] 1*( SP | HT ) +// CTL = // // RFC 7230 says: -// field-value = *( field-content / obs-fold ) -// obj-fold = N/A to http2, and deprecated -// field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] -// field-vchar = VCHAR / obs-text -// obs-text = %x80-FF -// VCHAR = "any visible [USASCII] character" +// +// field-value = *( field-content / obs-fold ) +// obj-fold = N/A to http2, and deprecated +// field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] +// field-vchar = VCHAR / obs-text +// obs-text = %x80-FF +// VCHAR = "any visible [USASCII] character" // // http2 further says: "Similarly, HTTP/2 allows header field values // that are not valid. While most of the values that can be encoded diff --git a/vendor/golang.org/x/net/http2/errors.go b/vendor/golang.org/x/net/http2/errors.go index 2663e5d28..f2067dabc 100644 --- a/vendor/golang.org/x/net/http2/errors.go +++ b/vendor/golang.org/x/net/http2/errors.go @@ -136,7 +136,7 @@ func (e headerFieldNameError) Error() string { type headerFieldValueError string func (e headerFieldValueError) Error() string { - return fmt.Sprintf("invalid header field value %q", string(e)) + return fmt.Sprintf("invalid header field value for %q", string(e)) } var ( diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go index 96a747905..0178647ee 100644 --- a/vendor/golang.org/x/net/http2/frame.go +++ b/vendor/golang.org/x/net/http2/frame.go @@ -1532,7 +1532,8 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { fr.debugReadLoggerf("http2: decoded hpack field %+v", hf) } if !httpguts.ValidHeaderFieldValue(hf.Value) { - invalid = headerFieldValueError(hf.Value) + // Don't include the value in the error, because it may be sensitive. + invalid = headerFieldValueError(hf.Name) } isPseudo := strings.HasPrefix(hf.Name, ":") if isPseudo { diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index 5571ccfd2..479ba4b2b 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -13,7 +13,6 @@ // See https://http2.github.io/ for more information on HTTP/2. // // See https://http2.golang.org/ for a test server running this code. -// package http2 // import "golang.org/x/net/http2" import ( @@ -176,10 +175,11 @@ func (s SettingID) String() string { // name (key). See httpguts.ValidHeaderName for the base rules. // // Further, http2 says: -// "Just as in HTTP/1.x, header field names are strings of ASCII -// characters that are compared in a case-insensitive -// fashion. However, header field names MUST be converted to -// lowercase prior to their encoding in HTTP/2. " +// +// "Just as in HTTP/1.x, header field names are strings of ASCII +// characters that are compared in a case-insensitive +// fashion. However, header field names MUST be converted to +// lowercase prior to their encoding in HTTP/2. " func validWireHeaderFieldName(v string) bool { if len(v) == 0 { return false @@ -365,8 +365,8 @@ func (s *sorter) SortStrings(ss []string) { // validPseudoPath reports whether v is a valid :path pseudo-header // value. It must be either: // -// *) a non-empty string starting with '/' -// *) the string '*', for OPTIONS requests. +// - a non-empty string starting with '/' +// - the string '*', for OPTIONS requests. // // For now this is only used a quick check for deciding when to clean // up Opaque URLs before sending requests from the Transport. diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index e644d9b2f..5e2583c98 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -400,7 +400,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { if s.NewWriteScheduler != nil { sc.writeSched = s.NewWriteScheduler() } else { - sc.writeSched = NewRandomWriteScheduler() + sc.writeSched = NewPriorityWriteScheduler(nil) } // These start at the RFC-specified defaults. If there is a higher @@ -2316,17 +2316,18 @@ type requestBody struct { _ incomparable stream *stream conn *serverConn - closed bool // for use by Close only - sawEOF bool // for use by Read only - pipe *pipe // non-nil if we have a HTTP entity message body - needsContinue bool // need to send a 100-continue + closeOnce sync.Once // for use by Close only + sawEOF bool // for use by Read only + pipe *pipe // non-nil if we have a HTTP entity message body + needsContinue bool // need to send a 100-continue } func (b *requestBody) Close() error { - if b.pipe != nil && !b.closed { - b.pipe.BreakWithError(errClosedBody) - } - b.closed = true + b.closeOnce.Do(func() { + if b.pipe != nil { + b.pipe.BreakWithError(errClosedBody) + } + }) return nil } @@ -2546,8 +2547,9 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { // prior to the headers being written. If the set of trailers is fixed // or known before the header is written, the normal Go trailers mechanism // is preferred: -// https://golang.org/pkg/net/http/#ResponseWriter -// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers +// +// https://golang.org/pkg/net/http/#ResponseWriter +// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers const TrailerPrefix = "Trailer:" // promoteUndeclaredTrailers permits http.Handlers to set trailers @@ -2643,8 +2645,7 @@ func checkWriteHeaderCode(code int) { // Issue 22880: require valid WriteHeader status codes. // For now we only enforce that it's three digits. // In the future we might block things over 599 (600 and above aren't defined - // at http://httpwg.org/specs/rfc7231.html#status.codes) - // and we might block under 200 (once we have more mature 1xx support). + // at http://httpwg.org/specs/rfc7231.html#status.codes). // But for now any three digits. // // We used to send "HTTP/1.1 000 0" on the wire in responses but there's @@ -2665,13 +2666,33 @@ func (w *responseWriter) WriteHeader(code int) { } func (rws *responseWriterState) writeHeader(code int) { - if !rws.wroteHeader { - checkWriteHeaderCode(code) - rws.wroteHeader = true - rws.status = code - if len(rws.handlerHeader) > 0 { - rws.snapHeader = cloneHeader(rws.handlerHeader) + if rws.wroteHeader { + return + } + + checkWriteHeaderCode(code) + + // Handle informational headers + if code >= 100 && code <= 199 { + // Per RFC 8297 we must not clear the current header map + h := rws.handlerHeader + + if rws.conn.writeHeaders(rws.stream, &writeResHeaders{ + streamID: rws.stream.id, + httpResCode: code, + h: h, + endStream: rws.handlerDone && !rws.hasTrailers(), + }) != nil { + rws.dirty = true } + + return + } + + rws.wroteHeader = true + rws.status = code + if len(rws.handlerHeader) > 0 { + rws.snapHeader = cloneHeader(rws.handlerHeader) } } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 4f0989763..4ded4dfd5 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -16,7 +16,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "math" mathrand "math/rand" @@ -501,12 +500,14 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res if req, err = shouldRetryRequest(req, err); err == nil { // After the first retry, do exponential backoff with 10% jitter. if retry == 0 { + t.vlogf("RoundTrip retrying after failure: %v", err) continue } backoff := float64(uint(1) << (uint(retry) - 1)) backoff += backoff * (0.1 * mathrand.Float64()) select { case <-time.After(time.Second * time.Duration(backoff)): + t.vlogf("RoundTrip retrying after failure: %v", err) continue case <-req.Context().Done(): err = req.Context().Err() @@ -732,10 +733,13 @@ func (cc *ClientConn) healthCheck() { // trigger the healthCheck again if there is no frame received. ctx, cancel := context.WithTimeout(context.Background(), pingTimeout) defer cancel() + cc.vlogf("http2: Transport sending health check") err := cc.Ping(ctx) if err != nil { + cc.vlogf("http2: Transport health check failure: %v", err) cc.closeForLostPing() - return + } else { + cc.vlogf("http2: Transport health check success") } } @@ -1765,7 +1769,8 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail } for _, v := range vv { if !httpguts.ValidHeaderFieldValue(v) { - return nil, fmt.Errorf("invalid HTTP header value %q for header %q", v, k) + // Don't include the value in the error, because it may be sensitive. + return nil, fmt.Errorf("invalid HTTP header value for header %q", k) } } } @@ -2898,7 +2903,12 @@ func (t *Transport) logf(format string, args ...interface{}) { log.Printf(format, args...) } -var noBody io.ReadCloser = ioutil.NopCloser(bytes.NewReader(nil)) +var noBody io.ReadCloser = noBodyReader{} + +type noBodyReader struct{} + +func (noBodyReader) Close() error { return nil } +func (noBodyReader) Read([]byte) (int, error) { return 0, io.EOF } type missingBody struct{} diff --git a/vendor/golang.org/x/net/idna/trieval.go b/vendor/golang.org/x/net/idna/trieval.go index 7a8cf889b..9c070a44b 100644 --- a/vendor/golang.org/x/net/idna/trieval.go +++ b/vendor/golang.org/x/net/idna/trieval.go @@ -17,23 +17,23 @@ package idna // // The per-rune values have the following format: // -// if mapped { -// if inlinedXOR { -// 15..13 inline XOR marker -// 12..11 unused -// 10..3 inline XOR mask -// } else { -// 15..3 index into xor or mapping table -// } -// } else { -// 15..14 unused -// 13 mayNeedNorm -// 12..11 attributes -// 10..8 joining type -// 7..3 category type -// } -// 2 use xor pattern -// 1..0 mapped category +// if mapped { +// if inlinedXOR { +// 15..13 inline XOR marker +// 12..11 unused +// 10..3 inline XOR mask +// } else { +// 15..3 index into xor or mapping table +// } +// } else { +// 15..14 unused +// 13 mayNeedNorm +// 12..11 attributes +// 10..8 joining type +// 7..3 category type +// } +// 2 use xor pattern +// 1..0 mapped category // // See the definitions below for a more detailed description of the various // bits. diff --git a/vendor/golang.org/x/sys/unix/asm_linux_loong64.s b/vendor/golang.org/x/sys/unix/asm_linux_loong64.s new file mode 100644 index 000000000..6abd48eef --- /dev/null +++ b/vendor/golang.org/x/sys/unix/asm_linux_loong64.s @@ -0,0 +1,54 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build linux && loong64 && gc +// +build linux +// +build loong64 +// +build gc + +#include "textflag.h" + + +// Just jump to package syscall's implementation for all these functions. +// The runtime may know about them. + +TEXT ·Syscall(SB),NOSPLIT,$0-56 + JMP syscall·Syscall(SB) + +TEXT ·Syscall6(SB),NOSPLIT,$0-80 + JMP syscall·Syscall6(SB) + +TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 + JAL runtime·entersyscall(SB) + MOVV a1+8(FP), R4 + MOVV a2+16(FP), R5 + MOVV a3+24(FP), R6 + MOVV R0, R7 + MOVV R0, R8 + MOVV R0, R9 + MOVV trap+0(FP), R11 // syscall entry + SYSCALL + MOVV R4, r1+32(FP) + MOVV R5, r2+40(FP) + JAL runtime·exitsyscall(SB) + RET + +TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + JMP syscall·RawSyscall(SB) + +TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + JMP syscall·RawSyscall6(SB) + +TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 + MOVV a1+8(FP), R4 + MOVV a2+16(FP), R5 + MOVV a3+24(FP), R6 + MOVV R0, R7 + MOVV R0, R8 + MOVV R0, R9 + MOVV trap+0(FP), R11 // syscall entry + SYSCALL + MOVV R4, r1+32(FP) + MOVV R5, r2+40(FP) + RET diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/vendor/golang.org/x/sys/unix/endian_little.go index 4362f47e2..b0f2bc4ae 100644 --- a/vendor/golang.org/x/sys/unix/endian_little.go +++ b/vendor/golang.org/x/sys/unix/endian_little.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // -//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh -// +build 386 amd64 amd64p32 alpha arm arm64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh +//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh +// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh package unix diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index a03708748..d888fb770 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -215,6 +215,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -603,6 +604,7 @@ ccflags="$@" $2 ~ /^ITIMER_/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ || + $2 ~ /^P_/ || $2 ~/^PPPIOC/ || $2 ~ /^FAN_|FANOTIFY_/ || $2 == "HID_MAX_DESCRIPTOR_SIZE" || @@ -612,6 +614,7 @@ ccflags="$@" $2 ~ /^OTP/ || $2 ~ /^MEM/ || $2 ~ /^WG/ || + $2 ~ /^FIB_RULE_/ || $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go index 4f55c8d99..ad22c33db 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -37,6 +37,7 @@ func Creat(path string, mode uint32) (fd int, err error) { } //sys utimes(path string, times *[2]Timeval) (err error) + func Utimes(path string, tv []Timeval) error { if len(tv) != 2 { return EINVAL @@ -45,6 +46,7 @@ func Utimes(path string, tv []Timeval) error { } //sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) + func UtimesNano(path string, ts []Timespec) error { if len(ts) != 2 { return EINVAL @@ -215,18 +217,12 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { return } -func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { +func recvmsgRaw(fd int, p, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { // Recvmsg not implemented on AIX - sa := new(SockaddrUnix) - return -1, -1, -1, sa, ENOSYS -} - -func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { - _, err = SendmsgN(fd, p, oob, to, flags) - return + return -1, -1, -1, ENOSYS } -func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { +func sendmsgN(fd int, p, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { // SendmsgN not implemented on AIX return -1, ENOSYS } @@ -306,11 +302,13 @@ func direntNamlen(buf []byte) (uint64, bool) { } //sys getdirent(fd int, buf []byte) (n int, err error) + func Getdents(fd int, buf []byte) (n int, err error) { return getdirent(fd, buf) } //sys wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) + func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { var status _C_int var r Pid_t @@ -378,6 +376,7 @@ func (w WaitStatus) TrapCause() int { return -1 } //sys fcntl(fd int, cmd int, arg int) (val int, err error) //sys fsyncRange(fd int, how int, start int64, length int64) (err error) = fsync_range + func Fsync(fd int) error { return fsyncRange(fd, O_SYNC, 0, 0) } @@ -458,8 +457,8 @@ func Fsync(fd int) error { //sys Listen(s int, n int) (err error) //sys lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = pread64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = pread64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) //sysnb Setregid(rgid int, egid int) (err error) @@ -542,6 +541,7 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { //sys Getsystemcfg(label int) (n uint64) //sys umount(target string) (err error) + func Unmount(target string, flags int) (err error) { if flags != 0 { // AIX doesn't have any flags for umount. diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index 0ce452326..9c87c5f07 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -325,10 +325,9 @@ func GetsockoptString(fd, level, opt int) (string, error) { //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) -func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { +func recvmsgRaw(fd int, p, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { var msg Msghdr - var rsa RawSockaddrAny - msg.Name = (*byte)(unsafe.Pointer(&rsa)) + msg.Name = (*byte)(unsafe.Pointer(rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var iov Iovec if len(p) > 0 { @@ -352,29 +351,12 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from } oobn = int(msg.Controllen) recvflags = int(msg.Flags) - // source address is only specified if the socket is unconnected - if rsa.Addr.Family != AF_UNSPEC { - from, err = anyToSockaddr(fd, &rsa) - } return } //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) -func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { - _, err = SendmsgN(fd, p, oob, to, flags) - return -} - -func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { - var ptr unsafe.Pointer - var salen _Socklen - if to != nil { - ptr, salen, err = to.sockaddr() - if err != nil { - return 0, err - } - } +func sendmsgN(fd int, p, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Namelen = uint32(salen) @@ -571,12 +553,7 @@ func UtimesNano(path string, ts []Timespec) error { if len(ts) != 2 { return EINVAL } - // Darwin setattrlist can set nanosecond timestamps - err := setattrlistTimes(path, ts, 0) - if err != ENOSYS { - return err - } - err = utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) + err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) if err != ENOSYS { return err } @@ -596,10 +573,6 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { if len(ts) != 2 { return EINVAL } - err := setattrlistTimes(path, ts, flags) - if err != ENOSYS { - return err - } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) } diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 0eaab9131..e5448cc93 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -141,16 +141,6 @@ func direntNamlen(buf []byte) (uint64, bool) { func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) } func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) } -type attrList struct { - bitmapCount uint16 - _ uint16 - CommonAttr uint32 - VolAttr uint32 - DirAttr uint32 - FileAttr uint32 - Forkattr uint32 -} - //sysnb pipe(p *[2]int32) (err error) func Pipe(p []int) (err error) { @@ -282,36 +272,7 @@ func Flistxattr(fd int, dest []byte) (sz int, err error) { return flistxattr(fd, xattrPointer(dest), len(dest), 0) } -func setattrlistTimes(path string, times []Timespec, flags int) error { - _p0, err := BytePtrFromString(path) - if err != nil { - return err - } - - var attrList attrList - attrList.bitmapCount = ATTR_BIT_MAP_COUNT - attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME - - // order is mtime, atime: the opposite of Chtimes - attributes := [2]Timespec{times[1], times[0]} - options := 0 - if flags&AT_SYMLINK_NOFOLLOW != 0 { - options |= FSOPT_NOFOLLOW - } - return setattrlist( - _p0, - unsafe.Pointer(&attrList), - unsafe.Pointer(&attributes), - unsafe.Sizeof(attributes), - options) -} - -//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) - -func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { - // Darwin doesn't support SYS_UTIMENSAT - return ENOSYS -} +//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) /* * Wrapped @@ -543,11 +504,12 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) { //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) +//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +//sys pread(fd int, p []byte, offset int64) (n int, err error) +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) @@ -611,7 +573,6 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) { // Nfssvc // Getfh // Quotactl -// Mount // Csops // Waitid // Add_profil diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index 2e37c3167..61c0d0de1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -125,12 +125,14 @@ func Pipe2(p []int, flags int) (err error) { } //sys extpread(fd int, p []byte, flags int, offset int64) (n int, err error) -func Pread(fd int, p []byte, offset int64) (n int, err error) { + +func pread(fd int, p []byte, offset int64) (n int, err error) { return extpread(fd, p, 0, offset) } //sys extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + +func pwrite(fd int, p []byte, offset int64) (n int, err error) { return extpwrite(fd, p, 0, offset) } @@ -169,11 +171,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { return } -func setattrlistTimes(path string, times []Timespec, flags int) error { - // used on Darwin for UtimesNano - return ENOSYS -} - //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go index 2f650ae66..6f6c510f4 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -194,11 +194,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { return } -func setattrlistTimes(path string, times []Timespec, flags int) error { - // used on Darwin for UtimesNano - return ENOSYS -} - //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL @@ -638,8 +633,8 @@ func PtraceSingleStep(pid int) (err error) { //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +//sys pread(fd int, p []byte, offset int64) (n int, err error) +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 5f28f8fde..c8d203212 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -366,6 +366,8 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, return } +//sys Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error) + func Mkfifo(path string, mode uint32) error { return Mknod(path, mode|S_IFIFO, 0) } @@ -510,24 +512,24 @@ func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) { // // Server example: // -// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) -// _ = unix.Bind(fd, &unix.SockaddrRFCOMM{ -// Channel: 1, -// Addr: [6]uint8{0, 0, 0, 0, 0, 0}, // BDADDR_ANY or 00:00:00:00:00:00 -// }) -// _ = Listen(fd, 1) -// nfd, sa, _ := Accept(fd) -// fmt.Printf("conn addr=%v fd=%d", sa.(*unix.SockaddrRFCOMM).Addr, nfd) -// Read(nfd, buf) +// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) +// _ = unix.Bind(fd, &unix.SockaddrRFCOMM{ +// Channel: 1, +// Addr: [6]uint8{0, 0, 0, 0, 0, 0}, // BDADDR_ANY or 00:00:00:00:00:00 +// }) +// _ = Listen(fd, 1) +// nfd, sa, _ := Accept(fd) +// fmt.Printf("conn addr=%v fd=%d", sa.(*unix.SockaddrRFCOMM).Addr, nfd) +// Read(nfd, buf) // // Client example: // -// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) -// _ = Connect(fd, &SockaddrRFCOMM{ -// Channel: 1, -// Addr: [6]byte{0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc}, // CC:BB:AA:33:22:11 -// }) -// Write(fd, []byte(`hello`)) +// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) +// _ = Connect(fd, &SockaddrRFCOMM{ +// Channel: 1, +// Addr: [6]byte{0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc}, // CC:BB:AA:33:22:11 +// }) +// Write(fd, []byte(`hello`)) type SockaddrRFCOMM struct { // Addr represents a bluetooth address, byte ordering is little-endian. Addr [6]uint8 @@ -554,12 +556,12 @@ func (sa *SockaddrRFCOMM) sockaddr() (unsafe.Pointer, _Socklen, error) { // The SockaddrCAN struct must be bound to the socket file descriptor // using Bind before the CAN socket can be used. // -// // Read one raw CAN frame -// fd, _ := Socket(AF_CAN, SOCK_RAW, CAN_RAW) -// addr := &SockaddrCAN{Ifindex: index} -// Bind(fd, addr) -// frame := make([]byte, 16) -// Read(fd, frame) +// // Read one raw CAN frame +// fd, _ := Socket(AF_CAN, SOCK_RAW, CAN_RAW) +// addr := &SockaddrCAN{Ifindex: index} +// Bind(fd, addr) +// frame := make([]byte, 16) +// Read(fd, frame) // // The full SocketCAN documentation can be found in the linux kernel // archives at: https://www.kernel.org/doc/Documentation/networking/can.txt @@ -630,13 +632,13 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) { // Here is an example of using an AF_ALG socket with SHA1 hashing. // The initial socket setup process is as follows: // -// // Open a socket to perform SHA1 hashing. -// fd, _ := unix.Socket(unix.AF_ALG, unix.SOCK_SEQPACKET, 0) -// addr := &unix.SockaddrALG{Type: "hash", Name: "sha1"} -// unix.Bind(fd, addr) -// // Note: unix.Accept does not work at this time; must invoke accept() -// // manually using unix.Syscall. -// hashfd, _, _ := unix.Syscall(unix.SYS_ACCEPT, uintptr(fd), 0, 0) +// // Open a socket to perform SHA1 hashing. +// fd, _ := unix.Socket(unix.AF_ALG, unix.SOCK_SEQPACKET, 0) +// addr := &unix.SockaddrALG{Type: "hash", Name: "sha1"} +// unix.Bind(fd, addr) +// // Note: unix.Accept does not work at this time; must invoke accept() +// // manually using unix.Syscall. +// hashfd, _, _ := unix.Syscall(unix.SYS_ACCEPT, uintptr(fd), 0, 0) // // Once a file descriptor has been returned from Accept, it may be used to // perform SHA1 hashing. The descriptor is not safe for concurrent use, but @@ -645,39 +647,39 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) { // When hashing a small byte slice or string, a single Write and Read may // be used: // -// // Assume hashfd is already configured using the setup process. -// hash := os.NewFile(hashfd, "sha1") -// // Hash an input string and read the results. Each Write discards -// // previous hash state. Read always reads the current state. -// b := make([]byte, 20) -// for i := 0; i < 2; i++ { -// io.WriteString(hash, "Hello, world.") -// hash.Read(b) -// fmt.Println(hex.EncodeToString(b)) -// } -// // Output: -// // 2ae01472317d1935a84797ec1983ae243fc6aa28 -// // 2ae01472317d1935a84797ec1983ae243fc6aa28 +// // Assume hashfd is already configured using the setup process. +// hash := os.NewFile(hashfd, "sha1") +// // Hash an input string and read the results. Each Write discards +// // previous hash state. Read always reads the current state. +// b := make([]byte, 20) +// for i := 0; i < 2; i++ { +// io.WriteString(hash, "Hello, world.") +// hash.Read(b) +// fmt.Println(hex.EncodeToString(b)) +// } +// // Output: +// // 2ae01472317d1935a84797ec1983ae243fc6aa28 +// // 2ae01472317d1935a84797ec1983ae243fc6aa28 // // For hashing larger byte slices, or byte streams such as those read from // a file or socket, use Sendto with MSG_MORE to instruct the kernel to update // the hash digest instead of creating a new one for a given chunk and finalizing it. // -// // Assume hashfd and addr are already configured using the setup process. -// hash := os.NewFile(hashfd, "sha1") -// // Hash the contents of a file. -// f, _ := os.Open("/tmp/linux-4.10-rc7.tar.xz") -// b := make([]byte, 4096) -// for { -// n, err := f.Read(b) -// if err == io.EOF { -// break -// } -// unix.Sendto(hashfd, b[:n], unix.MSG_MORE, addr) -// } -// hash.Read(b) -// fmt.Println(hex.EncodeToString(b)) -// // Output: 85cdcad0c06eef66f805ecce353bec9accbeecc5 +// // Assume hashfd and addr are already configured using the setup process. +// hash := os.NewFile(hashfd, "sha1") +// // Hash the contents of a file. +// f, _ := os.Open("/tmp/linux-4.10-rc7.tar.xz") +// b := make([]byte, 4096) +// for { +// n, err := f.Read(b) +// if err == io.EOF { +// break +// } +// unix.Sendto(hashfd, b[:n], unix.MSG_MORE, addr) +// } +// hash.Read(b) +// fmt.Println(hex.EncodeToString(b)) +// // Output: 85cdcad0c06eef66f805ecce353bec9accbeecc5 // // For more information, see: http://www.chronox.de/crypto-API/crypto/userspace-if.html. type SockaddrALG struct { @@ -1497,10 +1499,9 @@ func KeyctlRestrictKeyring(ringid int, keyType string, restriction string) error //sys keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) = SYS_KEYCTL //sys keyctlRestrictKeyring(cmd int, arg2 int) (err error) = SYS_KEYCTL -func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { +func recvmsgRaw(fd int, p, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { var msg Msghdr - var rsa RawSockaddrAny - msg.Name = (*byte)(unsafe.Pointer(&rsa)) + msg.Name = (*byte)(unsafe.Pointer(rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var iov Iovec if len(p) > 0 { @@ -1531,28 +1532,10 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from } oobn = int(msg.Controllen) recvflags = int(msg.Flags) - // source address is only specified if the socket is unconnected - if rsa.Addr.Family != AF_UNSPEC { - from, err = anyToSockaddr(fd, &rsa) - } - return -} - -func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { - _, err = SendmsgN(fd, p, oob, to, flags) return } -func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { - var ptr unsafe.Pointer - var salen _Socklen - if to != nil { - var err error - ptr, salen, err = to.sockaddr() - if err != nil { - return 0, err - } - } +func sendmsgN(fd int, p, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { var msg Msghdr msg.Name = (*byte)(ptr) msg.Namelen = uint32(salen) @@ -1846,6 +1829,9 @@ func Dup2(oldfd, newfd int) error { //sys Fremovexattr(fd int, attr string) (err error) //sys Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) //sys Fsync(fd int) (err error) +//sys Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error) +//sys Fsopen(fsName string, flags int) (fd int, err error) +//sys Fspick(dirfd int, pathName string, flags int) (fd int, err error) //sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64 //sysnb Getpgid(pid int) (pgid int, err error) @@ -1876,7 +1862,9 @@ func Getpgrp() (pid int) { //sys MemfdCreate(name string, flags int) (fd int, err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) +//sys MoveMount(fromDirfd int, fromPathName string, toDirfd int, toPathName string, flags int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) +//sys OpenTree(dfd int, fileName string, flags uint) (r int, err error) //sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) //sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT //sysnb Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64 @@ -2201,7 +2189,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { gid = Getgid() } - if uint32(gid) == st.Gid || isGroupMember(gid) { + if uint32(gid) == st.Gid || isGroupMember(int(st.Gid)) { fmode = (st.Mode >> 3) & 7 } else { fmode = st.Mode & 7 @@ -2316,6 +2304,7 @@ type RemoteIovec struct { //sys PidfdOpen(pid int, flags int) (fd int, err error) = SYS_PIDFD_OPEN //sys PidfdGetfd(pidfd int, targetfd int, flags int) (fd int, err error) = SYS_PIDFD_GETFD +//sys PidfdSendSignal(pidfd int, sig Signal, info *Siginfo, flags int) (err error) = SYS_PIDFD_SEND_SIGNAL //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) //sys shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error) @@ -2464,5 +2453,4 @@ func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) { // Vfork // Vhangup // Vserver -// Waitid // _Sysctl diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go index d44b8ad53..518e476e6 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -35,8 +35,8 @@ func setTimeval(sec, usec int64) Timeval { //sys Iopl(level int) (err error) //sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32 //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 //sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go index bd21d93bf..f5e9d6bef 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -28,9 +28,10 @@ func Lstat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) } +//sys MemfdSecret(flags int) (fd int, err error) //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index 343c91f6b..c1a7778f1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -96,8 +96,8 @@ func Utime(path string, buf *Utimbuf) error { //sys utimes(path string, times *[2]Timeval) (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 8c5628684..d83e2c657 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -22,8 +22,9 @@ import "unsafe" //sysnb getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Listen(s int, n int) (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys MemfdSecret(flags int) (fd int, err error) +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go new file mode 100644 index 000000000..28ba7b8cb --- /dev/null +++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go @@ -0,0 +1,191 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build loong64 && linux +// +build loong64,linux + +package unix + +import "unsafe" + +//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT +//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 +//sys Fchown(fd int, uid int, gid int) (err error) +//sys Fstat(fd int, stat *Stat_t) (err error) +//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) +//sys Fstatfs(fd int, buf *Statfs_t) (err error) +//sys Ftruncate(fd int, length int64) (err error) +//sysnb Getegid() (egid int) +//sysnb Geteuid() (euid int) +//sysnb Getgid() (gid int) +//sysnb Getuid() (uid int) +//sys Listen(s int, n int) (err error) +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK + +func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { + var ts *Timespec + if timeout != nil { + ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} + } + return Pselect(nfd, r, w, e, ts, nil) +} + +//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) +//sys setfsgid(gid int) (prev int, err error) +//sys setfsuid(uid int) (prev int, err error) +//sysnb Setregid(rgid int, egid int) (err error) +//sysnb Setresgid(rgid int, egid int, sgid int) (err error) +//sysnb Setresuid(ruid int, euid int, suid int) (err error) +//sysnb Setreuid(ruid int, euid int) (err error) +//sys Shutdown(fd int, how int) (err error) +//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) + +func Stat(path string, stat *Stat_t) (err error) { + return Fstatat(AT_FDCWD, path, stat, 0) +} + +func Lchown(path string, uid int, gid int) (err error) { + return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) +} + +func Lstat(path string, stat *Stat_t) (err error) { + return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) +} + +//sys Statfs(path string, buf *Statfs_t) (err error) +//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) +//sys Truncate(path string, length int64) (err error) + +func Ustat(dev int, ubuf *Ustat_t) (err error) { + return ENOSYS +} + +//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) +//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) +//sysnb setgroups(n int, list *_Gid_t) (err error) +//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) +//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) +//sysnb socket(domain int, typ int, proto int) (fd int, err error) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) +//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) +//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) +//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) +//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) + +//sysnb Gettimeofday(tv *Timeval) (err error) + +func setTimespec(sec, nsec int64) Timespec { + return Timespec{Sec: sec, Nsec: nsec} +} + +func setTimeval(sec, usec int64) Timeval { + return Timeval{Sec: sec, Usec: usec} +} + +func Getrlimit(resource int, rlim *Rlimit) (err error) { + err = Prlimit(0, resource, nil, rlim) + return +} + +func Setrlimit(resource int, rlim *Rlimit) (err error) { + err = Prlimit(0, resource, rlim, nil) + return +} + +func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { + if tv == nil { + return utimensat(dirfd, path, nil, 0) + } + + ts := []Timespec{ + NsecToTimespec(TimevalToNsec(tv[0])), + NsecToTimespec(TimevalToNsec(tv[1])), + } + return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) +} + +func Time(t *Time_t) (Time_t, error) { + var tv Timeval + err := Gettimeofday(&tv) + if err != nil { + return 0, err + } + if t != nil { + *t = Time_t(tv.Sec) + } + return Time_t(tv.Sec), nil +} + +func Utime(path string, buf *Utimbuf) error { + tv := []Timeval{ + {Sec: buf.Actime}, + {Sec: buf.Modtime}, + } + return Utimes(path, tv) +} + +func utimes(path string, tv *[2]Timeval) (err error) { + if tv == nil { + return utimensat(AT_FDCWD, path, nil, 0) + } + + ts := []Timespec{ + NsecToTimespec(TimevalToNsec(tv[0])), + NsecToTimespec(TimevalToNsec(tv[1])), + } + return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) +} + +func (r *PtraceRegs) PC() uint64 { return r.Era } + +func (r *PtraceRegs) SetPC(era uint64) { r.Era = era } + +func (iov *Iovec) SetLen(length int) { + iov.Len = uint64(length) +} + +func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) +} + +func (msghdr *Msghdr) SetIovlen(length int) { + msghdr.Iovlen = uint64(length) +} + +func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) +} + +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + +func Pause() error { + _, err := ppoll(nil, 0, nil, nil) + return err +} + +func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + return Renameat2(olddirfd, oldpath, newdirfd, newpath, 0) +} + +//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) + +func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { + cmdlineLen := len(cmdline) + if cmdlineLen > 0 { + // Account for the additional NULL byte added by + // BytePtrFromString in kexecFileLoad. The kexec_file_load + // syscall expects a NULL-terminated string. + cmdlineLen++ + } + return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) +} diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go index f0b138002..98a2660b9 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -21,8 +21,8 @@ package unix //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index e6163c30f..b8a18c0ad 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -25,8 +25,8 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, //sysnb Getuid() (uid int) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go index 4740e80a8..4ed9e67c6 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go @@ -27,8 +27,8 @@ import ( //sys Listen(s int, n int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go index 78bc9166e..db63d384c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -26,8 +26,8 @@ package unix //sys Listen(s int, n int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index 3d6c4eb06..8ff7adba0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -22,8 +22,8 @@ import "unsafe" //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Listen(s int, n int) (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index 89ce84a41..6fcf277b0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -26,8 +26,8 @@ import ( //sys Lchown(path string, uid int, gid int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go index 35bdb098c..02a45d9cc 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -23,8 +23,8 @@ package unix //sys Listen(s int, n int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 696fed496..666f0a1b3 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -163,11 +163,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e return -1, ENOSYS } -func setattrlistTimes(path string, times []Timespec, flags int) error { - // used on Darwin for UtimesNano - return ENOSYS -} - //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL @@ -313,8 +308,8 @@ func Statvfs(path string, buf *Statvfs_t) (err error) { //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +//sys pread(fd int, p []byte, offset int64) (n int, err error) +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 11b1d419d..78daceb33 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -81,6 +81,7 @@ func Pipe(p []int) (err error) { } //sysnb pipe2(p *[2]_C_int, flags int) (err error) + func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL @@ -95,6 +96,7 @@ func Pipe2(p []int, flags int) error { } //sys Getdents(fd int, buf []byte) (n int, err error) + func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { n, err = Getdents(fd, buf) if err != nil || basep == nil { @@ -149,11 +151,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { return } -func setattrlistTimes(path string, times []Timespec, flags int) error { - // used on Darwin for UtimesNano - return ENOSYS -} - //sys ioctl(fd int, req uint, arg uintptr) (err error) //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL @@ -274,8 +271,8 @@ func Uname(uname *Utsname) error { //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +//sys pread(fd int, p []byte, offset int64) (n int, err error) +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index 5c813921e..5c2003cec 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -451,10 +451,9 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_recvmsg -func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { +func recvmsgRaw(fd int, p, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) { var msg Msghdr - var rsa RawSockaddrAny - msg.Name = (*byte)(unsafe.Pointer(&rsa)) + msg.Name = (*byte)(unsafe.Pointer(rsa)) msg.Namelen = uint32(SizeofSockaddrAny) var iov Iovec if len(p) > 0 { @@ -476,29 +475,12 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from return } oobn = int(msg.Accrightslen) - // source address is only specified if the socket is unconnected - if rsa.Addr.Family != AF_UNSPEC { - from, err = anyToSockaddr(fd, &rsa) - } - return -} - -func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { - _, err = SendmsgN(fd, p, oob, to, flags) return } //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_sendmsg -func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { - var ptr unsafe.Pointer - var salen _Socklen - if to != nil { - ptr, salen, err = to.sockaddr() - if err != nil { - return 0, err - } - } +func sendmsgN(fd int, p, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) { var msg Msghdr msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Namelen = uint32(salen) @@ -661,8 +643,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys Pause() (err error) -//sys Pread(fd int, p []byte, offset int64) (n int, err error) -//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) +//sys pread(fd int, p []byte, offset int64) (n int, err error) +//sys pwrite(fd int, p []byte, offset int64) (n int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) //sys Rename(from string, to string) (err error) @@ -755,8 +737,20 @@ type fileObjCookie struct { type EventPort struct { port int mu sync.Mutex - fds map[uintptr]interface{} + fds map[uintptr]*fileObjCookie paths map[string]*fileObjCookie + // The user cookie presents an interesting challenge from a memory management perspective. + // There are two paths by which we can discover that it is no longer in use: + // 1. The user calls port_dissociate before any events fire + // 2. An event fires and we return it to the user + // The tricky situation is if the event has fired in the kernel but + // the user hasn't requested/received it yet. + // If the user wants to port_dissociate before the event has been processed, + // we should handle things gracefully. To do so, we need to keep an extra + // reference to the cookie around until the event is processed + // thus the otherwise seemingly extraneous "cookies" map + // The key of this map is a pointer to the corresponding &fCookie.cookie + cookies map[*interface{}]*fileObjCookie } // PortEvent is an abstraction of the port_event C struct. @@ -780,9 +774,10 @@ func NewEventPort() (*EventPort, error) { return nil, err } e := &EventPort{ - port: port, - fds: make(map[uintptr]interface{}), - paths: make(map[string]*fileObjCookie), + port: port, + fds: make(map[uintptr]*fileObjCookie), + paths: make(map[string]*fileObjCookie), + cookies: make(map[*interface{}]*fileObjCookie), } return e, nil } @@ -797,9 +792,13 @@ func NewEventPort() (*EventPort, error) { func (e *EventPort) Close() error { e.mu.Lock() defer e.mu.Unlock() + err := Close(e.port) + if err != nil { + return err + } e.fds = nil e.paths = nil - return Close(e.port) + return nil } // PathIsWatched checks to see if path is associated with this EventPort. @@ -836,6 +835,7 @@ func (e *EventPort) AssociatePath(path string, stat os.FileInfo, events int, coo return err } e.paths[path] = fCookie + e.cookies[&fCookie.cookie] = fCookie return nil } @@ -848,11 +848,19 @@ func (e *EventPort) DissociatePath(path string) error { return fmt.Errorf("%v is not associated with this Event Port", path) } _, err := port_dissociate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(f.fobj))) - if err != nil { + // If the path is no longer associated with this event port (ENOENT) + // we should delete it from our map. We can still return ENOENT to the caller. + // But we need to save the cookie + if err != nil && err != ENOENT { return err } + if err == nil { + // dissociate was successful, safe to delete the cookie + fCookie := e.paths[path] + delete(e.cookies, &fCookie.cookie) + } delete(e.paths, path) - return nil + return err } // AssociateFd wraps calls to port_associate(3c) on file descriptors. @@ -862,12 +870,13 @@ func (e *EventPort) AssociateFd(fd uintptr, events int, cookie interface{}) erro if _, found := e.fds[fd]; found { return fmt.Errorf("%v is already associated with this Event Port", fd) } - pcookie := &cookie - _, err := port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(pcookie))) + fCookie := &fileObjCookie{nil, cookie} + _, err := port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(&fCookie.cookie))) if err != nil { return err } - e.fds[fd] = pcookie + e.fds[fd] = fCookie + e.cookies[&fCookie.cookie] = fCookie return nil } @@ -880,11 +889,16 @@ func (e *EventPort) DissociateFd(fd uintptr) error { return fmt.Errorf("%v is not associated with this Event Port", fd) } _, err := port_dissociate(e.port, PORT_SOURCE_FD, fd) - if err != nil { + if err != nil && err != ENOENT { return err } + if err == nil { + // dissociate was successful, safe to delete the cookie + fCookie := e.fds[fd] + delete(e.cookies, &fCookie.cookie) + } delete(e.fds, fd) - return nil + return err } func createFileObj(name string, stat os.FileInfo) (*fileObj, error) { @@ -912,24 +926,46 @@ func (e *EventPort) GetOne(t *Timespec) (*PortEvent, error) { return nil, err } p := new(PortEvent) - p.Events = pe.Events - p.Source = pe.Source e.mu.Lock() defer e.mu.Unlock() - switch pe.Source { + e.peIntToExt(pe, p) + return p, nil +} + +// peIntToExt converts a cgo portEvent struct into the friendlier PortEvent +// NOTE: Always call this function while holding the e.mu mutex +func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) { + peExt.Events = peInt.Events + peExt.Source = peInt.Source + cookie := (*interface{})(unsafe.Pointer(peInt.User)) + peExt.Cookie = *cookie + switch peInt.Source { case PORT_SOURCE_FD: - p.Fd = uintptr(pe.Object) - cookie := (*interface{})(unsafe.Pointer(pe.User)) - p.Cookie = *cookie - delete(e.fds, p.Fd) + delete(e.cookies, cookie) + peExt.Fd = uintptr(peInt.Object) + // Only remove the fds entry if it exists and this cookie matches + if fobj, ok := e.fds[peExt.Fd]; ok { + if &fobj.cookie == cookie { + delete(e.fds, peExt.Fd) + } + } case PORT_SOURCE_FILE: - p.fobj = (*fileObj)(unsafe.Pointer(uintptr(pe.Object))) - p.Path = BytePtrToString((*byte)(unsafe.Pointer(p.fobj.Name))) - cookie := (*interface{})(unsafe.Pointer(pe.User)) - p.Cookie = *cookie - delete(e.paths, p.Path) + if fCookie, ok := e.cookies[cookie]; ok && uintptr(unsafe.Pointer(fCookie.fobj)) == uintptr(peInt.Object) { + // Use our stashed reference rather than using unsafe on what we got back + // the unsafe version would be (*fileObj)(unsafe.Pointer(uintptr(peInt.Object))) + peExt.fobj = fCookie.fobj + } else { + panic("mismanaged memory") + } + delete(e.cookies, cookie) + peExt.Path = BytePtrToString((*byte)(unsafe.Pointer(peExt.fobj.Name))) + // Only remove the paths entry if it exists and this cookie matches + if fobj, ok := e.paths[peExt.Path]; ok { + if &fobj.cookie == cookie { + delete(e.paths, peExt.Path) + } + } } - return p, nil } // Pending wraps port_getn(3c) and returns how many events are pending. @@ -962,21 +998,7 @@ func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error) e.mu.Lock() defer e.mu.Unlock() for i := 0; i < int(got); i++ { - s[i].Events = ps[i].Events - s[i].Source = ps[i].Source - switch ps[i].Source { - case PORT_SOURCE_FD: - s[i].Fd = uintptr(ps[i].Object) - cookie := (*interface{})(unsafe.Pointer(ps[i].User)) - s[i].Cookie = *cookie - delete(e.fds, s[i].Fd) - case PORT_SOURCE_FILE: - s[i].fobj = (*fileObj)(unsafe.Pointer(uintptr(ps[i].Object))) - s[i].Path = BytePtrToString((*byte)(unsafe.Pointer(s[i].fobj.Name))) - cookie := (*interface{})(unsafe.Pointer(ps[i].User)) - s[i].Cookie = *cookie - delete(e.paths, s[i].Path) - } + e.peIntToExt(&ps[i], &s[i]) } return int(got), err } diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index cf296a243..70508afc1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -177,6 +177,30 @@ func Write(fd int, p []byte) (n int, err error) { return } +func Pread(fd int, p []byte, offset int64) (n int, err error) { + n, err = pread(fd, p, offset) + if raceenabled { + if n > 0 { + raceWriteRange(unsafe.Pointer(&p[0]), n) + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } + } + return +} + +func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = pwrite(fd, p, offset) + if raceenabled && n > 0 { + raceReadRange(unsafe.Pointer(&p[0]), n) + } + return +} + // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. var SocketDisableIPv6 bool @@ -313,6 +337,33 @@ func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) { return } +func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { + var rsa RawSockaddrAny + n, oobn, recvflags, err = recvmsgRaw(fd, p, oob, flags, &rsa) + // source address is only specified if the socket is unconnected + if rsa.Addr.Family != AF_UNSPEC { + from, err = anyToSockaddr(fd, &rsa) + } + return +} + +func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { + _, err = SendmsgN(fd, p, oob, to, flags) + return +} + +func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { + var ptr unsafe.Pointer + var salen _Socklen + if to != nil { + ptr, salen, err = to.sockaddr() + if err != nil { + return 0, err + } + } + return sendmsgN(fd, p, oob, ptr, salen, flags) +} + func Send(s int, buf []byte, flags int) (err error) { return sendto(s, buf, flags, nil, 0) } diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index bc7c9d075..c0a43f8ba 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -393,9 +393,11 @@ const ( CAP_SYS_TIME = 0x19 CAP_SYS_TTY_CONFIG = 0x1a CAP_WAKE_ALARM = 0x23 + CEPH_SUPER_MAGIC = 0xc36400 CFLUSH = 0xf CGROUP2_SUPER_MAGIC = 0x63677270 CGROUP_SUPER_MAGIC = 0x27e0eb + CIFS_SUPER_MAGIC = 0xff534d42 CLOCK_BOOTTIME = 0x7 CLOCK_BOOTTIME_ALARM = 0x9 CLOCK_DEFAULT = 0x0 @@ -784,6 +786,7 @@ const ( EV_SYN = 0x0 EV_VERSION = 0x10001 EXABYTE_ENABLE_NEST = 0xf0 + EXFAT_SUPER_MAGIC = 0x2011bab0 EXT2_SUPER_MAGIC = 0xef53 EXT3_SUPER_MAGIC = 0xef53 EXT4_SUPER_MAGIC = 0xef53 @@ -826,6 +829,8 @@ const ( FAN_EVENT_INFO_TYPE_DFID_NAME = 0x2 FAN_EVENT_INFO_TYPE_ERROR = 0x5 FAN_EVENT_INFO_TYPE_FID = 0x1 + FAN_EVENT_INFO_TYPE_NEW_DFID_NAME = 0xc + FAN_EVENT_INFO_TYPE_OLD_DFID_NAME = 0xa FAN_EVENT_INFO_TYPE_PIDFD = 0x4 FAN_EVENT_METADATA_LEN = 0x18 FAN_EVENT_ON_CHILD = 0x8000000 @@ -854,17 +859,27 @@ const ( FAN_OPEN_EXEC_PERM = 0x40000 FAN_OPEN_PERM = 0x10000 FAN_Q_OVERFLOW = 0x4000 + FAN_RENAME = 0x10000000 FAN_REPORT_DFID_NAME = 0xc00 + FAN_REPORT_DFID_NAME_TARGET = 0x1e00 FAN_REPORT_DIR_FID = 0x400 FAN_REPORT_FID = 0x200 FAN_REPORT_NAME = 0x800 FAN_REPORT_PIDFD = 0x80 + FAN_REPORT_TARGET_FID = 0x1000 FAN_REPORT_TID = 0x100 FAN_UNLIMITED_MARKS = 0x20 FAN_UNLIMITED_QUEUE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 + FIB_RULE_DEV_DETACHED = 0x8 + FIB_RULE_FIND_SADDR = 0x10000 + FIB_RULE_IIF_DETACHED = 0x8 + FIB_RULE_INVERT = 0x2 + FIB_RULE_OIF_DETACHED = 0x10 + FIB_RULE_PERMANENT = 0x1 + FIB_RULE_UNRESOLVED = 0x4 FIDEDUPERANGE = 0xc0189436 FSCRYPT_KEY_DESCRIPTOR_SIZE = 0x8 FSCRYPT_KEY_DESC_PREFIX = "fscrypt:" @@ -927,6 +942,7 @@ const ( FS_VERITY_METADATA_TYPE_DESCRIPTOR = 0x2 FS_VERITY_METADATA_TYPE_MERKLE_TREE = 0x1 FS_VERITY_METADATA_TYPE_SIGNATURE = 0x3 + FUSE_SUPER_MAGIC = 0x65735546 FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -1294,6 +1310,7 @@ const ( KEXEC_ARCH_ARM = 0x280000 KEXEC_ARCH_DEFAULT = 0x0 KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_LOONGARCH = 0x1020000 KEXEC_ARCH_MASK = 0xffff0000 KEXEC_ARCH_MIPS = 0x80000 KEXEC_ARCH_MIPS_LE = 0xa0000 @@ -1495,6 +1512,7 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_COMPRESSED_FILE = 0x4 MODULE_INIT_IGNORE_MODVERSIONS = 0x1 MODULE_INIT_IGNORE_VERMAGIC = 0x2 MOUNT_ATTR_IDMAP = 0x100000 @@ -1849,6 +1867,9 @@ const ( PERF_MEM_BLK_NA = 0x1 PERF_MEM_BLK_SHIFT = 0x28 PERF_MEM_HOPS_0 = 0x1 + PERF_MEM_HOPS_1 = 0x2 + PERF_MEM_HOPS_2 = 0x3 + PERF_MEM_HOPS_3 = 0x4 PERF_MEM_HOPS_SHIFT = 0x2b PERF_MEM_LOCK_LOCKED = 0x2 PERF_MEM_LOCK_NA = 0x1 @@ -2052,6 +2073,8 @@ const ( PR_SET_TIMING = 0xe PR_SET_TSC = 0x1a PR_SET_UNALIGN = 0x6 + PR_SET_VMA = 0x53564d41 + PR_SET_VMA_ANON_NAME = 0x0 PR_SPEC_DISABLE = 0x4 PR_SPEC_DISABLE_NOEXEC = 0x10 PR_SPEC_ENABLE = 0x2 @@ -2135,6 +2158,10 @@ const ( PTRACE_SYSCALL_INFO_NONE = 0x0 PTRACE_SYSCALL_INFO_SECCOMP = 0x3 PTRACE_TRACEME = 0x0 + P_ALL = 0x0 + P_PGID = 0x2 + P_PID = 0x1 + P_PIDFD = 0x3 QNX4_SUPER_MAGIC = 0x2f QNX6_SUPER_MAGIC = 0x68191122 RAMFS_MAGIC = 0x858458f6 @@ -2505,6 +2532,7 @@ const ( SMART_STATUS = 0xda SMART_WRITE_LOG_SECTOR = 0xd6 SMART_WRITE_THRESHOLDS = 0xd7 + SMB2_SUPER_MAGIC = 0xfe534d42 SMB_SUPER_MAGIC = 0x517b SOCKFS_MAGIC = 0x534f434b SOCK_BUF_LOCK_MASK = 0x3 @@ -2646,7 +2674,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0xa + TASKSTATS_VERSION = 0xb TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go new file mode 100644 index 000000000..ebc5f3218 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -0,0 +1,818 @@ +// mkerrors.sh -Wall -Werror -static -I/tmp/include +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build loong64 && linux +// +build loong64,linux + +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go + +package unix + +import "syscall" + +const ( + B1000000 = 0x1008 + B115200 = 0x1002 + B1152000 = 0x1009 + B1500000 = 0x100a + B2000000 = 0x100b + B230400 = 0x1003 + B2500000 = 0x100c + B3000000 = 0x100d + B3500000 = 0x100e + B4000000 = 0x100f + B460800 = 0x1004 + B500000 = 0x1005 + B57600 = 0x1001 + B576000 = 0x1006 + B921600 = 0x1007 + BLKBSZGET = 0x80081270 + BLKBSZSET = 0x40081271 + BLKFLSBUF = 0x1261 + BLKFRAGET = 0x1265 + BLKFRASET = 0x1264 + BLKGETSIZE = 0x1260 + BLKGETSIZE64 = 0x80081272 + BLKPBSZGET = 0x127b + BLKRAGET = 0x1263 + BLKRASET = 0x1262 + BLKROGET = 0x125e + BLKROSET = 0x125d + BLKRRPART = 0x125f + BLKSECTGET = 0x1267 + BLKSECTSET = 0x1266 + BLKSSZGET = 0x1268 + BOTHER = 0x1000 + BS1 = 0x2000 + BSDLY = 0x2000 + CBAUD = 0x100f + CBAUDEX = 0x1000 + CIBAUD = 0x100f0000 + CLOCAL = 0x800 + CR1 = 0x200 + CR2 = 0x400 + CR3 = 0x600 + CRDLY = 0x600 + CREAD = 0x80 + CS6 = 0x10 + CS7 = 0x20 + CS8 = 0x30 + CSIZE = 0x30 + CSTOPB = 0x40 + ECCGETLAYOUT = 0x81484d11 + ECCGETSTATS = 0x80104d12 + ECHOCTL = 0x200 + ECHOE = 0x10 + ECHOK = 0x20 + ECHOKE = 0x800 + ECHONL = 0x40 + ECHOPRT = 0x400 + EFD_CLOEXEC = 0x80000 + EFD_NONBLOCK = 0x800 + EPOLL_CLOEXEC = 0x80000 + EXTPROC = 0x10000 + FF1 = 0x8000 + FFDLY = 0x8000 + FICLONE = 0x40049409 + FICLONERANGE = 0x4020940d + FLUSHO = 0x1000 + FPU_CTX_MAGIC = 0x46505501 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 + FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b + FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 + FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 + FS_IOC_SETFLAGS = 0x40086602 + FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 + F_GETLK = 0x5 + F_GETLK64 = 0x5 + F_GETOWN = 0x9 + F_RDLCK = 0x0 + F_SETLK = 0x6 + F_SETLK64 = 0x6 + F_SETLKW = 0x7 + F_SETLKW64 = 0x7 + F_SETOWN = 0x8 + F_UNLCK = 0x2 + F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 + HUPCL = 0x400 + ICANON = 0x2 + IEXTEN = 0x8000 + IN_CLOEXEC = 0x80000 + IN_NONBLOCK = 0x800 + IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + ISIG = 0x1 + IUCLC = 0x200 + IXOFF = 0x1000 + IXON = 0x400 + LASX_CTX_MAGIC = 0x41535801 + LSX_CTX_MAGIC = 0x53580001 + MAP_ANON = 0x20 + MAP_ANONYMOUS = 0x20 + MAP_DENYWRITE = 0x800 + MAP_EXECUTABLE = 0x1000 + MAP_GROWSDOWN = 0x100 + MAP_HUGETLB = 0x40000 + MAP_LOCKED = 0x2000 + MAP_NONBLOCK = 0x10000 + MAP_NORESERVE = 0x4000 + MAP_POPULATE = 0x8000 + MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 + MCL_CURRENT = 0x1 + MCL_FUTURE = 0x2 + MCL_ONFAULT = 0x4 + MEMERASE = 0x40084d02 + MEMERASE64 = 0x40104d14 + MEMGETBADBLOCK = 0x40084d0b + MEMGETINFO = 0x80204d01 + MEMGETOOBSEL = 0x80c84d0a + MEMGETREGIONCOUNT = 0x80044d07 + MEMISLOCKED = 0x80084d17 + MEMLOCK = 0x40084d05 + MEMREADOOB = 0xc0104d04 + MEMSETBADBLOCK = 0x40084d0c + MEMUNLOCK = 0x40084d06 + MEMWRITEOOB = 0xc0104d03 + MTDFILEMODE = 0x4d13 + NFDBITS = 0x40 + NLDLY = 0x100 + NOFLSH = 0x80 + NS_GET_NSTYPE = 0xb703 + NS_GET_OWNER_UID = 0xb704 + NS_GET_PARENT = 0xb702 + NS_GET_USERNS = 0xb701 + OLCUC = 0x2 + ONLCR = 0x4 + OTPERASE = 0x400c4d19 + OTPGETREGIONCOUNT = 0x40044d0e + OTPGETREGIONINFO = 0x400c4d0f + OTPLOCK = 0x800c4d10 + OTPSELECT = 0x80044d0d + O_APPEND = 0x400 + O_ASYNC = 0x2000 + O_CLOEXEC = 0x80000 + O_CREAT = 0x40 + O_DIRECT = 0x4000 + O_DIRECTORY = 0x10000 + O_DSYNC = 0x1000 + O_EXCL = 0x80 + O_FSYNC = 0x101000 + O_LARGEFILE = 0x0 + O_NDELAY = 0x800 + O_NOATIME = 0x40000 + O_NOCTTY = 0x100 + O_NOFOLLOW = 0x20000 + O_NONBLOCK = 0x800 + O_PATH = 0x200000 + O_RSYNC = 0x101000 + O_SYNC = 0x101000 + O_TMPFILE = 0x410000 + O_TRUNC = 0x200 + PARENB = 0x100 + PARODD = 0x200 + PENDIN = 0x4000 + PERF_EVENT_IOC_DISABLE = 0x2401 + PERF_EVENT_IOC_ENABLE = 0x2400 + PERF_EVENT_IOC_ID = 0x80082407 + PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b + PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 + PERF_EVENT_IOC_PERIOD = 0x40082404 + PERF_EVENT_IOC_QUERY_BPF = 0xc008240a + PERF_EVENT_IOC_REFRESH = 0x2402 + PERF_EVENT_IOC_RESET = 0x2403 + PERF_EVENT_IOC_SET_BPF = 0x40042408 + PERF_EVENT_IOC_SET_FILTER = 0x40082406 + PERF_EVENT_IOC_SET_OUTPUT = 0x2405 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 + PPPIOCXFERUNIT = 0x744e + PR_SET_PTRACER_ANY = 0xffffffffffffffff + PTRACE_SYSEMU = 0x1f + PTRACE_SYSEMU_SINGLESTEP = 0x20 + RLIMIT_AS = 0x9 + RLIMIT_MEMLOCK = 0x8 + RLIMIT_NOFILE = 0x7 + RLIMIT_NPROC = 0x6 + RLIMIT_RSS = 0x5 + RNDADDENTROPY = 0x40085203 + RNDADDTOENTCNT = 0x40045201 + RNDCLEARPOOL = 0x5206 + RNDGETENTCNT = 0x80045200 + RNDGETPOOL = 0x80085202 + RNDRESEEDCRNG = 0x5207 + RNDZAPENTCNT = 0x5204 + RTC_AIE_OFF = 0x7002 + RTC_AIE_ON = 0x7001 + RTC_ALM_READ = 0x80247008 + RTC_ALM_SET = 0x40247007 + RTC_EPOCH_READ = 0x8008700d + RTC_EPOCH_SET = 0x4008700e + RTC_IRQP_READ = 0x8008700b + RTC_IRQP_SET = 0x4008700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 + RTC_PIE_OFF = 0x7006 + RTC_PIE_ON = 0x7005 + RTC_PLL_GET = 0x80207011 + RTC_PLL_SET = 0x40207012 + RTC_RD_TIME = 0x80247009 + RTC_SET_TIME = 0x4024700a + RTC_UIE_OFF = 0x7004 + RTC_UIE_ON = 0x7003 + RTC_VL_CLR = 0x7014 + RTC_VL_READ = 0x80047013 + RTC_WIE_OFF = 0x7010 + RTC_WIE_ON = 0x700f + RTC_WKALM_RD = 0x80287010 + RTC_WKALM_SET = 0x4028700f + SCM_TIMESTAMPING = 0x25 + SCM_TIMESTAMPING_OPT_STATS = 0x36 + SCM_TIMESTAMPING_PKTINFO = 0x3a + SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d + SCM_WIFI_STATUS = 0x29 + SFD_CLOEXEC = 0x80000 + SFD_NONBLOCK = 0x800 + SIOCATMARK = 0x8905 + SIOCGPGRP = 0x8904 + SIOCGSTAMPNS_NEW = 0x80108907 + SIOCGSTAMP_NEW = 0x80108906 + SIOCINQ = 0x541b + SIOCOUTQ = 0x5411 + SIOCSPGRP = 0x8902 + SOCK_CLOEXEC = 0x80000 + SOCK_DGRAM = 0x2 + SOCK_NONBLOCK = 0x800 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0x1 + SO_ACCEPTCONN = 0x1e + SO_ATTACH_BPF = 0x32 + SO_ATTACH_REUSEPORT_CBPF = 0x33 + SO_ATTACH_REUSEPORT_EBPF = 0x34 + SO_BINDTODEVICE = 0x19 + SO_BINDTOIFINDEX = 0x3e + SO_BPF_EXTENSIONS = 0x30 + SO_BROADCAST = 0x6 + SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 + SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 + SO_CNX_ADVICE = 0x35 + SO_COOKIE = 0x39 + SO_DETACH_REUSEPORT_BPF = 0x44 + SO_DOMAIN = 0x27 + SO_DONTROUTE = 0x5 + SO_ERROR = 0x4 + SO_INCOMING_CPU = 0x31 + SO_INCOMING_NAPI_ID = 0x38 + SO_KEEPALIVE = 0x9 + SO_LINGER = 0xd + SO_LOCK_FILTER = 0x2c + SO_MARK = 0x24 + SO_MAX_PACING_RATE = 0x2f + SO_MEMINFO = 0x37 + SO_NETNS_COOKIE = 0x47 + SO_NOFCS = 0x2b + SO_OOBINLINE = 0xa + SO_PASSCRED = 0x10 + SO_PASSSEC = 0x22 + SO_PEEK_OFF = 0x2a + SO_PEERCRED = 0x11 + SO_PEERGROUPS = 0x3b + SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 + SO_PROTOCOL = 0x26 + SO_RCVBUF = 0x8 + SO_RCVBUFFORCE = 0x21 + SO_RCVLOWAT = 0x12 + SO_RCVTIMEO = 0x14 + SO_RCVTIMEO_NEW = 0x42 + SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 + SO_REUSEADDR = 0x2 + SO_REUSEPORT = 0xf + SO_RXQ_OVFL = 0x28 + SO_SECURITY_AUTHENTICATION = 0x16 + SO_SECURITY_ENCRYPTION_NETWORK = 0x18 + SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 + SO_SELECT_ERR_QUEUE = 0x2d + SO_SNDBUF = 0x7 + SO_SNDBUFFORCE = 0x20 + SO_SNDLOWAT = 0x13 + SO_SNDTIMEO = 0x15 + SO_SNDTIMEO_NEW = 0x43 + SO_SNDTIMEO_OLD = 0x15 + SO_TIMESTAMPING = 0x25 + SO_TIMESTAMPING_NEW = 0x41 + SO_TIMESTAMPING_OLD = 0x25 + SO_TIMESTAMPNS = 0x23 + SO_TIMESTAMPNS_NEW = 0x40 + SO_TIMESTAMPNS_OLD = 0x23 + SO_TIMESTAMP_NEW = 0x3f + SO_TXTIME = 0x3d + SO_TYPE = 0x3 + SO_WIFI_STATUS = 0x29 + SO_ZEROCOPY = 0x3c + TAB1 = 0x800 + TAB2 = 0x1000 + TAB3 = 0x1800 + TABDLY = 0x1800 + TCFLSH = 0x540b + TCGETA = 0x5405 + TCGETS = 0x5401 + TCGETS2 = 0x802c542a + TCGETX = 0x5432 + TCSAFLUSH = 0x2 + TCSBRK = 0x5409 + TCSBRKP = 0x5425 + TCSETA = 0x5406 + TCSETAF = 0x5408 + TCSETAW = 0x5407 + TCSETS = 0x5402 + TCSETS2 = 0x402c542b + TCSETSF = 0x5404 + TCSETSF2 = 0x402c542d + TCSETSW = 0x5403 + TCSETSW2 = 0x402c542c + TCSETX = 0x5433 + TCSETXF = 0x5434 + TCSETXW = 0x5435 + TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 + TIOCCBRK = 0x5428 + TIOCCONS = 0x541d + TIOCEXCL = 0x540c + TIOCGDEV = 0x80045432 + TIOCGETD = 0x5424 + TIOCGEXCL = 0x80045440 + TIOCGICOUNT = 0x545d + TIOCGISO7816 = 0x80285442 + TIOCGLCKTRMIOS = 0x5456 + TIOCGPGRP = 0x540f + TIOCGPKT = 0x80045438 + TIOCGPTLCK = 0x80045439 + TIOCGPTN = 0x80045430 + TIOCGPTPEER = 0x5441 + TIOCGRS485 = 0x542e + TIOCGSERIAL = 0x541e + TIOCGSID = 0x5429 + TIOCGSOFTCAR = 0x5419 + TIOCGWINSZ = 0x5413 + TIOCINQ = 0x541b + TIOCLINUX = 0x541c + TIOCMBIC = 0x5417 + TIOCMBIS = 0x5416 + TIOCMGET = 0x5415 + TIOCMIWAIT = 0x545c + TIOCMSET = 0x5418 + TIOCM_CAR = 0x40 + TIOCM_CD = 0x40 + TIOCM_CTS = 0x20 + TIOCM_DSR = 0x100 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x5422 + TIOCNXCL = 0x540d + TIOCOUTQ = 0x5411 + TIOCPKT = 0x5420 + TIOCSBRK = 0x5427 + TIOCSCTTY = 0x540e + TIOCSERCONFIG = 0x5453 + TIOCSERGETLSR = 0x5459 + TIOCSERGETMULTI = 0x545a + TIOCSERGSTRUCT = 0x5458 + TIOCSERGWILD = 0x5454 + TIOCSERSETMULTI = 0x545b + TIOCSERSWILD = 0x5455 + TIOCSER_TEMT = 0x1 + TIOCSETD = 0x5423 + TIOCSIG = 0x40045436 + TIOCSISO7816 = 0xc0285443 + TIOCSLCKTRMIOS = 0x5457 + TIOCSPGRP = 0x5410 + TIOCSPTLCK = 0x40045431 + TIOCSRS485 = 0x542f + TIOCSSERIAL = 0x541f + TIOCSSOFTCAR = 0x541a + TIOCSTI = 0x5412 + TIOCSWINSZ = 0x5414 + TIOCVHANGUP = 0x5437 + TOSTOP = 0x100 + TUNATTACHFILTER = 0x401054d5 + TUNDETACHFILTER = 0x401054d6 + TUNGETDEVNETNS = 0x54e3 + TUNGETFEATURES = 0x800454cf + TUNGETFILTER = 0x801054db + TUNGETIFF = 0x800454d2 + TUNGETSNDBUF = 0x800454d3 + TUNGETVNETBE = 0x800454df + TUNGETVNETHDRSZ = 0x800454d7 + TUNGETVNETLE = 0x800454dd + TUNSETCARRIER = 0x400454e2 + TUNSETDEBUG = 0x400454c9 + TUNSETFILTEREBPF = 0x800454e1 + TUNSETGROUP = 0x400454ce + TUNSETIFF = 0x400454ca + TUNSETIFINDEX = 0x400454da + TUNSETLINK = 0x400454cd + TUNSETNOCSUM = 0x400454c8 + TUNSETOFFLOAD = 0x400454d0 + TUNSETOWNER = 0x400454cc + TUNSETPERSIST = 0x400454cb + TUNSETQUEUE = 0x400454d9 + TUNSETSNDBUF = 0x400454d4 + TUNSETSTEERINGEBPF = 0x800454e0 + TUNSETTXFILTER = 0x400454d1 + TUNSETVNETBE = 0x400454de + TUNSETVNETHDRSZ = 0x400454d8 + TUNSETVNETLE = 0x400454dc + UBI_IOCATT = 0x40186f40 + UBI_IOCDET = 0x40046f41 + UBI_IOCEBCH = 0x40044f02 + UBI_IOCEBER = 0x40044f01 + UBI_IOCEBISMAP = 0x80044f05 + UBI_IOCEBMAP = 0x40084f03 + UBI_IOCEBUNMAP = 0x40044f04 + UBI_IOCMKVOL = 0x40986f00 + UBI_IOCRMVOL = 0x40046f01 + UBI_IOCRNVOL = 0x51106f03 + UBI_IOCRPEB = 0x40046f04 + UBI_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCSPEB = 0x40046f05 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 + VDISCARD = 0xd + VEOF = 0x4 + VEOL = 0xb + VEOL2 = 0x10 + VMIN = 0x6 + VREPRINT = 0xc + VSTART = 0x8 + VSTOP = 0x9 + VSUSP = 0xa + VSWTC = 0x7 + VT1 = 0x4000 + VTDLY = 0x4000 + VTIME = 0x5 + VWERASE = 0xe + WDIOC_GETBOOTSTATUS = 0x80045702 + WDIOC_GETPRETIMEOUT = 0x80045709 + WDIOC_GETSTATUS = 0x80045701 + WDIOC_GETSUPPORT = 0x80285700 + WDIOC_GETTEMP = 0x80045703 + WDIOC_GETTIMELEFT = 0x8004570a + WDIOC_GETTIMEOUT = 0x80045707 + WDIOC_KEEPALIVE = 0x80045705 + WDIOC_SETOPTIONS = 0x80045704 + WORDSIZE = 0x40 + XCASE = 0x4 + XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 +) + +// Errors +const ( + EADDRINUSE = syscall.Errno(0x62) + EADDRNOTAVAIL = syscall.Errno(0x63) + EADV = syscall.Errno(0x44) + EAFNOSUPPORT = syscall.Errno(0x61) + EALREADY = syscall.Errno(0x72) + EBADE = syscall.Errno(0x34) + EBADFD = syscall.Errno(0x4d) + EBADMSG = syscall.Errno(0x4a) + EBADR = syscall.Errno(0x35) + EBADRQC = syscall.Errno(0x38) + EBADSLT = syscall.Errno(0x39) + EBFONT = syscall.Errno(0x3b) + ECANCELED = syscall.Errno(0x7d) + ECHRNG = syscall.Errno(0x2c) + ECOMM = syscall.Errno(0x46) + ECONNABORTED = syscall.Errno(0x67) + ECONNREFUSED = syscall.Errno(0x6f) + ECONNRESET = syscall.Errno(0x68) + EDEADLK = syscall.Errno(0x23) + EDEADLOCK = syscall.Errno(0x23) + EDESTADDRREQ = syscall.Errno(0x59) + EDOTDOT = syscall.Errno(0x49) + EDQUOT = syscall.Errno(0x7a) + EHOSTDOWN = syscall.Errno(0x70) + EHOSTUNREACH = syscall.Errno(0x71) + EHWPOISON = syscall.Errno(0x85) + EIDRM = syscall.Errno(0x2b) + EILSEQ = syscall.Errno(0x54) + EINPROGRESS = syscall.Errno(0x73) + EISCONN = syscall.Errno(0x6a) + EISNAM = syscall.Errno(0x78) + EKEYEXPIRED = syscall.Errno(0x7f) + EKEYREJECTED = syscall.Errno(0x81) + EKEYREVOKED = syscall.Errno(0x80) + EL2HLT = syscall.Errno(0x33) + EL2NSYNC = syscall.Errno(0x2d) + EL3HLT = syscall.Errno(0x2e) + EL3RST = syscall.Errno(0x2f) + ELIBACC = syscall.Errno(0x4f) + ELIBBAD = syscall.Errno(0x50) + ELIBEXEC = syscall.Errno(0x53) + ELIBMAX = syscall.Errno(0x52) + ELIBSCN = syscall.Errno(0x51) + ELNRNG = syscall.Errno(0x30) + ELOOP = syscall.Errno(0x28) + EMEDIUMTYPE = syscall.Errno(0x7c) + EMSGSIZE = syscall.Errno(0x5a) + EMULTIHOP = syscall.Errno(0x48) + ENAMETOOLONG = syscall.Errno(0x24) + ENAVAIL = syscall.Errno(0x77) + ENETDOWN = syscall.Errno(0x64) + ENETRESET = syscall.Errno(0x66) + ENETUNREACH = syscall.Errno(0x65) + ENOANO = syscall.Errno(0x37) + ENOBUFS = syscall.Errno(0x69) + ENOCSI = syscall.Errno(0x32) + ENODATA = syscall.Errno(0x3d) + ENOKEY = syscall.Errno(0x7e) + ENOLCK = syscall.Errno(0x25) + ENOLINK = syscall.Errno(0x43) + ENOMEDIUM = syscall.Errno(0x7b) + ENOMSG = syscall.Errno(0x2a) + ENONET = syscall.Errno(0x40) + ENOPKG = syscall.Errno(0x41) + ENOPROTOOPT = syscall.Errno(0x5c) + ENOSR = syscall.Errno(0x3f) + ENOSTR = syscall.Errno(0x3c) + ENOSYS = syscall.Errno(0x26) + ENOTCONN = syscall.Errno(0x6b) + ENOTEMPTY = syscall.Errno(0x27) + ENOTNAM = syscall.Errno(0x76) + ENOTRECOVERABLE = syscall.Errno(0x83) + ENOTSOCK = syscall.Errno(0x58) + ENOTSUP = syscall.Errno(0x5f) + ENOTUNIQ = syscall.Errno(0x4c) + EOPNOTSUPP = syscall.Errno(0x5f) + EOVERFLOW = syscall.Errno(0x4b) + EOWNERDEAD = syscall.Errno(0x82) + EPFNOSUPPORT = syscall.Errno(0x60) + EPROTO = syscall.Errno(0x47) + EPROTONOSUPPORT = syscall.Errno(0x5d) + EPROTOTYPE = syscall.Errno(0x5b) + EREMCHG = syscall.Errno(0x4e) + EREMOTE = syscall.Errno(0x42) + EREMOTEIO = syscall.Errno(0x79) + ERESTART = syscall.Errno(0x55) + ERFKILL = syscall.Errno(0x84) + ESHUTDOWN = syscall.Errno(0x6c) + ESOCKTNOSUPPORT = syscall.Errno(0x5e) + ESRMNT = syscall.Errno(0x45) + ESTALE = syscall.Errno(0x74) + ESTRPIPE = syscall.Errno(0x56) + ETIME = syscall.Errno(0x3e) + ETIMEDOUT = syscall.Errno(0x6e) + ETOOMANYREFS = syscall.Errno(0x6d) + EUCLEAN = syscall.Errno(0x75) + EUNATCH = syscall.Errno(0x31) + EUSERS = syscall.Errno(0x57) + EXFULL = syscall.Errno(0x36) +) + +// Signals +const ( + SIGBUS = syscall.Signal(0x7) + SIGCHLD = syscall.Signal(0x11) + SIGCLD = syscall.Signal(0x11) + SIGCONT = syscall.Signal(0x12) + SIGIO = syscall.Signal(0x1d) + SIGPOLL = syscall.Signal(0x1d) + SIGPROF = syscall.Signal(0x1b) + SIGPWR = syscall.Signal(0x1e) + SIGSTKFLT = syscall.Signal(0x10) + SIGSTOP = syscall.Signal(0x13) + SIGSYS = syscall.Signal(0x1f) + SIGTSTP = syscall.Signal(0x14) + SIGTTIN = syscall.Signal(0x15) + SIGTTOU = syscall.Signal(0x16) + SIGURG = syscall.Signal(0x17) + SIGUSR1 = syscall.Signal(0xa) + SIGUSR2 = syscall.Signal(0xc) + SIGVTALRM = syscall.Signal(0x1a) + SIGWINCH = syscall.Signal(0x1c) + SIGXCPU = syscall.Signal(0x18) + SIGXFSZ = syscall.Signal(0x19) +) + +// Error table +var errorList = [...]struct { + num syscall.Errno + name string + desc string +}{ + {1, "EPERM", "operation not permitted"}, + {2, "ENOENT", "no such file or directory"}, + {3, "ESRCH", "no such process"}, + {4, "EINTR", "interrupted system call"}, + {5, "EIO", "input/output error"}, + {6, "ENXIO", "no such device or address"}, + {7, "E2BIG", "argument list too long"}, + {8, "ENOEXEC", "exec format error"}, + {9, "EBADF", "bad file descriptor"}, + {10, "ECHILD", "no child processes"}, + {11, "EAGAIN", "resource temporarily unavailable"}, + {12, "ENOMEM", "cannot allocate memory"}, + {13, "EACCES", "permission denied"}, + {14, "EFAULT", "bad address"}, + {15, "ENOTBLK", "block device required"}, + {16, "EBUSY", "device or resource busy"}, + {17, "EEXIST", "file exists"}, + {18, "EXDEV", "invalid cross-device link"}, + {19, "ENODEV", "no such device"}, + {20, "ENOTDIR", "not a directory"}, + {21, "EISDIR", "is a directory"}, + {22, "EINVAL", "invalid argument"}, + {23, "ENFILE", "too many open files in system"}, + {24, "EMFILE", "too many open files"}, + {25, "ENOTTY", "inappropriate ioctl for device"}, + {26, "ETXTBSY", "text file busy"}, + {27, "EFBIG", "file too large"}, + {28, "ENOSPC", "no space left on device"}, + {29, "ESPIPE", "illegal seek"}, + {30, "EROFS", "read-only file system"}, + {31, "EMLINK", "too many links"}, + {32, "EPIPE", "broken pipe"}, + {33, "EDOM", "numerical argument out of domain"}, + {34, "ERANGE", "numerical result out of range"}, + {35, "EDEADLK", "resource deadlock avoided"}, + {36, "ENAMETOOLONG", "file name too long"}, + {37, "ENOLCK", "no locks available"}, + {38, "ENOSYS", "function not implemented"}, + {39, "ENOTEMPTY", "directory not empty"}, + {40, "ELOOP", "too many levels of symbolic links"}, + {42, "ENOMSG", "no message of desired type"}, + {43, "EIDRM", "identifier removed"}, + {44, "ECHRNG", "channel number out of range"}, + {45, "EL2NSYNC", "level 2 not synchronized"}, + {46, "EL3HLT", "level 3 halted"}, + {47, "EL3RST", "level 3 reset"}, + {48, "ELNRNG", "link number out of range"}, + {49, "EUNATCH", "protocol driver not attached"}, + {50, "ENOCSI", "no CSI structure available"}, + {51, "EL2HLT", "level 2 halted"}, + {52, "EBADE", "invalid exchange"}, + {53, "EBADR", "invalid request descriptor"}, + {54, "EXFULL", "exchange full"}, + {55, "ENOANO", "no anode"}, + {56, "EBADRQC", "invalid request code"}, + {57, "EBADSLT", "invalid slot"}, + {59, "EBFONT", "bad font file format"}, + {60, "ENOSTR", "device not a stream"}, + {61, "ENODATA", "no data available"}, + {62, "ETIME", "timer expired"}, + {63, "ENOSR", "out of streams resources"}, + {64, "ENONET", "machine is not on the network"}, + {65, "ENOPKG", "package not installed"}, + {66, "EREMOTE", "object is remote"}, + {67, "ENOLINK", "link has been severed"}, + {68, "EADV", "advertise error"}, + {69, "ESRMNT", "srmount error"}, + {70, "ECOMM", "communication error on send"}, + {71, "EPROTO", "protocol error"}, + {72, "EMULTIHOP", "multihop attempted"}, + {73, "EDOTDOT", "RFS specific error"}, + {74, "EBADMSG", "bad message"}, + {75, "EOVERFLOW", "value too large for defined data type"}, + {76, "ENOTUNIQ", "name not unique on network"}, + {77, "EBADFD", "file descriptor in bad state"}, + {78, "EREMCHG", "remote address changed"}, + {79, "ELIBACC", "can not access a needed shared library"}, + {80, "ELIBBAD", "accessing a corrupted shared library"}, + {81, "ELIBSCN", ".lib section in a.out corrupted"}, + {82, "ELIBMAX", "attempting to link in too many shared libraries"}, + {83, "ELIBEXEC", "cannot exec a shared library directly"}, + {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, + {85, "ERESTART", "interrupted system call should be restarted"}, + {86, "ESTRPIPE", "streams pipe error"}, + {87, "EUSERS", "too many users"}, + {88, "ENOTSOCK", "socket operation on non-socket"}, + {89, "EDESTADDRREQ", "destination address required"}, + {90, "EMSGSIZE", "message too long"}, + {91, "EPROTOTYPE", "protocol wrong type for socket"}, + {92, "ENOPROTOOPT", "protocol not available"}, + {93, "EPROTONOSUPPORT", "protocol not supported"}, + {94, "ESOCKTNOSUPPORT", "socket type not supported"}, + {95, "ENOTSUP", "operation not supported"}, + {96, "EPFNOSUPPORT", "protocol family not supported"}, + {97, "EAFNOSUPPORT", "address family not supported by protocol"}, + {98, "EADDRINUSE", "address already in use"}, + {99, "EADDRNOTAVAIL", "cannot assign requested address"}, + {100, "ENETDOWN", "network is down"}, + {101, "ENETUNREACH", "network is unreachable"}, + {102, "ENETRESET", "network dropped connection on reset"}, + {103, "ECONNABORTED", "software caused connection abort"}, + {104, "ECONNRESET", "connection reset by peer"}, + {105, "ENOBUFS", "no buffer space available"}, + {106, "EISCONN", "transport endpoint is already connected"}, + {107, "ENOTCONN", "transport endpoint is not connected"}, + {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, + {109, "ETOOMANYREFS", "too many references: cannot splice"}, + {110, "ETIMEDOUT", "connection timed out"}, + {111, "ECONNREFUSED", "connection refused"}, + {112, "EHOSTDOWN", "host is down"}, + {113, "EHOSTUNREACH", "no route to host"}, + {114, "EALREADY", "operation already in progress"}, + {115, "EINPROGRESS", "operation now in progress"}, + {116, "ESTALE", "stale file handle"}, + {117, "EUCLEAN", "structure needs cleaning"}, + {118, "ENOTNAM", "not a XENIX named type file"}, + {119, "ENAVAIL", "no XENIX semaphores available"}, + {120, "EISNAM", "is a named type file"}, + {121, "EREMOTEIO", "remote I/O error"}, + {122, "EDQUOT", "disk quota exceeded"}, + {123, "ENOMEDIUM", "no medium found"}, + {124, "EMEDIUMTYPE", "wrong medium type"}, + {125, "ECANCELED", "operation canceled"}, + {126, "ENOKEY", "required key not available"}, + {127, "EKEYEXPIRED", "key has expired"}, + {128, "EKEYREVOKED", "key has been revoked"}, + {129, "EKEYREJECTED", "key was rejected by service"}, + {130, "EOWNERDEAD", "owner died"}, + {131, "ENOTRECOVERABLE", "state not recoverable"}, + {132, "ERFKILL", "operation not possible due to RF-kill"}, + {133, "EHWPOISON", "memory page has hardware error"}, +} + +// Signal table +var signalList = [...]struct { + num syscall.Signal + name string + desc string +}{ + {1, "SIGHUP", "hangup"}, + {2, "SIGINT", "interrupt"}, + {3, "SIGQUIT", "quit"}, + {4, "SIGILL", "illegal instruction"}, + {5, "SIGTRAP", "trace/breakpoint trap"}, + {6, "SIGABRT", "aborted"}, + {7, "SIGBUS", "bus error"}, + {8, "SIGFPE", "floating point exception"}, + {9, "SIGKILL", "killed"}, + {10, "SIGUSR1", "user defined signal 1"}, + {11, "SIGSEGV", "segmentation fault"}, + {12, "SIGUSR2", "user defined signal 2"}, + {13, "SIGPIPE", "broken pipe"}, + {14, "SIGALRM", "alarm clock"}, + {15, "SIGTERM", "terminated"}, + {16, "SIGSTKFLT", "stack fault"}, + {17, "SIGCHLD", "child exited"}, + {18, "SIGCONT", "continued"}, + {19, "SIGSTOP", "stopped (signal)"}, + {20, "SIGTSTP", "stopped"}, + {21, "SIGTTIN", "stopped (tty input)"}, + {22, "SIGTTOU", "stopped (tty output)"}, + {23, "SIGURG", "urgent I/O condition"}, + {24, "SIGXCPU", "CPU time limit exceeded"}, + {25, "SIGXFSZ", "file size limit exceeded"}, + {26, "SIGVTALRM", "virtual timer expired"}, + {27, "SIGPROF", "profiling timer expired"}, + {28, "SIGWINCH", "window changed"}, + {29, "SIGIO", "I/O possible"}, + {30, "SIGPWR", "power failure"}, + {31, "SIGSYS", "bad system call"}, +} diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go index 85e0cc386..870215d2c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go @@ -975,7 +975,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] @@ -992,7 +992,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go index f1d4a73b0..a89b0bfa5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go @@ -931,7 +931,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] @@ -946,7 +946,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 0ae0ed4cb..467deed76 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -643,17 +643,22 @@ var libc_flistxattr_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { - _, _, e1 := syscall_syscall6(libc_setattrlist_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) +func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -var libc_setattrlist_trampoline_addr uintptr +var libc_utimensat_trampoline_addr uintptr -//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" +//go:cgo_import_dynamic libc_utimensat utimensat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1638,6 +1643,30 @@ var libc_mknod_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1698,7 +1727,7 @@ var libc_pathconf_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1719,7 +1748,7 @@ var libc_pread_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index eac6ca806..7e308a476 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -228,11 +228,11 @@ TEXT libc_flistxattr_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_flistxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_flistxattr_trampoline_addr(SB)/8, $libc_flistxattr_trampoline<>(SB) -TEXT libc_setattrlist_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_setattrlist(SB) +TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_utimensat(SB) -GLOBL ·libc_setattrlist_trampoline_addr(SB), RODATA, $8 -DATA ·libc_setattrlist_trampoline_addr(SB)/8, $libc_setattrlist_trampoline<>(SB) +GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) @@ -600,6 +600,12 @@ TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) + +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index cf71be3ed..35938d34f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -643,17 +643,22 @@ var libc_flistxattr_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { - _, _, e1 := syscall_syscall6(libc_setattrlist_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) +func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_utimensat_trampoline_addr, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -var libc_setattrlist_trampoline_addr uintptr +var libc_utimensat_trampoline_addr uintptr -//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" +//go:cgo_import_dynamic libc_utimensat utimensat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1638,6 +1643,30 @@ var libc_mknod_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1698,7 +1727,7 @@ var libc_pathconf_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1719,7 +1748,7 @@ var libc_pread_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 4ebcf2175..b09e5bb0e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -228,11 +228,11 @@ TEXT libc_flistxattr_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_flistxattr_trampoline_addr(SB), RODATA, $8 DATA ·libc_flistxattr_trampoline_addr(SB)/8, $libc_flistxattr_trampoline<>(SB) -TEXT libc_setattrlist_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc_setattrlist(SB) +TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_utimensat(SB) -GLOBL ·libc_setattrlist_trampoline_addr(SB), RODATA, $8 -DATA ·libc_setattrlist_trampoline_addr(SB)/8, $libc_setattrlist_trampoline<>(SB) +GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fcntl(SB) @@ -600,6 +600,12 @@ TEXT libc_mknod_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknod_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknod_trampoline_addr(SB)/8, $libc_mknod_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) + +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_open_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_open(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index 3e9bddb7b..e9d9997ee 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -1420,7 +1420,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1437,7 +1437,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index c72a462b9..edd373b1a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -1420,7 +1420,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1437,7 +1437,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index 530d5df90..82e9764b2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -1420,7 +1420,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1437,7 +1437,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go index 71e7df9e8..a6479acd1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go @@ -1420,7 +1420,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1437,7 +1437,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 30fa4055e..bc4a27531 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -231,6 +231,16 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error) { + _, _, e1 := Syscall6(SYS_WAITID, uintptr(idType), uintptr(id), uintptr(unsafe.Pointer(info)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) ret = int(r0) @@ -818,6 +828,49 @@ func Fsync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error) { + r0, _, e1 := Syscall(SYS_FSMOUNT, uintptr(fd), uintptr(flags), uintptr(mountAttrs)) + fsfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsopen(fsName string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsName) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_FSOPEN, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fspick(dirfd int, pathName string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(pathName) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_FSPICK, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { @@ -1195,6 +1248,26 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MoveMount(fromDirfd int, fromPathName string, toDirfd int, toPathName string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fromPathName) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(toPathName) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MOVE_MOUNT, uintptr(fromDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(toDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1205,6 +1278,22 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func OpenTree(dfd int, fileName string, flags uint) (r int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fileName) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_OPEN_TREE, uintptr(dfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + r = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0) fd = int(r0) @@ -1992,6 +2081,16 @@ func PidfdGetfd(pidfd int, targetfd int, flags int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func PidfdSendSignal(pidfd int, sig Signal, info *Siginfo, flags int) (err error) { + _, _, e1 := Syscall6(SYS_PIDFD_SEND_SIGNAL, uintptr(pidfd), uintptr(sig), uintptr(unsafe.Pointer(info)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func shmat(id int, addr uintptr, flag int) (ret uintptr, err error) { r0, _, e1 := Syscall(SYS_SHMAT, uintptr(id), uintptr(addr), uintptr(flag)) ret = uintptr(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index 2fc6271f4..88af526b7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -200,7 +200,7 @@ func Lstat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -217,7 +217,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index 43d9f0128..2a0c4aa6a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -215,6 +215,17 @@ func Listen(s int, n int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdSecret(flags int) (fd int, err error) { + r0, _, e1 := Syscall(SYS_MEMFD_SECRET, uintptr(flags), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { @@ -225,7 +236,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -242,7 +253,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index 7df0cb179..4882bde3a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -538,7 +538,7 @@ func utimes(path string, times *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -555,7 +555,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 076e8f1c5..9f8c24e43 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -180,7 +180,18 @@ func Listen(s int, n int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func MemfdSecret(flags int) (fd int, err error) { + r0, _, e1 := Syscall(SYS_MEMFD_SECRET, uintptr(flags), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -197,7 +208,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go new file mode 100644 index 000000000..8cdfbe71e --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go @@ -0,0 +1,552 @@ +// go run mksyscall.go -tags linux,loong64 syscall_linux.go syscall_linux_loong64.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build linux && loong64 +// +build linux,loong64 + +package unix + +import ( + "syscall" + "unsafe" +) + +var _ syscall.Errno + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) { + _, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { + _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { + r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) + n = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + var _p0 unsafe.Pointer + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fadvise(fd int, offset int64, length int64, advice int) (err error) { + _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchown(fd int, uid int, gid int) (err error) { + _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, buf *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (euid int) { + r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) + euid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, n int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (off int64, err error) { + r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + off = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) + written = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setfsgid(gid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + prev = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setfsuid(uid int) (prev int, err error) { + r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + prev = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresgid(rgid int, egid int, sgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresuid(ruid int, euid int, suid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { + r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) + n = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, buf *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { + _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(n int, list *_Gid_t) (nn int, err error) { + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + nn = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setgroups(n int, list *_Gid_t) (err error) { + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) + xaddr = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Gettimeofday(tv *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(cmdline) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index 7b3c84746..d7d6f4244 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -150,7 +150,7 @@ func Listen(s int, n int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -167,7 +167,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index 0d3c45fbd..7f1f8e653 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -180,7 +180,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -197,7 +197,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index cb46b2aaa..f933d0f51 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -180,7 +180,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -197,7 +197,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index 21c9baa6a..297d0a998 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -150,7 +150,7 @@ func Listen(s int, n int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -167,7 +167,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go index 02b8f0887..2e32e7a44 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go @@ -210,7 +210,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -227,7 +227,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index ac8cb09ba..3c5317046 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -240,7 +240,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -257,7 +257,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index bd08d887a..a00c6744e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -240,7 +240,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -257,7 +257,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go index a834d2173..a1a9bcbbd 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -180,7 +180,7 @@ func Listen(s int, n int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -197,7 +197,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index 9e462a96f..e0dabc602 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -210,7 +210,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -227,7 +227,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index 96d340242..368623c0f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -220,7 +220,7 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -237,7 +237,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index 51d0c0742..4af561a48 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -1330,7 +1330,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1347,7 +1347,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index df2efb6db..3b90e9448 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -1330,7 +1330,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1347,7 +1347,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index c8536c2c9..890f4ccd1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -1330,7 +1330,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1347,7 +1347,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go index 8b981bfc2..c79f071fc 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -1330,7 +1330,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1347,7 +1347,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 8f80f4ade..a057fc5d3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1128,7 +1128,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1145,7 +1145,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 3a47aca7b..04db8fa2f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1128,7 +1128,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1145,7 +1145,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index 883a9b45e..69f803006 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1128,7 +1128,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1145,7 +1145,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index aac7fdc95..c96a50517 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1128,7 +1128,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1145,7 +1145,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 877618746..016d959bc 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1128,7 +1128,7 @@ func Pathconf(path string, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) @@ -1145,7 +1145,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index b5f926cee..d12f4fbfe 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -227,8 +227,8 @@ import ( //go:linkname procOpenat libc_openat //go:linkname procPathconf libc_pathconf //go:linkname procPause libc_pause -//go:linkname procPread libc_pread -//go:linkname procPwrite libc_pwrite +//go:linkname procpread libc_pread +//go:linkname procpwrite libc_pwrite //go:linkname procread libc_read //go:linkname procReadlink libc_readlink //go:linkname procRename libc_rename @@ -364,8 +364,8 @@ var ( procOpenat, procPathconf, procPause, - procPread, - procPwrite, + procpread, + procpwrite, procread, procReadlink, procRename, @@ -1380,12 +1380,12 @@ func Pause() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pread(fd int, p []byte, offset int64) (n int, err error) { +func pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } - r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpread)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = e1 @@ -1395,12 +1395,12 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Pwrite(fd int, p []byte, offset int64) (n int, err error) { +func pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { _p0 = &p[0] } - r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpwrite)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = e1 diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index cac1f758b..62192e1de 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -446,4 +446,5 @@ const ( SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index f327e4a0b..490aab5d2 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -368,4 +368,5 @@ const ( SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index fb06a08d4..aca17b6fa 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -410,4 +410,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 58285646e..54b4dfa54 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -313,4 +313,5 @@ const ( SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go new file mode 100644 index 000000000..e443f9a32 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -0,0 +1,313 @@ +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build loong64 && linux +// +build loong64,linux + +package unix + +const ( + SYS_IO_SETUP = 0 + SYS_IO_DESTROY = 1 + SYS_IO_SUBMIT = 2 + SYS_IO_CANCEL = 3 + SYS_IO_GETEVENTS = 4 + SYS_SETXATTR = 5 + SYS_LSETXATTR = 6 + SYS_FSETXATTR = 7 + SYS_GETXATTR = 8 + SYS_LGETXATTR = 9 + SYS_FGETXATTR = 10 + SYS_LISTXATTR = 11 + SYS_LLISTXATTR = 12 + SYS_FLISTXATTR = 13 + SYS_REMOVEXATTR = 14 + SYS_LREMOVEXATTR = 15 + SYS_FREMOVEXATTR = 16 + SYS_GETCWD = 17 + SYS_LOOKUP_DCOOKIE = 18 + SYS_EVENTFD2 = 19 + SYS_EPOLL_CREATE1 = 20 + SYS_EPOLL_CTL = 21 + SYS_EPOLL_PWAIT = 22 + SYS_DUP = 23 + SYS_DUP3 = 24 + SYS_FCNTL = 25 + SYS_INOTIFY_INIT1 = 26 + SYS_INOTIFY_ADD_WATCH = 27 + SYS_INOTIFY_RM_WATCH = 28 + SYS_IOCTL = 29 + SYS_IOPRIO_SET = 30 + SYS_IOPRIO_GET = 31 + SYS_FLOCK = 32 + SYS_MKNODAT = 33 + SYS_MKDIRAT = 34 + SYS_UNLINKAT = 35 + SYS_SYMLINKAT = 36 + SYS_LINKAT = 37 + SYS_UMOUNT2 = 39 + SYS_MOUNT = 40 + SYS_PIVOT_ROOT = 41 + SYS_NFSSERVCTL = 42 + SYS_STATFS = 43 + SYS_FSTATFS = 44 + SYS_TRUNCATE = 45 + SYS_FTRUNCATE = 46 + SYS_FALLOCATE = 47 + SYS_FACCESSAT = 48 + SYS_CHDIR = 49 + SYS_FCHDIR = 50 + SYS_CHROOT = 51 + SYS_FCHMOD = 52 + SYS_FCHMODAT = 53 + SYS_FCHOWNAT = 54 + SYS_FCHOWN = 55 + SYS_OPENAT = 56 + SYS_CLOSE = 57 + SYS_VHANGUP = 58 + SYS_PIPE2 = 59 + SYS_QUOTACTL = 60 + SYS_GETDENTS64 = 61 + SYS_LSEEK = 62 + SYS_READ = 63 + SYS_WRITE = 64 + SYS_READV = 65 + SYS_WRITEV = 66 + SYS_PREAD64 = 67 + SYS_PWRITE64 = 68 + SYS_PREADV = 69 + SYS_PWRITEV = 70 + SYS_SENDFILE = 71 + SYS_PSELECT6 = 72 + SYS_PPOLL = 73 + SYS_SIGNALFD4 = 74 + SYS_VMSPLICE = 75 + SYS_SPLICE = 76 + SYS_TEE = 77 + SYS_READLINKAT = 78 + SYS_FSTATAT = 79 + SYS_FSTAT = 80 + SYS_SYNC = 81 + SYS_FSYNC = 82 + SYS_FDATASYNC = 83 + SYS_SYNC_FILE_RANGE = 84 + SYS_TIMERFD_CREATE = 85 + SYS_TIMERFD_SETTIME = 86 + SYS_TIMERFD_GETTIME = 87 + SYS_UTIMENSAT = 88 + SYS_ACCT = 89 + SYS_CAPGET = 90 + SYS_CAPSET = 91 + SYS_PERSONALITY = 92 + SYS_EXIT = 93 + SYS_EXIT_GROUP = 94 + SYS_WAITID = 95 + SYS_SET_TID_ADDRESS = 96 + SYS_UNSHARE = 97 + SYS_FUTEX = 98 + SYS_SET_ROBUST_LIST = 99 + SYS_GET_ROBUST_LIST = 100 + SYS_NANOSLEEP = 101 + SYS_GETITIMER = 102 + SYS_SETITIMER = 103 + SYS_KEXEC_LOAD = 104 + SYS_INIT_MODULE = 105 + SYS_DELETE_MODULE = 106 + SYS_TIMER_CREATE = 107 + SYS_TIMER_GETTIME = 108 + SYS_TIMER_GETOVERRUN = 109 + SYS_TIMER_SETTIME = 110 + SYS_TIMER_DELETE = 111 + SYS_CLOCK_SETTIME = 112 + SYS_CLOCK_GETTIME = 113 + SYS_CLOCK_GETRES = 114 + SYS_CLOCK_NANOSLEEP = 115 + SYS_SYSLOG = 116 + SYS_PTRACE = 117 + SYS_SCHED_SETPARAM = 118 + SYS_SCHED_SETSCHEDULER = 119 + SYS_SCHED_GETSCHEDULER = 120 + SYS_SCHED_GETPARAM = 121 + SYS_SCHED_SETAFFINITY = 122 + SYS_SCHED_GETAFFINITY = 123 + SYS_SCHED_YIELD = 124 + SYS_SCHED_GET_PRIORITY_MAX = 125 + SYS_SCHED_GET_PRIORITY_MIN = 126 + SYS_SCHED_RR_GET_INTERVAL = 127 + SYS_RESTART_SYSCALL = 128 + SYS_KILL = 129 + SYS_TKILL = 130 + SYS_TGKILL = 131 + SYS_SIGALTSTACK = 132 + SYS_RT_SIGSUSPEND = 133 + SYS_RT_SIGACTION = 134 + SYS_RT_SIGPROCMASK = 135 + SYS_RT_SIGPENDING = 136 + SYS_RT_SIGTIMEDWAIT = 137 + SYS_RT_SIGQUEUEINFO = 138 + SYS_RT_SIGRETURN = 139 + SYS_SETPRIORITY = 140 + SYS_GETPRIORITY = 141 + SYS_REBOOT = 142 + SYS_SETREGID = 143 + SYS_SETGID = 144 + SYS_SETREUID = 145 + SYS_SETUID = 146 + SYS_SETRESUID = 147 + SYS_GETRESUID = 148 + SYS_SETRESGID = 149 + SYS_GETRESGID = 150 + SYS_SETFSUID = 151 + SYS_SETFSGID = 152 + SYS_TIMES = 153 + SYS_SETPGID = 154 + SYS_GETPGID = 155 + SYS_GETSID = 156 + SYS_SETSID = 157 + SYS_GETGROUPS = 158 + SYS_SETGROUPS = 159 + SYS_UNAME = 160 + SYS_SETHOSTNAME = 161 + SYS_SETDOMAINNAME = 162 + SYS_GETRUSAGE = 165 + SYS_UMASK = 166 + SYS_PRCTL = 167 + SYS_GETCPU = 168 + SYS_GETTIMEOFDAY = 169 + SYS_SETTIMEOFDAY = 170 + SYS_ADJTIMEX = 171 + SYS_GETPID = 172 + SYS_GETPPID = 173 + SYS_GETUID = 174 + SYS_GETEUID = 175 + SYS_GETGID = 176 + SYS_GETEGID = 177 + SYS_GETTID = 178 + SYS_SYSINFO = 179 + SYS_MQ_OPEN = 180 + SYS_MQ_UNLINK = 181 + SYS_MQ_TIMEDSEND = 182 + SYS_MQ_TIMEDRECEIVE = 183 + SYS_MQ_NOTIFY = 184 + SYS_MQ_GETSETATTR = 185 + SYS_MSGGET = 186 + SYS_MSGCTL = 187 + SYS_MSGRCV = 188 + SYS_MSGSND = 189 + SYS_SEMGET = 190 + SYS_SEMCTL = 191 + SYS_SEMTIMEDOP = 192 + SYS_SEMOP = 193 + SYS_SHMGET = 194 + SYS_SHMCTL = 195 + SYS_SHMAT = 196 + SYS_SHMDT = 197 + SYS_SOCKET = 198 + SYS_SOCKETPAIR = 199 + SYS_BIND = 200 + SYS_LISTEN = 201 + SYS_ACCEPT = 202 + SYS_CONNECT = 203 + SYS_GETSOCKNAME = 204 + SYS_GETPEERNAME = 205 + SYS_SENDTO = 206 + SYS_RECVFROM = 207 + SYS_SETSOCKOPT = 208 + SYS_GETSOCKOPT = 209 + SYS_SHUTDOWN = 210 + SYS_SENDMSG = 211 + SYS_RECVMSG = 212 + SYS_READAHEAD = 213 + SYS_BRK = 214 + SYS_MUNMAP = 215 + SYS_MREMAP = 216 + SYS_ADD_KEY = 217 + SYS_REQUEST_KEY = 218 + SYS_KEYCTL = 219 + SYS_CLONE = 220 + SYS_EXECVE = 221 + SYS_MMAP = 222 + SYS_FADVISE64 = 223 + SYS_SWAPON = 224 + SYS_SWAPOFF = 225 + SYS_MPROTECT = 226 + SYS_MSYNC = 227 + SYS_MLOCK = 228 + SYS_MUNLOCK = 229 + SYS_MLOCKALL = 230 + SYS_MUNLOCKALL = 231 + SYS_MINCORE = 232 + SYS_MADVISE = 233 + SYS_REMAP_FILE_PAGES = 234 + SYS_MBIND = 235 + SYS_GET_MEMPOLICY = 236 + SYS_SET_MEMPOLICY = 237 + SYS_MIGRATE_PAGES = 238 + SYS_MOVE_PAGES = 239 + SYS_RT_TGSIGQUEUEINFO = 240 + SYS_PERF_EVENT_OPEN = 241 + SYS_ACCEPT4 = 242 + SYS_RECVMMSG = 243 + SYS_ARCH_SPECIFIC_SYSCALL = 244 + SYS_WAIT4 = 260 + SYS_PRLIMIT64 = 261 + SYS_FANOTIFY_INIT = 262 + SYS_FANOTIFY_MARK = 263 + SYS_NAME_TO_HANDLE_AT = 264 + SYS_OPEN_BY_HANDLE_AT = 265 + SYS_CLOCK_ADJTIME = 266 + SYS_SYNCFS = 267 + SYS_SETNS = 268 + SYS_SENDMMSG = 269 + SYS_PROCESS_VM_READV = 270 + SYS_PROCESS_VM_WRITEV = 271 + SYS_KCMP = 272 + SYS_FINIT_MODULE = 273 + SYS_SCHED_SETATTR = 274 + SYS_SCHED_GETATTR = 275 + SYS_RENAMEAT2 = 276 + SYS_SECCOMP = 277 + SYS_GETRANDOM = 278 + SYS_MEMFD_CREATE = 279 + SYS_BPF = 280 + SYS_EXECVEAT = 281 + SYS_USERFAULTFD = 282 + SYS_MEMBARRIER = 283 + SYS_MLOCK2 = 284 + SYS_COPY_FILE_RANGE = 285 + SYS_PREADV2 = 286 + SYS_PWRITEV2 = 287 + SYS_PKEY_MPROTECT = 288 + SYS_PKEY_ALLOC = 289 + SYS_PKEY_FREE = 290 + SYS_STATX = 291 + SYS_IO_PGETEVENTS = 292 + SYS_RSEQ = 293 + SYS_KEXEC_FILE_LOAD = 294 + SYS_PIDFD_SEND_SIGNAL = 424 + SYS_IO_URING_SETUP = 425 + SYS_IO_URING_ENTER = 426 + SYS_IO_URING_REGISTER = 427 + SYS_OPEN_TREE = 428 + SYS_MOVE_MOUNT = 429 + SYS_FSOPEN = 430 + SYS_FSCONFIG = 431 + SYS_FSMOUNT = 432 + SYS_FSPICK = 433 + SYS_PIDFD_OPEN = 434 + SYS_CLONE3 = 435 + SYS_CLOSE_RANGE = 436 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 + SYS_FACCESSAT2 = 439 + SYS_PROCESS_MADVISE = 440 + SYS_EPOLL_PWAIT2 = 441 + SYS_MOUNT_SETATTR = 442 + SYS_QUOTACTL_FD = 443 + SYS_LANDLOCK_CREATE_RULESET = 444 + SYS_LANDLOCK_ADD_RULE = 445 + SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_PROCESS_MRELEASE = 448 + SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 +) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 3b0418e68..65a99efc2 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -430,4 +430,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 4446 SYS_PROCESS_MRELEASE = 4448 SYS_FUTEX_WAITV = 4449 + SYS_SET_MEMPOLICY_HOME_NODE = 4450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 314ebf166..841c8a668 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -360,4 +360,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 5446 SYS_PROCESS_MRELEASE = 5448 SYS_FUTEX_WAITV = 5449 + SYS_SET_MEMPOLICY_HOME_NODE = 5450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index b8fbb937a..e26a7c765 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -360,4 +360,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 5446 SYS_PROCESS_MRELEASE = 5448 SYS_FUTEX_WAITV = 5449 + SYS_SET_MEMPOLICY_HOME_NODE = 5450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index ee309b2ba..26447260a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -430,4 +430,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 4446 SYS_PROCESS_MRELEASE = 4448 SYS_FUTEX_WAITV = 4449 + SYS_SET_MEMPOLICY_HOME_NODE = 4450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index ac3748104..26aefc186 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -437,4 +437,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 5aa472111..8d4cd9d99 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -409,4 +409,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 0793ac1a6..3b405d1f8 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -409,4 +409,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index a520962e3..c3a5af862 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -311,4 +311,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index d1738586b..8ffa66469 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -374,4 +374,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index dfd5660f9..6a39640e7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -388,4 +388,5 @@ const ( SYS_LANDLOCK_RESTRICT_SELF = 446 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 + SYS_SET_MEMPOLICY_HOME_NODE = 450 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 2c26466e0..9962d26bb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -754,6 +754,25 @@ const ( AT_SYMLINK_NOFOLLOW = 0x100 AT_EACCESS = 0x200 + + OPEN_TREE_CLONE = 0x1 + + MOVE_MOUNT_F_SYMLINKS = 0x1 + MOVE_MOUNT_F_AUTOMOUNTS = 0x2 + MOVE_MOUNT_F_EMPTY_PATH = 0x4 + MOVE_MOUNT_T_SYMLINKS = 0x10 + MOVE_MOUNT_T_AUTOMOUNTS = 0x20 + MOVE_MOUNT_T_EMPTY_PATH = 0x40 + MOVE_MOUNT_SET_GROUP = 0x100 + + FSOPEN_CLOEXEC = 0x1 + + FSPICK_CLOEXEC = 0x1 + FSPICK_SYMLINK_NOFOLLOW = 0x2 + FSPICK_NO_AUTOMOUNT = 0x4 + FSPICK_EMPTY_PATH = 0x8 + + FSMOUNT_CLOEXEC = 0x1 ) type OpenHow struct { @@ -3619,7 +3638,7 @@ const ( ETHTOOL_A_RINGS_RX_MINI = 0x7 ETHTOOL_A_RINGS_RX_JUMBO = 0x8 ETHTOOL_A_RINGS_TX = 0x9 - ETHTOOL_A_RINGS_MAX = 0x9 + ETHTOOL_A_RINGS_MAX = 0xa ETHTOOL_A_CHANNELS_UNSPEC = 0x0 ETHTOOL_A_CHANNELS_HEADER = 0x1 ETHTOOL_A_CHANNELS_RX_MAX = 0x2 @@ -4304,7 +4323,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x133 + NL80211_ATTR_MAX = 0x135 NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_MATCH_SETS = 0x85 @@ -4645,7 +4664,7 @@ const ( NL80211_CMD_LEAVE_IBSS = 0x2c NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d - NL80211_CMD_MAX = 0x92 + NL80211_CMD_MAX = 0x93 NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_NAN_MATCH = 0x78 NL80211_CMD_NEW_BEACON = 0xf @@ -5532,3 +5551,40 @@ const ( NL80211_WPA_VERSION_2 = 0x2 NL80211_WPA_VERSION_3 = 0x4 ) + +const ( + FRA_UNSPEC = 0x0 + FRA_DST = 0x1 + FRA_SRC = 0x2 + FRA_IIFNAME = 0x3 + FRA_GOTO = 0x4 + FRA_UNUSED2 = 0x5 + FRA_PRIORITY = 0x6 + FRA_UNUSED3 = 0x7 + FRA_UNUSED4 = 0x8 + FRA_UNUSED5 = 0x9 + FRA_FWMARK = 0xa + FRA_FLOW = 0xb + FRA_TUN_ID = 0xc + FRA_SUPPRESS_IFGROUP = 0xd + FRA_SUPPRESS_PREFIXLEN = 0xe + FRA_TABLE = 0xf + FRA_FWMASK = 0x10 + FRA_OIFNAME = 0x11 + FRA_PAD = 0x12 + FRA_L3MDEV = 0x13 + FRA_UID_RANGE = 0x14 + FRA_PROTOCOL = 0x15 + FRA_IP_PROTO = 0x16 + FRA_SPORT_RANGE = 0x17 + FRA_DPORT_RANGE = 0x18 + FR_ACT_UNSPEC = 0x0 + FR_ACT_TO_TBL = 0x1 + FR_ACT_GOTO = 0x2 + FR_ACT_NOP = 0x3 + FR_ACT_RES3 = 0x4 + FR_ACT_RES4 = 0x5 + FR_ACT_BLACKHOLE = 0x6 + FR_ACT_UNREACHABLE = 0x7 + FR_ACT_PROHIBIT = 0x8 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index bea254945..531409256 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -240,6 +240,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -250,6 +254,13 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ [116]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -311,6 +322,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index b8c8f2894..b02ab83db 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -255,6 +255,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -265,6 +269,14 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -324,6 +336,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 4db443016..9e6871d2e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -231,6 +231,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -241,6 +245,13 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ [116]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -302,6 +313,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 3ebcad8a8..b732d1255 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -234,6 +234,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -244,6 +248,14 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -303,6 +315,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go new file mode 100644 index 000000000..61fbb24f8 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -0,0 +1,679 @@ +// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +//go:build loong64 && linux +// +build loong64,linux + +package unix + +const ( + SizeofPtr = 0x8 + SizeofLong = 0x8 +) + +type ( + _C_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type Timeval struct { + Sec int64 + Usec int64 +} + +type Timex struct { + Modes uint32 + Offset int64 + Freq int64 + Maxerror int64 + Esterror int64 + Status int32 + Constant int64 + Precision int64 + Tolerance int64 + Time Timeval + Tick int64 + Ppsfreq int64 + Jitter int64 + Shift int32 + Stabil int64 + Jitcnt int64 + Calcnt int64 + Errcnt int64 + Stbcnt int64 + Tai int32 + _ [44]byte +} + +type Time_t int64 + +type Tms struct { + Utime int64 + Stime int64 + Cutime int64 + Cstime int64 +} + +type Utimbuf struct { + Actime int64 + Modtime int64 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Stat_t struct { + Dev uint64 + Ino uint64 + Mode uint32 + Nlink uint32 + Uid uint32 + Gid uint32 + Rdev uint64 + _ uint64 + Size int64 + Blksize int32 + _ int32 + Blocks int64 + Atim Timespec + Mtim Timespec + Ctim Timespec + _ [2]int32 +} + +type Dirent struct { + Ino uint64 + Off int64 + Reclen uint16 + Type uint8 + Name [256]int8 + _ [5]byte +} + +type Flock_t struct { + Type int16 + Whence int16 + Start int64 + Len int64 + Pid int32 + _ [4]byte +} + +type DmNameList struct { + Dev uint64 + Next uint32 + Name [0]byte + _ [4]byte +} + +const ( + FADV_DONTNEED = 0x4 + FADV_NOREUSE = 0x5 +) + +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + +type RawSockaddr struct { + Family uint16 + Data [14]int8 +} + +type RawSockaddrAny struct { + Addr RawSockaddr + Pad [96]int8 +} + +type Iovec struct { + Base *byte + Len uint64 +} + +type Msghdr struct { + Name *byte + Namelen uint32 + Iov *Iovec + Iovlen uint64 + Control *byte + Controllen uint64 + Flags int32 + _ [4]byte +} + +type Cmsghdr struct { + Len uint64 + Level int32 + Type int32 +} + +type ifreq struct { + Ifrn [16]byte + Ifru [24]byte +} + +const ( + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 +) + +const ( + SizeofSockFprog = 0x10 +) + +type PtraceRegs struct { + Regs [32]uint64 + Orig_a0 uint64 + Era uint64 + Badv uint64 + Reserved [10]uint64 +} + +type FdSet struct { + Bits [16]int64 +} + +type Sysinfo_t struct { + Uptime int64 + Loads [3]uint64 + Totalram uint64 + Freeram uint64 + Sharedram uint64 + Bufferram uint64 + Totalswap uint64 + Freeswap uint64 + Procs uint16 + Pad uint16 + Totalhigh uint64 + Freehigh uint64 + Unit uint32 + _ [0]int8 + _ [4]byte +} + +type Ustat_t struct { + Tfree int32 + Tinode uint64 + Fname [6]int8 + Fpack [6]int8 + _ [4]byte +} + +type EpollEvent struct { + Events uint32 + _ int32 + Fd int32 + Pad int32 +} + +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + +const ( + POLLRDHUP = 0x2000 +) + +type Sigset_t struct { + Val [16]uint64 +} + +const _C__NSIG = 0x41 + +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Line uint8 + Cc [19]uint8 + Ispeed uint32 + Ospeed uint32 +} + +type Taskstats struct { + Version uint16 + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + _ [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 + Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 +} + +type cpuMask uint64 + +const ( + _NCPUBITS = 0x40 +) + +const ( + CBitFieldMaskBit0 = 0x1 + CBitFieldMaskBit1 = 0x2 + CBitFieldMaskBit2 = 0x4 + CBitFieldMaskBit3 = 0x8 + CBitFieldMaskBit4 = 0x10 + CBitFieldMaskBit5 = 0x20 + CBitFieldMaskBit6 = 0x40 + CBitFieldMaskBit7 = 0x80 + CBitFieldMaskBit8 = 0x100 + CBitFieldMaskBit9 = 0x200 + CBitFieldMaskBit10 = 0x400 + CBitFieldMaskBit11 = 0x800 + CBitFieldMaskBit12 = 0x1000 + CBitFieldMaskBit13 = 0x2000 + CBitFieldMaskBit14 = 0x4000 + CBitFieldMaskBit15 = 0x8000 + CBitFieldMaskBit16 = 0x10000 + CBitFieldMaskBit17 = 0x20000 + CBitFieldMaskBit18 = 0x40000 + CBitFieldMaskBit19 = 0x80000 + CBitFieldMaskBit20 = 0x100000 + CBitFieldMaskBit21 = 0x200000 + CBitFieldMaskBit22 = 0x400000 + CBitFieldMaskBit23 = 0x800000 + CBitFieldMaskBit24 = 0x1000000 + CBitFieldMaskBit25 = 0x2000000 + CBitFieldMaskBit26 = 0x4000000 + CBitFieldMaskBit27 = 0x8000000 + CBitFieldMaskBit28 = 0x10000000 + CBitFieldMaskBit29 = 0x20000000 + CBitFieldMaskBit30 = 0x40000000 + CBitFieldMaskBit31 = 0x80000000 + CBitFieldMaskBit32 = 0x100000000 + CBitFieldMaskBit33 = 0x200000000 + CBitFieldMaskBit34 = 0x400000000 + CBitFieldMaskBit35 = 0x800000000 + CBitFieldMaskBit36 = 0x1000000000 + CBitFieldMaskBit37 = 0x2000000000 + CBitFieldMaskBit38 = 0x4000000000 + CBitFieldMaskBit39 = 0x8000000000 + CBitFieldMaskBit40 = 0x10000000000 + CBitFieldMaskBit41 = 0x20000000000 + CBitFieldMaskBit42 = 0x40000000000 + CBitFieldMaskBit43 = 0x80000000000 + CBitFieldMaskBit44 = 0x100000000000 + CBitFieldMaskBit45 = 0x200000000000 + CBitFieldMaskBit46 = 0x400000000000 + CBitFieldMaskBit47 = 0x800000000000 + CBitFieldMaskBit48 = 0x1000000000000 + CBitFieldMaskBit49 = 0x2000000000000 + CBitFieldMaskBit50 = 0x4000000000000 + CBitFieldMaskBit51 = 0x8000000000000 + CBitFieldMaskBit52 = 0x10000000000000 + CBitFieldMaskBit53 = 0x20000000000000 + CBitFieldMaskBit54 = 0x40000000000000 + CBitFieldMaskBit55 = 0x80000000000000 + CBitFieldMaskBit56 = 0x100000000000000 + CBitFieldMaskBit57 = 0x200000000000000 + CBitFieldMaskBit58 = 0x400000000000000 + CBitFieldMaskBit59 = 0x800000000000000 + CBitFieldMaskBit60 = 0x1000000000000000 + CBitFieldMaskBit61 = 0x2000000000000000 + CBitFieldMaskBit62 = 0x4000000000000000 + CBitFieldMaskBit63 = 0x8000000000000000 +) + +type SockaddrStorage struct { + Family uint16 + _ [118]int8 + _ uint64 +} + +type HDGeometry struct { + Heads uint8 + Sectors uint8 + Cylinders uint16 + Start uint64 +} + +type Statfs_t struct { + Type int64 + Bsize int64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint64 + Ffree uint64 + Fsid Fsid + Namelen int64 + Frsize int64 + Flags int64 + Spare [4]int64 +} + +type TpacketHdr struct { + Status uint64 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Sec uint32 + Usec uint32 + _ [4]byte +} + +const ( + SizeofTpacketHdr = 0x20 +) + +type RTCPLLInfo struct { + Ctrl int32 + Value int32 + Max int32 + Min int32 + Posmult int32 + Negmult int32 + Clock int64 +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x1269 +) + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 + Flags uint32 + _ [4]byte +} + +type CryptoUserAlg struct { + Name [64]int8 + Driver_name [64]int8 + Module_name [64]int8 + Type uint32 + Mask uint32 + Refcnt uint32 + Flags uint32 +} + +type CryptoStatAEAD struct { + Type [64]int8 + Encrypt_cnt uint64 + Encrypt_tlen uint64 + Decrypt_cnt uint64 + Decrypt_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatAKCipher struct { + Type [64]int8 + Encrypt_cnt uint64 + Encrypt_tlen uint64 + Decrypt_cnt uint64 + Decrypt_tlen uint64 + Verify_cnt uint64 + Sign_cnt uint64 + Err_cnt uint64 +} + +type CryptoStatCipher struct { + Type [64]int8 + Encrypt_cnt uint64 + Encrypt_tlen uint64 + Decrypt_cnt uint64 + Decrypt_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatCompress struct { + Type [64]int8 + Compress_cnt uint64 + Compress_tlen uint64 + Decompress_cnt uint64 + Decompress_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatHash struct { + Type [64]int8 + Hash_cnt uint64 + Hash_tlen uint64 + Err_cnt uint64 +} + +type CryptoStatKPP struct { + Type [64]int8 + Setsecret_cnt uint64 + Generate_public_key_cnt uint64 + Compute_shared_secret_cnt uint64 + Err_cnt uint64 +} + +type CryptoStatRNG struct { + Type [64]int8 + Generate_cnt uint64 + Generate_tlen uint64 + Seed_cnt uint64 + Err_cnt uint64 +} + +type CryptoStatLarval struct { + Type [64]int8 +} + +type CryptoReportLarval struct { + Type [64]int8 +} + +type CryptoReportHash struct { + Type [64]int8 + Blocksize uint32 + Digestsize uint32 +} + +type CryptoReportCipher struct { + Type [64]int8 + Blocksize uint32 + Min_keysize uint32 + Max_keysize uint32 +} + +type CryptoReportBlkCipher struct { + Type [64]int8 + Geniv [64]int8 + Blocksize uint32 + Min_keysize uint32 + Max_keysize uint32 + Ivsize uint32 +} + +type CryptoReportAEAD struct { + Type [64]int8 + Geniv [64]int8 + Blocksize uint32 + Maxauthsize uint32 + Ivsize uint32 +} + +type CryptoReportComp struct { + Type [64]int8 +} + +type CryptoReportRNG struct { + Type [64]int8 + Seedsize uint32 +} + +type CryptoReportAKCipher struct { + Type [64]int8 +} + +type CryptoReportKPP struct { + Type [64]int8 +} + +type CryptoReportAcomp struct { + Type [64]int8 +} + +type LoopInfo struct { + Number int32 + Device uint32 + Inode uint64 + Rdevice uint32 + Offset int32 + Encrypt_type int32 + Encrypt_key_size int32 + Flags int32 + Name [64]int8 + Encrypt_key [32]uint8 + Init [2]uint64 + Reserved [4]int8 + _ [4]byte +} + +type TIPCSubscr struct { + Seq TIPCServiceRange + Timeout uint32 + Filter uint32 + Handle [8]int8 +} + +type TIPCSIOCLNReq struct { + Peer uint32 + Id uint32 + Linkname [68]int8 +} + +type TIPCSIOCNodeIDReq struct { + Peer uint32 + Id [16]int8 +} + +type PPSKInfo struct { + Assert_sequence uint32 + Clear_sequence uint32 + Assert_tu PPSKTime + Clear_tu PPSKTime + Current_mode int32 + _ [4]byte +} + +const ( + PPS_GETPARAMS = 0x800870a1 + PPS_SETPARAMS = 0x400870a2 + PPS_GETCAP = 0x800870a3 + PPS_FETCH = 0xc00870a4 +) + +const ( + PIDFD_NONBLOCK = 0x800 +) + +type SysvIpcPerm struct { + Key int32 + Uid uint32 + Gid uint32 + Cuid uint32 + Cgid uint32 + Mode uint32 + _ [0]uint8 + Seq uint16 + _ uint16 + _ uint64 + _ uint64 +} +type SysvShmDesc struct { + Perm SysvIpcPerm + Segsz uint64 + Atime int64 + Dtime int64 + Ctime int64 + Cpid int32 + Lpid int32 + Nattch uint64 + _ uint64 + _ uint64 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 3eb33e48a..5310f71ea 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -236,6 +236,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -246,6 +250,13 @@ type Sigset_t struct { const _C__NSIG = 0x80 +type Siginfo struct { + Signo int32 + Code int32 + Errno int32 + _ [116]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -307,6 +318,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 79a944672..219bbb126 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -237,6 +237,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -247,6 +251,14 @@ type Sigset_t struct { const _C__NSIG = 0x80 +type Siginfo struct { + Signo int32 + Code int32 + Errno int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -306,6 +318,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 8f4b107ca..be9432da5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -237,6 +237,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -247,6 +251,14 @@ type Sigset_t struct { const _C__NSIG = 0x80 +type Siginfo struct { + Signo int32 + Code int32 + Errno int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -306,6 +318,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index e4eb21798..d0155a42e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -236,6 +236,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -246,6 +250,13 @@ type Sigset_t struct { const _C__NSIG = 0x80 +type Siginfo struct { + Signo int32 + Code int32 + Errno int32 + _ [116]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -307,6 +318,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index d5b21f0f7..01c17bcc6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -243,6 +243,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -253,6 +257,13 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ [116]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -314,6 +325,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 5188d142b..944a9c3c7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -244,6 +244,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -254,6 +258,14 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -313,6 +325,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index de4dd4c73..5d2c90e1c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -244,6 +244,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -254,6 +258,14 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -313,6 +325,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index dccbf9b06..e173cb515 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -262,6 +262,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -272,6 +276,14 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -331,6 +343,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index c426c3576..6106715d5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -257,6 +257,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x80000 +) + const ( POLLRDHUP = 0x2000 ) @@ -267,6 +271,14 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -326,6 +338,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 765edc13f..ca7b37b4b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -239,6 +239,10 @@ type EpollEvent struct { Pad int32 } +const ( + OPEN_TREE_CLOEXEC = 0x400000 +) + const ( POLLRDHUP = 0x800 ) @@ -249,6 +253,14 @@ type Sigset_t struct { const _C__NSIG = 0x41 +type Siginfo struct { + Signo int32 + Errno int32 + Code int32 + _ int32 + _ [112]byte +} + type Termios struct { Iflag uint32 Oflag uint32 @@ -308,6 +320,8 @@ type Taskstats struct { Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 + Compact_count uint64 + Compact_delay_total uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/text/width/kind_string.go b/vendor/golang.org/x/text/width/kind_string.go deleted file mode 100644 index dd3febd43..000000000 --- a/vendor/golang.org/x/text/width/kind_string.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by "stringer -type=Kind"; DO NOT EDIT. - -package width - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[Neutral-0] - _ = x[EastAsianAmbiguous-1] - _ = x[EastAsianWide-2] - _ = x[EastAsianNarrow-3] - _ = x[EastAsianFullwidth-4] - _ = x[EastAsianHalfwidth-5] -} - -const _Kind_name = "NeutralEastAsianAmbiguousEastAsianWideEastAsianNarrowEastAsianFullwidthEastAsianHalfwidth" - -var _Kind_index = [...]uint8{0, 7, 25, 38, 53, 71, 89} - -func (i Kind) String() string { - if i < 0 || i >= Kind(len(_Kind_index)-1) { - return "Kind(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Kind_name[_Kind_index[i]:_Kind_index[i+1]] -} diff --git a/vendor/golang.org/x/text/width/tables10.0.0.go b/vendor/golang.org/x/text/width/tables10.0.0.go deleted file mode 100644 index 186b1d4ef..000000000 --- a/vendor/golang.org/x/text/width/tables10.0.0.go +++ /dev/null @@ -1,1319 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.10 && !go1.13 -// +build go1.10,!go1.13 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "10.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14336 bytes (14.00 KiB). Checksum: c59df54630d3dc4a. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 101 blocks, 6464 entries, 12928 bytes -// The third block is the zero block. -var widthValues = [6464]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, 0xdae: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf0d: 0x4000, 0xf0e: 0x4000, 0xf0f: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, 0xf47: 0x4000, 0xf48: 0x4000, 0xf49: 0x4000, 0xf4a: 0x4000, 0xf4b: 0x4000, - 0xf4c: 0x4000, 0xf50: 0x4000, 0xf51: 0x4000, - 0xf52: 0x4000, 0xf53: 0x4000, 0xf54: 0x4000, 0xf55: 0x4000, 0xf56: 0x4000, 0xf57: 0x4000, - 0xf58: 0x4000, 0xf59: 0x4000, 0xf5a: 0x4000, 0xf5b: 0x4000, 0xf5c: 0x4000, 0xf5d: 0x4000, - 0xf5e: 0x4000, 0xf5f: 0x4000, 0xf60: 0x4000, 0xf61: 0x4000, 0xf62: 0x4000, 0xf63: 0x4000, - 0xf64: 0x4000, 0xf65: 0x4000, 0xf66: 0x4000, 0xf67: 0x4000, 0xf68: 0x4000, 0xf69: 0x4000, - 0xf6a: 0x4000, 0xf6b: 0x4000, 0xf6c: 0x4000, 0xf6d: 0x4000, 0xf6e: 0x4000, 0xf6f: 0x4000, - 0xf70: 0x4000, 0xf71: 0x4000, 0xf72: 0x4000, 0xf73: 0x4000, 0xf74: 0x4000, 0xf75: 0x4000, - 0xf76: 0x4000, 0xf77: 0x4000, 0xf78: 0x4000, 0xf79: 0x4000, 0xf7a: 0x4000, 0xf7b: 0x4000, - 0xf7c: 0x4000, 0xf7d: 0x4000, 0xf7e: 0x4000, 0xf7f: 0x4000, - // Block 0x3e, offset 0xf80 - 0xf80: 0x4000, 0xf81: 0x4000, 0xf82: 0x4000, 0xf83: 0x4000, 0xf84: 0x4000, 0xf85: 0x4000, - 0xf86: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - 0xfe4: 0x4000, 0xfe5: 0x4000, 0xfe6: 0x4000, 0xfe7: 0x4000, 0xfe8: 0x4000, 0xfe9: 0x4000, - 0xfea: 0x4000, 0xfeb: 0x4000, 0xfec: 0x4000, 0xfed: 0x4000, 0xfee: 0x4000, 0xfef: 0x4000, - 0xff0: 0x4000, 0xff1: 0x4000, 0xff2: 0x4000, 0xff3: 0x4000, 0xff4: 0x4000, 0xff5: 0x4000, - 0xff6: 0x4000, 0xff7: 0x4000, 0xff8: 0x4000, 0xff9: 0x4000, 0xffa: 0x4000, 0xffb: 0x4000, - 0xffc: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x4000, 0x1001: 0x4000, 0x1002: 0x4000, 0x1003: 0x4000, 0x1004: 0x4000, 0x1005: 0x4000, - 0x1006: 0x4000, 0x1007: 0x4000, 0x1008: 0x4000, 0x1009: 0x4000, 0x100a: 0x4000, 0x100b: 0x4000, - 0x100c: 0x4000, 0x100d: 0x4000, 0x100e: 0x4000, 0x100f: 0x4000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, 0x101a: 0x4000, 0x101b: 0x4000, 0x101c: 0x4000, 0x101d: 0x4000, - 0x101e: 0x4000, 0x101f: 0x4000, 0x1020: 0x4000, 0x1021: 0x4000, 0x1022: 0x4000, 0x1023: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x2000, 0x1041: 0x2000, 0x1042: 0x2000, 0x1043: 0x2000, 0x1044: 0x2000, 0x1045: 0x2000, - 0x1046: 0x2000, 0x1047: 0x2000, 0x1048: 0x2000, 0x1049: 0x2000, 0x104a: 0x2000, 0x104b: 0x2000, - 0x104c: 0x2000, 0x104d: 0x2000, 0x104e: 0x2000, 0x104f: 0x2000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1053: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, - 0x1070: 0x4000, 0x1071: 0x4000, 0x1072: 0x4000, 0x1073: 0x4000, 0x1074: 0x4000, 0x1075: 0x4000, - 0x1076: 0x4000, 0x1077: 0x4000, 0x1078: 0x4000, 0x1079: 0x4000, 0x107a: 0x4000, 0x107b: 0x4000, - 0x107c: 0x4000, 0x107d: 0x4000, 0x107e: 0x4000, 0x107f: 0x4000, - // Block 0x42, offset 0x1080 - 0x1080: 0x4000, 0x1081: 0x4000, 0x1082: 0x4000, 0x1083: 0x4000, 0x1084: 0x4000, 0x1085: 0x4000, - 0x1086: 0x4000, 0x1087: 0x4000, 0x1088: 0x4000, 0x1089: 0x4000, 0x108a: 0x4000, 0x108b: 0x4000, - 0x108c: 0x4000, 0x108d: 0x4000, 0x108e: 0x4000, 0x108f: 0x4000, 0x1090: 0x4000, 0x1091: 0x4000, - 0x1092: 0x4000, 0x1094: 0x4000, 0x1095: 0x4000, 0x1096: 0x4000, 0x1097: 0x4000, - 0x1098: 0x4000, 0x1099: 0x4000, 0x109a: 0x4000, 0x109b: 0x4000, 0x109c: 0x4000, 0x109d: 0x4000, - 0x109e: 0x4000, 0x109f: 0x4000, 0x10a0: 0x4000, 0x10a1: 0x4000, 0x10a2: 0x4000, 0x10a3: 0x4000, - 0x10a4: 0x4000, 0x10a5: 0x4000, 0x10a6: 0x4000, 0x10a8: 0x4000, 0x10a9: 0x4000, - 0x10aa: 0x4000, 0x10ab: 0x4000, - // Block 0x43, offset 0x10c0 - 0x10c1: 0x9012, 0x10c2: 0x9012, 0x10c3: 0x9012, 0x10c4: 0x9012, 0x10c5: 0x9012, - 0x10c6: 0x9012, 0x10c7: 0x9012, 0x10c8: 0x9012, 0x10c9: 0x9012, 0x10ca: 0x9012, 0x10cb: 0x9012, - 0x10cc: 0x9012, 0x10cd: 0x9012, 0x10ce: 0x9012, 0x10cf: 0x9012, 0x10d0: 0x9012, 0x10d1: 0x9012, - 0x10d2: 0x9012, 0x10d3: 0x9012, 0x10d4: 0x9012, 0x10d5: 0x9012, 0x10d6: 0x9012, 0x10d7: 0x9012, - 0x10d8: 0x9012, 0x10d9: 0x9012, 0x10da: 0x9012, 0x10db: 0x9012, 0x10dc: 0x9012, 0x10dd: 0x9012, - 0x10de: 0x9012, 0x10df: 0x9012, 0x10e0: 0x9049, 0x10e1: 0x9049, 0x10e2: 0x9049, 0x10e3: 0x9049, - 0x10e4: 0x9049, 0x10e5: 0x9049, 0x10e6: 0x9049, 0x10e7: 0x9049, 0x10e8: 0x9049, 0x10e9: 0x9049, - 0x10ea: 0x9049, 0x10eb: 0x9049, 0x10ec: 0x9049, 0x10ed: 0x9049, 0x10ee: 0x9049, 0x10ef: 0x9049, - 0x10f0: 0x9049, 0x10f1: 0x9049, 0x10f2: 0x9049, 0x10f3: 0x9049, 0x10f4: 0x9049, 0x10f5: 0x9049, - 0x10f6: 0x9049, 0x10f7: 0x9049, 0x10f8: 0x9049, 0x10f9: 0x9049, 0x10fa: 0x9049, 0x10fb: 0x9049, - 0x10fc: 0x9049, 0x10fd: 0x9049, 0x10fe: 0x9049, 0x10ff: 0x9049, - // Block 0x44, offset 0x1100 - 0x1100: 0x9049, 0x1101: 0x9049, 0x1102: 0x9049, 0x1103: 0x9049, 0x1104: 0x9049, 0x1105: 0x9049, - 0x1106: 0x9049, 0x1107: 0x9049, 0x1108: 0x9049, 0x1109: 0x9049, 0x110a: 0x9049, 0x110b: 0x9049, - 0x110c: 0x9049, 0x110d: 0x9049, 0x110e: 0x9049, 0x110f: 0x9049, 0x1110: 0x9049, 0x1111: 0x9049, - 0x1112: 0x9049, 0x1113: 0x9049, 0x1114: 0x9049, 0x1115: 0x9049, 0x1116: 0x9049, 0x1117: 0x9049, - 0x1118: 0x9049, 0x1119: 0x9049, 0x111a: 0x9049, 0x111b: 0x9049, 0x111c: 0x9049, 0x111d: 0x9049, - 0x111e: 0x9049, 0x111f: 0x904a, 0x1120: 0x904b, 0x1121: 0xb04c, 0x1122: 0xb04d, 0x1123: 0xb04d, - 0x1124: 0xb04e, 0x1125: 0xb04f, 0x1126: 0xb050, 0x1127: 0xb051, 0x1128: 0xb052, 0x1129: 0xb053, - 0x112a: 0xb054, 0x112b: 0xb055, 0x112c: 0xb056, 0x112d: 0xb057, 0x112e: 0xb058, 0x112f: 0xb059, - 0x1130: 0xb05a, 0x1131: 0xb05b, 0x1132: 0xb05c, 0x1133: 0xb05d, 0x1134: 0xb05e, 0x1135: 0xb05f, - 0x1136: 0xb060, 0x1137: 0xb061, 0x1138: 0xb062, 0x1139: 0xb063, 0x113a: 0xb064, 0x113b: 0xb065, - 0x113c: 0xb052, 0x113d: 0xb066, 0x113e: 0xb067, 0x113f: 0xb055, - // Block 0x45, offset 0x1140 - 0x1140: 0xb068, 0x1141: 0xb069, 0x1142: 0xb06a, 0x1143: 0xb06b, 0x1144: 0xb05a, 0x1145: 0xb056, - 0x1146: 0xb06c, 0x1147: 0xb06d, 0x1148: 0xb06b, 0x1149: 0xb06e, 0x114a: 0xb06b, 0x114b: 0xb06f, - 0x114c: 0xb06f, 0x114d: 0xb070, 0x114e: 0xb070, 0x114f: 0xb071, 0x1150: 0xb056, 0x1151: 0xb072, - 0x1152: 0xb073, 0x1153: 0xb072, 0x1154: 0xb074, 0x1155: 0xb073, 0x1156: 0xb075, 0x1157: 0xb075, - 0x1158: 0xb076, 0x1159: 0xb076, 0x115a: 0xb077, 0x115b: 0xb077, 0x115c: 0xb073, 0x115d: 0xb078, - 0x115e: 0xb079, 0x115f: 0xb067, 0x1160: 0xb07a, 0x1161: 0xb07b, 0x1162: 0xb07b, 0x1163: 0xb07b, - 0x1164: 0xb07b, 0x1165: 0xb07b, 0x1166: 0xb07b, 0x1167: 0xb07b, 0x1168: 0xb07b, 0x1169: 0xb07b, - 0x116a: 0xb07b, 0x116b: 0xb07b, 0x116c: 0xb07b, 0x116d: 0xb07b, 0x116e: 0xb07b, 0x116f: 0xb07b, - 0x1170: 0xb07c, 0x1171: 0xb07c, 0x1172: 0xb07c, 0x1173: 0xb07c, 0x1174: 0xb07c, 0x1175: 0xb07c, - 0x1176: 0xb07c, 0x1177: 0xb07c, 0x1178: 0xb07c, 0x1179: 0xb07c, 0x117a: 0xb07c, 0x117b: 0xb07c, - 0x117c: 0xb07c, 0x117d: 0xb07c, 0x117e: 0xb07c, - // Block 0x46, offset 0x1180 - 0x1182: 0xb07d, 0x1183: 0xb07e, 0x1184: 0xb07f, 0x1185: 0xb080, - 0x1186: 0xb07f, 0x1187: 0xb07e, 0x118a: 0xb081, 0x118b: 0xb082, - 0x118c: 0xb083, 0x118d: 0xb07f, 0x118e: 0xb080, 0x118f: 0xb07f, - 0x1192: 0xb084, 0x1193: 0xb085, 0x1194: 0xb084, 0x1195: 0xb086, 0x1196: 0xb084, 0x1197: 0xb087, - 0x119a: 0xb088, 0x119b: 0xb089, 0x119c: 0xb08a, - 0x11a0: 0x908b, 0x11a1: 0x908b, 0x11a2: 0x908c, 0x11a3: 0x908d, - 0x11a4: 0x908b, 0x11a5: 0x908e, 0x11a6: 0x908f, 0x11a8: 0xb090, 0x11a9: 0xb091, - 0x11aa: 0xb092, 0x11ab: 0xb091, 0x11ac: 0xb093, 0x11ad: 0xb094, 0x11ae: 0xb095, - 0x11bd: 0x2000, - // Block 0x47, offset 0x11c0 - 0x11e0: 0x4000, 0x11e1: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, 0x1216: 0x4000, 0x1217: 0x4000, - 0x1218: 0x4000, 0x1219: 0x4000, 0x121a: 0x4000, 0x121b: 0x4000, 0x121c: 0x4000, 0x121d: 0x4000, - 0x121e: 0x4000, 0x121f: 0x4000, 0x1220: 0x4000, 0x1221: 0x4000, 0x1222: 0x4000, 0x1223: 0x4000, - 0x1224: 0x4000, 0x1225: 0x4000, 0x1226: 0x4000, 0x1227: 0x4000, 0x1228: 0x4000, 0x1229: 0x4000, - 0x122a: 0x4000, 0x122b: 0x4000, 0x122c: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, 0x1249: 0x4000, 0x124a: 0x4000, 0x124b: 0x4000, - 0x124c: 0x4000, 0x124d: 0x4000, 0x124e: 0x4000, 0x124f: 0x4000, 0x1250: 0x4000, 0x1251: 0x4000, - 0x1252: 0x4000, 0x1253: 0x4000, 0x1254: 0x4000, 0x1255: 0x4000, 0x1256: 0x4000, 0x1257: 0x4000, - 0x1258: 0x4000, 0x1259: 0x4000, 0x125a: 0x4000, 0x125b: 0x4000, 0x125c: 0x4000, 0x125d: 0x4000, - 0x125e: 0x4000, 0x125f: 0x4000, 0x1260: 0x4000, 0x1261: 0x4000, 0x1262: 0x4000, 0x1263: 0x4000, - 0x1264: 0x4000, 0x1265: 0x4000, 0x1266: 0x4000, 0x1267: 0x4000, 0x1268: 0x4000, 0x1269: 0x4000, - 0x126a: 0x4000, 0x126b: 0x4000, 0x126c: 0x4000, 0x126d: 0x4000, 0x126e: 0x4000, 0x126f: 0x4000, - 0x1270: 0x4000, 0x1271: 0x4000, 0x1272: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, 0x1282: 0x4000, 0x1283: 0x4000, 0x1284: 0x4000, 0x1285: 0x4000, - 0x1286: 0x4000, 0x1287: 0x4000, 0x1288: 0x4000, 0x1289: 0x4000, 0x128a: 0x4000, 0x128b: 0x4000, - 0x128c: 0x4000, 0x128d: 0x4000, 0x128e: 0x4000, 0x128f: 0x4000, 0x1290: 0x4000, 0x1291: 0x4000, - 0x1292: 0x4000, 0x1293: 0x4000, 0x1294: 0x4000, 0x1295: 0x4000, 0x1296: 0x4000, 0x1297: 0x4000, - 0x1298: 0x4000, 0x1299: 0x4000, 0x129a: 0x4000, 0x129b: 0x4000, 0x129c: 0x4000, 0x129d: 0x4000, - 0x129e: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12f0: 0x4000, 0x12f1: 0x4000, 0x12f2: 0x4000, 0x12f3: 0x4000, 0x12f4: 0x4000, 0x12f5: 0x4000, - 0x12f6: 0x4000, 0x12f7: 0x4000, 0x12f8: 0x4000, 0x12f9: 0x4000, 0x12fa: 0x4000, 0x12fb: 0x4000, - 0x12fc: 0x4000, 0x12fd: 0x4000, 0x12fe: 0x4000, 0x12ff: 0x4000, - // Block 0x4c, offset 0x1300 - 0x1300: 0x4000, 0x1301: 0x4000, 0x1302: 0x4000, 0x1303: 0x4000, 0x1304: 0x4000, 0x1305: 0x4000, - 0x1306: 0x4000, 0x1307: 0x4000, 0x1308: 0x4000, 0x1309: 0x4000, 0x130a: 0x4000, 0x130b: 0x4000, - 0x130c: 0x4000, 0x130d: 0x4000, 0x130e: 0x4000, 0x130f: 0x4000, 0x1310: 0x4000, 0x1311: 0x4000, - 0x1312: 0x4000, 0x1313: 0x4000, 0x1314: 0x4000, 0x1315: 0x4000, 0x1316: 0x4000, 0x1317: 0x4000, - 0x1318: 0x4000, 0x1319: 0x4000, 0x131a: 0x4000, 0x131b: 0x4000, 0x131c: 0x4000, 0x131d: 0x4000, - 0x131e: 0x4000, 0x131f: 0x4000, 0x1320: 0x4000, 0x1321: 0x4000, 0x1322: 0x4000, 0x1323: 0x4000, - 0x1324: 0x4000, 0x1325: 0x4000, 0x1326: 0x4000, 0x1327: 0x4000, 0x1328: 0x4000, 0x1329: 0x4000, - 0x132a: 0x4000, 0x132b: 0x4000, 0x132c: 0x4000, 0x132d: 0x4000, 0x132e: 0x4000, 0x132f: 0x4000, - 0x1330: 0x4000, 0x1331: 0x4000, 0x1332: 0x4000, 0x1333: 0x4000, 0x1334: 0x4000, 0x1335: 0x4000, - 0x1336: 0x4000, 0x1337: 0x4000, 0x1338: 0x4000, 0x1339: 0x4000, 0x133a: 0x4000, 0x133b: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1344: 0x4000, - // Block 0x4e, offset 0x1380 - 0x138f: 0x4000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, - 0x13d0: 0x2000, 0x13d1: 0x2000, - 0x13d2: 0x2000, 0x13d3: 0x2000, 0x13d4: 0x2000, 0x13d5: 0x2000, 0x13d6: 0x2000, 0x13d7: 0x2000, - 0x13d8: 0x2000, 0x13d9: 0x2000, 0x13da: 0x2000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, 0x13ed: 0x2000, - 0x13f0: 0x2000, 0x13f1: 0x2000, 0x13f2: 0x2000, 0x13f3: 0x2000, 0x13f4: 0x2000, 0x13f5: 0x2000, - 0x13f6: 0x2000, 0x13f7: 0x2000, 0x13f8: 0x2000, 0x13f9: 0x2000, 0x13fa: 0x2000, 0x13fb: 0x2000, - 0x13fc: 0x2000, 0x13fd: 0x2000, 0x13fe: 0x2000, 0x13ff: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x2000, 0x1401: 0x2000, 0x1402: 0x2000, 0x1403: 0x2000, 0x1404: 0x2000, 0x1405: 0x2000, - 0x1406: 0x2000, 0x1407: 0x2000, 0x1408: 0x2000, 0x1409: 0x2000, 0x140a: 0x2000, 0x140b: 0x2000, - 0x140c: 0x2000, 0x140d: 0x2000, 0x140e: 0x2000, 0x140f: 0x2000, 0x1410: 0x2000, 0x1411: 0x2000, - 0x1412: 0x2000, 0x1413: 0x2000, 0x1414: 0x2000, 0x1415: 0x2000, 0x1416: 0x2000, 0x1417: 0x2000, - 0x1418: 0x2000, 0x1419: 0x2000, 0x141a: 0x2000, 0x141b: 0x2000, 0x141c: 0x2000, 0x141d: 0x2000, - 0x141e: 0x2000, 0x141f: 0x2000, 0x1420: 0x2000, 0x1421: 0x2000, 0x1422: 0x2000, 0x1423: 0x2000, - 0x1424: 0x2000, 0x1425: 0x2000, 0x1426: 0x2000, 0x1427: 0x2000, 0x1428: 0x2000, 0x1429: 0x2000, - 0x1430: 0x2000, 0x1431: 0x2000, 0x1432: 0x2000, 0x1433: 0x2000, 0x1434: 0x2000, 0x1435: 0x2000, - 0x1436: 0x2000, 0x1437: 0x2000, 0x1438: 0x2000, 0x1439: 0x2000, 0x143a: 0x2000, 0x143b: 0x2000, - 0x143c: 0x2000, 0x143d: 0x2000, 0x143e: 0x2000, 0x143f: 0x2000, - // Block 0x51, offset 0x1440 - 0x1440: 0x2000, 0x1441: 0x2000, 0x1442: 0x2000, 0x1443: 0x2000, 0x1444: 0x2000, 0x1445: 0x2000, - 0x1446: 0x2000, 0x1447: 0x2000, 0x1448: 0x2000, 0x1449: 0x2000, 0x144a: 0x2000, 0x144b: 0x2000, - 0x144c: 0x2000, 0x144d: 0x2000, 0x144e: 0x4000, 0x144f: 0x2000, 0x1450: 0x2000, 0x1451: 0x4000, - 0x1452: 0x4000, 0x1453: 0x4000, 0x1454: 0x4000, 0x1455: 0x4000, 0x1456: 0x4000, 0x1457: 0x4000, - 0x1458: 0x4000, 0x1459: 0x4000, 0x145a: 0x4000, 0x145b: 0x2000, 0x145c: 0x2000, 0x145d: 0x2000, - 0x145e: 0x2000, 0x145f: 0x2000, 0x1460: 0x2000, 0x1461: 0x2000, 0x1462: 0x2000, 0x1463: 0x2000, - 0x1464: 0x2000, 0x1465: 0x2000, 0x1466: 0x2000, 0x1467: 0x2000, 0x1468: 0x2000, 0x1469: 0x2000, - 0x146a: 0x2000, 0x146b: 0x2000, 0x146c: 0x2000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, - 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, 0x14a1: 0x4000, 0x14a2: 0x4000, 0x14a3: 0x4000, - 0x14a4: 0x4000, 0x14a5: 0x4000, 0x14a6: 0x4000, 0x14a7: 0x4000, 0x14a8: 0x4000, 0x14a9: 0x4000, - 0x14aa: 0x4000, 0x14ab: 0x4000, 0x14ac: 0x4000, 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b6: 0x4000, 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, - 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, 0x1514: 0x4000, 0x1515: 0x4000, 0x1516: 0x4000, 0x1517: 0x4000, - 0x1518: 0x4000, 0x1519: 0x4000, 0x151a: 0x4000, 0x151b: 0x4000, 0x151c: 0x4000, 0x151d: 0x4000, - 0x151e: 0x4000, 0x151f: 0x4000, 0x1520: 0x4000, - 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, 0x154b: 0x4000, - 0x154c: 0x4000, 0x154d: 0x4000, 0x154e: 0x4000, 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, 0x1554: 0x4000, 0x1555: 0x4000, 0x1556: 0x4000, 0x1557: 0x4000, - 0x1558: 0x4000, 0x1559: 0x4000, 0x155a: 0x4000, 0x155b: 0x4000, 0x155c: 0x4000, 0x155d: 0x4000, - 0x155e: 0x4000, 0x155f: 0x4000, 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1571: 0x4000, 0x1572: 0x4000, 0x1573: 0x4000, 0x1574: 0x4000, 0x1575: 0x4000, - 0x1576: 0x4000, 0x1577: 0x4000, 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1581: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, - 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, - 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, - 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f4: 0x4000, - 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15fd: 0x4000, 0x15fe: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, 0x163e: 0x4000, 0x163f: 0x4000, - // Block 0x59, offset 0x1640 - 0x1640: 0x4000, 0x1641: 0x4000, 0x1642: 0x4000, 0x1643: 0x4000, 0x1644: 0x4000, 0x1645: 0x4000, - 0x1646: 0x4000, 0x1647: 0x4000, 0x1648: 0x4000, 0x1649: 0x4000, 0x164a: 0x4000, 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x164f: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, 0x1668: 0x4000, 0x1669: 0x4000, - 0x166a: 0x4000, 0x166b: 0x4000, 0x166c: 0x4000, 0x166d: 0x4000, 0x166e: 0x4000, 0x166f: 0x4000, - 0x1670: 0x4000, 0x1671: 0x4000, 0x1672: 0x4000, 0x1673: 0x4000, 0x1674: 0x4000, 0x1675: 0x4000, - 0x1676: 0x4000, 0x1677: 0x4000, 0x1678: 0x4000, 0x1679: 0x4000, 0x167a: 0x4000, 0x167b: 0x4000, - 0x167c: 0x4000, 0x167f: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1680: 0x4000, 0x1681: 0x4000, 0x1682: 0x4000, 0x1683: 0x4000, 0x1684: 0x4000, 0x1685: 0x4000, - 0x1686: 0x4000, 0x1687: 0x4000, 0x1688: 0x4000, 0x1689: 0x4000, 0x168a: 0x4000, 0x168b: 0x4000, - 0x168c: 0x4000, 0x168d: 0x4000, 0x168e: 0x4000, 0x168f: 0x4000, 0x1690: 0x4000, 0x1691: 0x4000, - 0x1692: 0x4000, 0x1693: 0x4000, 0x1694: 0x4000, 0x1695: 0x4000, 0x1696: 0x4000, 0x1697: 0x4000, - 0x1698: 0x4000, 0x1699: 0x4000, 0x169a: 0x4000, 0x169b: 0x4000, 0x169c: 0x4000, 0x169d: 0x4000, - 0x169e: 0x4000, 0x169f: 0x4000, 0x16a0: 0x4000, 0x16a1: 0x4000, 0x16a2: 0x4000, 0x16a3: 0x4000, - 0x16a4: 0x4000, 0x16a5: 0x4000, 0x16a6: 0x4000, 0x16a7: 0x4000, 0x16a8: 0x4000, 0x16a9: 0x4000, - 0x16aa: 0x4000, 0x16ab: 0x4000, 0x16ac: 0x4000, 0x16ad: 0x4000, 0x16ae: 0x4000, 0x16af: 0x4000, - 0x16b0: 0x4000, 0x16b1: 0x4000, 0x16b2: 0x4000, 0x16b3: 0x4000, 0x16b4: 0x4000, 0x16b5: 0x4000, - 0x16b6: 0x4000, 0x16b7: 0x4000, 0x16b8: 0x4000, 0x16b9: 0x4000, 0x16ba: 0x4000, 0x16bb: 0x4000, - 0x16bc: 0x4000, 0x16bd: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16d0: 0x4000, 0x16d1: 0x4000, - 0x16d2: 0x4000, 0x16d3: 0x4000, 0x16d4: 0x4000, 0x16d5: 0x4000, 0x16d6: 0x4000, 0x16d7: 0x4000, - 0x16d8: 0x4000, 0x16d9: 0x4000, 0x16da: 0x4000, 0x16db: 0x4000, 0x16dc: 0x4000, 0x16dd: 0x4000, - 0x16de: 0x4000, 0x16df: 0x4000, 0x16e0: 0x4000, 0x16e1: 0x4000, 0x16e2: 0x4000, 0x16e3: 0x4000, - 0x16e4: 0x4000, 0x16e5: 0x4000, 0x16e6: 0x4000, 0x16e7: 0x4000, - 0x16fa: 0x4000, - // Block 0x5c, offset 0x1700 - 0x1715: 0x4000, 0x1716: 0x4000, - 0x1724: 0x4000, - // Block 0x5d, offset 0x1740 - 0x177b: 0x4000, - 0x177c: 0x4000, 0x177d: 0x4000, 0x177e: 0x4000, 0x177f: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1780: 0x4000, 0x1781: 0x4000, 0x1782: 0x4000, 0x1783: 0x4000, 0x1784: 0x4000, 0x1785: 0x4000, - 0x1786: 0x4000, 0x1787: 0x4000, 0x1788: 0x4000, 0x1789: 0x4000, 0x178a: 0x4000, 0x178b: 0x4000, - 0x178c: 0x4000, 0x178d: 0x4000, 0x178e: 0x4000, 0x178f: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17cc: 0x4000, 0x17d0: 0x4000, 0x17d1: 0x4000, - 0x17d2: 0x4000, - 0x17eb: 0x4000, 0x17ec: 0x4000, - 0x17f4: 0x4000, 0x17f5: 0x4000, - 0x17f6: 0x4000, 0x17f7: 0x4000, 0x17f8: 0x4000, - // Block 0x60, offset 0x1800 - 0x1810: 0x4000, 0x1811: 0x4000, - 0x1812: 0x4000, 0x1813: 0x4000, 0x1814: 0x4000, 0x1815: 0x4000, 0x1816: 0x4000, 0x1817: 0x4000, - 0x1818: 0x4000, 0x1819: 0x4000, 0x181a: 0x4000, 0x181b: 0x4000, 0x181c: 0x4000, 0x181d: 0x4000, - 0x181e: 0x4000, 0x181f: 0x4000, 0x1820: 0x4000, 0x1821: 0x4000, 0x1822: 0x4000, 0x1823: 0x4000, - 0x1824: 0x4000, 0x1825: 0x4000, 0x1826: 0x4000, 0x1827: 0x4000, 0x1828: 0x4000, 0x1829: 0x4000, - 0x182a: 0x4000, 0x182b: 0x4000, 0x182c: 0x4000, 0x182d: 0x4000, 0x182e: 0x4000, 0x182f: 0x4000, - 0x1830: 0x4000, 0x1831: 0x4000, 0x1832: 0x4000, 0x1833: 0x4000, 0x1834: 0x4000, 0x1835: 0x4000, - 0x1836: 0x4000, 0x1837: 0x4000, 0x1838: 0x4000, 0x1839: 0x4000, 0x183a: 0x4000, 0x183b: 0x4000, - 0x183c: 0x4000, 0x183d: 0x4000, 0x183e: 0x4000, - // Block 0x61, offset 0x1840 - 0x1840: 0x4000, 0x1841: 0x4000, 0x1842: 0x4000, 0x1843: 0x4000, 0x1844: 0x4000, 0x1845: 0x4000, - 0x1846: 0x4000, 0x1847: 0x4000, 0x1848: 0x4000, 0x1849: 0x4000, 0x184a: 0x4000, 0x184b: 0x4000, - 0x184c: 0x4000, 0x1850: 0x4000, 0x1851: 0x4000, - 0x1852: 0x4000, 0x1853: 0x4000, 0x1854: 0x4000, 0x1855: 0x4000, 0x1856: 0x4000, 0x1857: 0x4000, - 0x1858: 0x4000, 0x1859: 0x4000, 0x185a: 0x4000, 0x185b: 0x4000, 0x185c: 0x4000, 0x185d: 0x4000, - 0x185e: 0x4000, 0x185f: 0x4000, 0x1860: 0x4000, 0x1861: 0x4000, 0x1862: 0x4000, 0x1863: 0x4000, - 0x1864: 0x4000, 0x1865: 0x4000, 0x1866: 0x4000, 0x1867: 0x4000, 0x1868: 0x4000, 0x1869: 0x4000, - 0x186a: 0x4000, 0x186b: 0x4000, - // Block 0x62, offset 0x1880 - 0x1880: 0x4000, 0x1881: 0x4000, 0x1882: 0x4000, 0x1883: 0x4000, 0x1884: 0x4000, 0x1885: 0x4000, - 0x1886: 0x4000, 0x1887: 0x4000, 0x1888: 0x4000, 0x1889: 0x4000, 0x188a: 0x4000, 0x188b: 0x4000, - 0x188c: 0x4000, 0x188d: 0x4000, 0x188e: 0x4000, 0x188f: 0x4000, 0x1890: 0x4000, 0x1891: 0x4000, - 0x1892: 0x4000, 0x1893: 0x4000, 0x1894: 0x4000, 0x1895: 0x4000, 0x1896: 0x4000, 0x1897: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, - 0x18d0: 0x4000, 0x18d1: 0x4000, - 0x18d2: 0x4000, 0x18d3: 0x4000, 0x18d4: 0x4000, 0x18d5: 0x4000, 0x18d6: 0x4000, 0x18d7: 0x4000, - 0x18d8: 0x4000, 0x18d9: 0x4000, 0x18da: 0x4000, 0x18db: 0x4000, 0x18dc: 0x4000, 0x18dd: 0x4000, - 0x18de: 0x4000, 0x18df: 0x4000, 0x18e0: 0x4000, 0x18e1: 0x4000, 0x18e2: 0x4000, 0x18e3: 0x4000, - 0x18e4: 0x4000, 0x18e5: 0x4000, 0x18e6: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x2000, 0x1901: 0x2000, 0x1902: 0x2000, 0x1903: 0x2000, 0x1904: 0x2000, 0x1905: 0x2000, - 0x1906: 0x2000, 0x1907: 0x2000, 0x1908: 0x2000, 0x1909: 0x2000, 0x190a: 0x2000, 0x190b: 0x2000, - 0x190c: 0x2000, 0x190d: 0x2000, 0x190e: 0x2000, 0x190f: 0x2000, 0x1910: 0x2000, 0x1911: 0x2000, - 0x1912: 0x2000, 0x1913: 0x2000, 0x1914: 0x2000, 0x1915: 0x2000, 0x1916: 0x2000, 0x1917: 0x2000, - 0x1918: 0x2000, 0x1919: 0x2000, 0x191a: 0x2000, 0x191b: 0x2000, 0x191c: 0x2000, 0x191d: 0x2000, - 0x191e: 0x2000, 0x191f: 0x2000, 0x1920: 0x2000, 0x1921: 0x2000, 0x1922: 0x2000, 0x1923: 0x2000, - 0x1924: 0x2000, 0x1925: 0x2000, 0x1926: 0x2000, 0x1927: 0x2000, 0x1928: 0x2000, 0x1929: 0x2000, - 0x192a: 0x2000, 0x192b: 0x2000, 0x192c: 0x2000, 0x192d: 0x2000, 0x192e: 0x2000, 0x192f: 0x2000, - 0x1930: 0x2000, 0x1931: 0x2000, 0x1932: 0x2000, 0x1933: 0x2000, 0x1934: 0x2000, 0x1935: 0x2000, - 0x1936: 0x2000, 0x1937: 0x2000, 0x1938: 0x2000, 0x1939: 0x2000, 0x193a: 0x2000, 0x193b: 0x2000, - 0x193c: 0x2000, 0x193d: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x3a, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3b, 0x253: 0x3c, - 0x265: 0x3d, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3e, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3f, 0x339: 0x40, 0x33c: 0x41, 0x33d: 0x42, 0x33e: 0x43, 0x33f: 0x44, - // Block 0xd, offset 0x340 - 0x37f: 0x45, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x46, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x0e, 0x3c1: 0x0e, 0x3c2: 0x0e, 0x3c3: 0x0e, 0x3c4: 0x48, 0x3c5: 0x49, 0x3c6: 0x0e, 0x3c7: 0x0e, - 0x3c8: 0x0e, 0x3c9: 0x0e, 0x3ca: 0x0e, 0x3cb: 0x4a, - // Block 0x10, offset 0x400 - 0x400: 0x4b, 0x403: 0x4c, 0x404: 0x4d, 0x405: 0x4e, 0x406: 0x4f, - 0x408: 0x50, 0x409: 0x51, 0x40c: 0x52, 0x40d: 0x53, 0x40e: 0x54, 0x40f: 0x55, - 0x410: 0x3a, 0x411: 0x56, 0x412: 0x0e, 0x413: 0x57, 0x414: 0x58, 0x415: 0x59, 0x416: 0x5a, 0x417: 0x5b, - 0x418: 0x0e, 0x419: 0x5c, 0x41a: 0x0e, 0x41b: 0x5d, - 0x424: 0x5e, 0x425: 0x5f, 0x426: 0x60, 0x427: 0x61, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x62, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 14936 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/tables11.0.0.go b/vendor/golang.org/x/text/width/tables11.0.0.go deleted file mode 100644 index 990f7622f..000000000 --- a/vendor/golang.org/x/text/width/tables11.0.0.go +++ /dev/null @@ -1,1331 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.13 && !go1.14 -// +build go1.13,!go1.14 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "11.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14336 bytes (14.00 KiB). Checksum: c0f7712776e71cd4. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 101 blocks, 6464 entries, 12928 bytes -// The third block is the zero block. -var widthValues = [6464]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, 0xdae: 0x4000, 0xdaf: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf0d: 0x4000, 0xf0e: 0x4000, 0xf0f: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, 0xf47: 0x4000, 0xf48: 0x4000, 0xf49: 0x4000, 0xf4a: 0x4000, 0xf4b: 0x4000, - 0xf4c: 0x4000, 0xf50: 0x4000, 0xf51: 0x4000, - 0xf52: 0x4000, 0xf53: 0x4000, 0xf54: 0x4000, 0xf55: 0x4000, 0xf56: 0x4000, 0xf57: 0x4000, - 0xf58: 0x4000, 0xf59: 0x4000, 0xf5a: 0x4000, 0xf5b: 0x4000, 0xf5c: 0x4000, 0xf5d: 0x4000, - 0xf5e: 0x4000, 0xf5f: 0x4000, 0xf60: 0x4000, 0xf61: 0x4000, 0xf62: 0x4000, 0xf63: 0x4000, - 0xf64: 0x4000, 0xf65: 0x4000, 0xf66: 0x4000, 0xf67: 0x4000, 0xf68: 0x4000, 0xf69: 0x4000, - 0xf6a: 0x4000, 0xf6b: 0x4000, 0xf6c: 0x4000, 0xf6d: 0x4000, 0xf6e: 0x4000, 0xf6f: 0x4000, - 0xf70: 0x4000, 0xf71: 0x4000, 0xf72: 0x4000, 0xf73: 0x4000, 0xf74: 0x4000, 0xf75: 0x4000, - 0xf76: 0x4000, 0xf77: 0x4000, 0xf78: 0x4000, 0xf79: 0x4000, 0xf7a: 0x4000, 0xf7b: 0x4000, - 0xf7c: 0x4000, 0xf7d: 0x4000, 0xf7e: 0x4000, 0xf7f: 0x4000, - // Block 0x3e, offset 0xf80 - 0xf80: 0x4000, 0xf81: 0x4000, 0xf82: 0x4000, 0xf83: 0x4000, 0xf84: 0x4000, 0xf85: 0x4000, - 0xf86: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - 0xfe4: 0x4000, 0xfe5: 0x4000, 0xfe6: 0x4000, 0xfe7: 0x4000, 0xfe8: 0x4000, 0xfe9: 0x4000, - 0xfea: 0x4000, 0xfeb: 0x4000, 0xfec: 0x4000, 0xfed: 0x4000, 0xfee: 0x4000, 0xfef: 0x4000, - 0xff0: 0x4000, 0xff1: 0x4000, 0xff2: 0x4000, 0xff3: 0x4000, 0xff4: 0x4000, 0xff5: 0x4000, - 0xff6: 0x4000, 0xff7: 0x4000, 0xff8: 0x4000, 0xff9: 0x4000, 0xffa: 0x4000, 0xffb: 0x4000, - 0xffc: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x4000, 0x1001: 0x4000, 0x1002: 0x4000, 0x1003: 0x4000, 0x1004: 0x4000, 0x1005: 0x4000, - 0x1006: 0x4000, 0x1007: 0x4000, 0x1008: 0x4000, 0x1009: 0x4000, 0x100a: 0x4000, 0x100b: 0x4000, - 0x100c: 0x4000, 0x100d: 0x4000, 0x100e: 0x4000, 0x100f: 0x4000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, 0x101a: 0x4000, 0x101b: 0x4000, 0x101c: 0x4000, 0x101d: 0x4000, - 0x101e: 0x4000, 0x101f: 0x4000, 0x1020: 0x4000, 0x1021: 0x4000, 0x1022: 0x4000, 0x1023: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x2000, 0x1041: 0x2000, 0x1042: 0x2000, 0x1043: 0x2000, 0x1044: 0x2000, 0x1045: 0x2000, - 0x1046: 0x2000, 0x1047: 0x2000, 0x1048: 0x2000, 0x1049: 0x2000, 0x104a: 0x2000, 0x104b: 0x2000, - 0x104c: 0x2000, 0x104d: 0x2000, 0x104e: 0x2000, 0x104f: 0x2000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1053: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, - 0x1070: 0x4000, 0x1071: 0x4000, 0x1072: 0x4000, 0x1073: 0x4000, 0x1074: 0x4000, 0x1075: 0x4000, - 0x1076: 0x4000, 0x1077: 0x4000, 0x1078: 0x4000, 0x1079: 0x4000, 0x107a: 0x4000, 0x107b: 0x4000, - 0x107c: 0x4000, 0x107d: 0x4000, 0x107e: 0x4000, 0x107f: 0x4000, - // Block 0x42, offset 0x1080 - 0x1080: 0x4000, 0x1081: 0x4000, 0x1082: 0x4000, 0x1083: 0x4000, 0x1084: 0x4000, 0x1085: 0x4000, - 0x1086: 0x4000, 0x1087: 0x4000, 0x1088: 0x4000, 0x1089: 0x4000, 0x108a: 0x4000, 0x108b: 0x4000, - 0x108c: 0x4000, 0x108d: 0x4000, 0x108e: 0x4000, 0x108f: 0x4000, 0x1090: 0x4000, 0x1091: 0x4000, - 0x1092: 0x4000, 0x1094: 0x4000, 0x1095: 0x4000, 0x1096: 0x4000, 0x1097: 0x4000, - 0x1098: 0x4000, 0x1099: 0x4000, 0x109a: 0x4000, 0x109b: 0x4000, 0x109c: 0x4000, 0x109d: 0x4000, - 0x109e: 0x4000, 0x109f: 0x4000, 0x10a0: 0x4000, 0x10a1: 0x4000, 0x10a2: 0x4000, 0x10a3: 0x4000, - 0x10a4: 0x4000, 0x10a5: 0x4000, 0x10a6: 0x4000, 0x10a8: 0x4000, 0x10a9: 0x4000, - 0x10aa: 0x4000, 0x10ab: 0x4000, - // Block 0x43, offset 0x10c0 - 0x10c1: 0x9012, 0x10c2: 0x9012, 0x10c3: 0x9012, 0x10c4: 0x9012, 0x10c5: 0x9012, - 0x10c6: 0x9012, 0x10c7: 0x9012, 0x10c8: 0x9012, 0x10c9: 0x9012, 0x10ca: 0x9012, 0x10cb: 0x9012, - 0x10cc: 0x9012, 0x10cd: 0x9012, 0x10ce: 0x9012, 0x10cf: 0x9012, 0x10d0: 0x9012, 0x10d1: 0x9012, - 0x10d2: 0x9012, 0x10d3: 0x9012, 0x10d4: 0x9012, 0x10d5: 0x9012, 0x10d6: 0x9012, 0x10d7: 0x9012, - 0x10d8: 0x9012, 0x10d9: 0x9012, 0x10da: 0x9012, 0x10db: 0x9012, 0x10dc: 0x9012, 0x10dd: 0x9012, - 0x10de: 0x9012, 0x10df: 0x9012, 0x10e0: 0x9049, 0x10e1: 0x9049, 0x10e2: 0x9049, 0x10e3: 0x9049, - 0x10e4: 0x9049, 0x10e5: 0x9049, 0x10e6: 0x9049, 0x10e7: 0x9049, 0x10e8: 0x9049, 0x10e9: 0x9049, - 0x10ea: 0x9049, 0x10eb: 0x9049, 0x10ec: 0x9049, 0x10ed: 0x9049, 0x10ee: 0x9049, 0x10ef: 0x9049, - 0x10f0: 0x9049, 0x10f1: 0x9049, 0x10f2: 0x9049, 0x10f3: 0x9049, 0x10f4: 0x9049, 0x10f5: 0x9049, - 0x10f6: 0x9049, 0x10f7: 0x9049, 0x10f8: 0x9049, 0x10f9: 0x9049, 0x10fa: 0x9049, 0x10fb: 0x9049, - 0x10fc: 0x9049, 0x10fd: 0x9049, 0x10fe: 0x9049, 0x10ff: 0x9049, - // Block 0x44, offset 0x1100 - 0x1100: 0x9049, 0x1101: 0x9049, 0x1102: 0x9049, 0x1103: 0x9049, 0x1104: 0x9049, 0x1105: 0x9049, - 0x1106: 0x9049, 0x1107: 0x9049, 0x1108: 0x9049, 0x1109: 0x9049, 0x110a: 0x9049, 0x110b: 0x9049, - 0x110c: 0x9049, 0x110d: 0x9049, 0x110e: 0x9049, 0x110f: 0x9049, 0x1110: 0x9049, 0x1111: 0x9049, - 0x1112: 0x9049, 0x1113: 0x9049, 0x1114: 0x9049, 0x1115: 0x9049, 0x1116: 0x9049, 0x1117: 0x9049, - 0x1118: 0x9049, 0x1119: 0x9049, 0x111a: 0x9049, 0x111b: 0x9049, 0x111c: 0x9049, 0x111d: 0x9049, - 0x111e: 0x9049, 0x111f: 0x904a, 0x1120: 0x904b, 0x1121: 0xb04c, 0x1122: 0xb04d, 0x1123: 0xb04d, - 0x1124: 0xb04e, 0x1125: 0xb04f, 0x1126: 0xb050, 0x1127: 0xb051, 0x1128: 0xb052, 0x1129: 0xb053, - 0x112a: 0xb054, 0x112b: 0xb055, 0x112c: 0xb056, 0x112d: 0xb057, 0x112e: 0xb058, 0x112f: 0xb059, - 0x1130: 0xb05a, 0x1131: 0xb05b, 0x1132: 0xb05c, 0x1133: 0xb05d, 0x1134: 0xb05e, 0x1135: 0xb05f, - 0x1136: 0xb060, 0x1137: 0xb061, 0x1138: 0xb062, 0x1139: 0xb063, 0x113a: 0xb064, 0x113b: 0xb065, - 0x113c: 0xb052, 0x113d: 0xb066, 0x113e: 0xb067, 0x113f: 0xb055, - // Block 0x45, offset 0x1140 - 0x1140: 0xb068, 0x1141: 0xb069, 0x1142: 0xb06a, 0x1143: 0xb06b, 0x1144: 0xb05a, 0x1145: 0xb056, - 0x1146: 0xb06c, 0x1147: 0xb06d, 0x1148: 0xb06b, 0x1149: 0xb06e, 0x114a: 0xb06b, 0x114b: 0xb06f, - 0x114c: 0xb06f, 0x114d: 0xb070, 0x114e: 0xb070, 0x114f: 0xb071, 0x1150: 0xb056, 0x1151: 0xb072, - 0x1152: 0xb073, 0x1153: 0xb072, 0x1154: 0xb074, 0x1155: 0xb073, 0x1156: 0xb075, 0x1157: 0xb075, - 0x1158: 0xb076, 0x1159: 0xb076, 0x115a: 0xb077, 0x115b: 0xb077, 0x115c: 0xb073, 0x115d: 0xb078, - 0x115e: 0xb079, 0x115f: 0xb067, 0x1160: 0xb07a, 0x1161: 0xb07b, 0x1162: 0xb07b, 0x1163: 0xb07b, - 0x1164: 0xb07b, 0x1165: 0xb07b, 0x1166: 0xb07b, 0x1167: 0xb07b, 0x1168: 0xb07b, 0x1169: 0xb07b, - 0x116a: 0xb07b, 0x116b: 0xb07b, 0x116c: 0xb07b, 0x116d: 0xb07b, 0x116e: 0xb07b, 0x116f: 0xb07b, - 0x1170: 0xb07c, 0x1171: 0xb07c, 0x1172: 0xb07c, 0x1173: 0xb07c, 0x1174: 0xb07c, 0x1175: 0xb07c, - 0x1176: 0xb07c, 0x1177: 0xb07c, 0x1178: 0xb07c, 0x1179: 0xb07c, 0x117a: 0xb07c, 0x117b: 0xb07c, - 0x117c: 0xb07c, 0x117d: 0xb07c, 0x117e: 0xb07c, - // Block 0x46, offset 0x1180 - 0x1182: 0xb07d, 0x1183: 0xb07e, 0x1184: 0xb07f, 0x1185: 0xb080, - 0x1186: 0xb07f, 0x1187: 0xb07e, 0x118a: 0xb081, 0x118b: 0xb082, - 0x118c: 0xb083, 0x118d: 0xb07f, 0x118e: 0xb080, 0x118f: 0xb07f, - 0x1192: 0xb084, 0x1193: 0xb085, 0x1194: 0xb084, 0x1195: 0xb086, 0x1196: 0xb084, 0x1197: 0xb087, - 0x119a: 0xb088, 0x119b: 0xb089, 0x119c: 0xb08a, - 0x11a0: 0x908b, 0x11a1: 0x908b, 0x11a2: 0x908c, 0x11a3: 0x908d, - 0x11a4: 0x908b, 0x11a5: 0x908e, 0x11a6: 0x908f, 0x11a8: 0xb090, 0x11a9: 0xb091, - 0x11aa: 0xb092, 0x11ab: 0xb091, 0x11ac: 0xb093, 0x11ad: 0xb094, 0x11ae: 0xb095, - 0x11bd: 0x2000, - // Block 0x47, offset 0x11c0 - 0x11e0: 0x4000, 0x11e1: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, 0x1216: 0x4000, 0x1217: 0x4000, - 0x1218: 0x4000, 0x1219: 0x4000, 0x121a: 0x4000, 0x121b: 0x4000, 0x121c: 0x4000, 0x121d: 0x4000, - 0x121e: 0x4000, 0x121f: 0x4000, 0x1220: 0x4000, 0x1221: 0x4000, 0x1222: 0x4000, 0x1223: 0x4000, - 0x1224: 0x4000, 0x1225: 0x4000, 0x1226: 0x4000, 0x1227: 0x4000, 0x1228: 0x4000, 0x1229: 0x4000, - 0x122a: 0x4000, 0x122b: 0x4000, 0x122c: 0x4000, 0x122d: 0x4000, 0x122e: 0x4000, 0x122f: 0x4000, - 0x1230: 0x4000, 0x1231: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, 0x1249: 0x4000, 0x124a: 0x4000, 0x124b: 0x4000, - 0x124c: 0x4000, 0x124d: 0x4000, 0x124e: 0x4000, 0x124f: 0x4000, 0x1250: 0x4000, 0x1251: 0x4000, - 0x1252: 0x4000, 0x1253: 0x4000, 0x1254: 0x4000, 0x1255: 0x4000, 0x1256: 0x4000, 0x1257: 0x4000, - 0x1258: 0x4000, 0x1259: 0x4000, 0x125a: 0x4000, 0x125b: 0x4000, 0x125c: 0x4000, 0x125d: 0x4000, - 0x125e: 0x4000, 0x125f: 0x4000, 0x1260: 0x4000, 0x1261: 0x4000, 0x1262: 0x4000, 0x1263: 0x4000, - 0x1264: 0x4000, 0x1265: 0x4000, 0x1266: 0x4000, 0x1267: 0x4000, 0x1268: 0x4000, 0x1269: 0x4000, - 0x126a: 0x4000, 0x126b: 0x4000, 0x126c: 0x4000, 0x126d: 0x4000, 0x126e: 0x4000, 0x126f: 0x4000, - 0x1270: 0x4000, 0x1271: 0x4000, 0x1272: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, 0x1282: 0x4000, 0x1283: 0x4000, 0x1284: 0x4000, 0x1285: 0x4000, - 0x1286: 0x4000, 0x1287: 0x4000, 0x1288: 0x4000, 0x1289: 0x4000, 0x128a: 0x4000, 0x128b: 0x4000, - 0x128c: 0x4000, 0x128d: 0x4000, 0x128e: 0x4000, 0x128f: 0x4000, 0x1290: 0x4000, 0x1291: 0x4000, - 0x1292: 0x4000, 0x1293: 0x4000, 0x1294: 0x4000, 0x1295: 0x4000, 0x1296: 0x4000, 0x1297: 0x4000, - 0x1298: 0x4000, 0x1299: 0x4000, 0x129a: 0x4000, 0x129b: 0x4000, 0x129c: 0x4000, 0x129d: 0x4000, - 0x129e: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12f0: 0x4000, 0x12f1: 0x4000, 0x12f2: 0x4000, 0x12f3: 0x4000, 0x12f4: 0x4000, 0x12f5: 0x4000, - 0x12f6: 0x4000, 0x12f7: 0x4000, 0x12f8: 0x4000, 0x12f9: 0x4000, 0x12fa: 0x4000, 0x12fb: 0x4000, - 0x12fc: 0x4000, 0x12fd: 0x4000, 0x12fe: 0x4000, 0x12ff: 0x4000, - // Block 0x4c, offset 0x1300 - 0x1300: 0x4000, 0x1301: 0x4000, 0x1302: 0x4000, 0x1303: 0x4000, 0x1304: 0x4000, 0x1305: 0x4000, - 0x1306: 0x4000, 0x1307: 0x4000, 0x1308: 0x4000, 0x1309: 0x4000, 0x130a: 0x4000, 0x130b: 0x4000, - 0x130c: 0x4000, 0x130d: 0x4000, 0x130e: 0x4000, 0x130f: 0x4000, 0x1310: 0x4000, 0x1311: 0x4000, - 0x1312: 0x4000, 0x1313: 0x4000, 0x1314: 0x4000, 0x1315: 0x4000, 0x1316: 0x4000, 0x1317: 0x4000, - 0x1318: 0x4000, 0x1319: 0x4000, 0x131a: 0x4000, 0x131b: 0x4000, 0x131c: 0x4000, 0x131d: 0x4000, - 0x131e: 0x4000, 0x131f: 0x4000, 0x1320: 0x4000, 0x1321: 0x4000, 0x1322: 0x4000, 0x1323: 0x4000, - 0x1324: 0x4000, 0x1325: 0x4000, 0x1326: 0x4000, 0x1327: 0x4000, 0x1328: 0x4000, 0x1329: 0x4000, - 0x132a: 0x4000, 0x132b: 0x4000, 0x132c: 0x4000, 0x132d: 0x4000, 0x132e: 0x4000, 0x132f: 0x4000, - 0x1330: 0x4000, 0x1331: 0x4000, 0x1332: 0x4000, 0x1333: 0x4000, 0x1334: 0x4000, 0x1335: 0x4000, - 0x1336: 0x4000, 0x1337: 0x4000, 0x1338: 0x4000, 0x1339: 0x4000, 0x133a: 0x4000, 0x133b: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1344: 0x4000, - // Block 0x4e, offset 0x1380 - 0x138f: 0x4000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, - 0x13d0: 0x2000, 0x13d1: 0x2000, - 0x13d2: 0x2000, 0x13d3: 0x2000, 0x13d4: 0x2000, 0x13d5: 0x2000, 0x13d6: 0x2000, 0x13d7: 0x2000, - 0x13d8: 0x2000, 0x13d9: 0x2000, 0x13da: 0x2000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, 0x13ed: 0x2000, - 0x13f0: 0x2000, 0x13f1: 0x2000, 0x13f2: 0x2000, 0x13f3: 0x2000, 0x13f4: 0x2000, 0x13f5: 0x2000, - 0x13f6: 0x2000, 0x13f7: 0x2000, 0x13f8: 0x2000, 0x13f9: 0x2000, 0x13fa: 0x2000, 0x13fb: 0x2000, - 0x13fc: 0x2000, 0x13fd: 0x2000, 0x13fe: 0x2000, 0x13ff: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x2000, 0x1401: 0x2000, 0x1402: 0x2000, 0x1403: 0x2000, 0x1404: 0x2000, 0x1405: 0x2000, - 0x1406: 0x2000, 0x1407: 0x2000, 0x1408: 0x2000, 0x1409: 0x2000, 0x140a: 0x2000, 0x140b: 0x2000, - 0x140c: 0x2000, 0x140d: 0x2000, 0x140e: 0x2000, 0x140f: 0x2000, 0x1410: 0x2000, 0x1411: 0x2000, - 0x1412: 0x2000, 0x1413: 0x2000, 0x1414: 0x2000, 0x1415: 0x2000, 0x1416: 0x2000, 0x1417: 0x2000, - 0x1418: 0x2000, 0x1419: 0x2000, 0x141a: 0x2000, 0x141b: 0x2000, 0x141c: 0x2000, 0x141d: 0x2000, - 0x141e: 0x2000, 0x141f: 0x2000, 0x1420: 0x2000, 0x1421: 0x2000, 0x1422: 0x2000, 0x1423: 0x2000, - 0x1424: 0x2000, 0x1425: 0x2000, 0x1426: 0x2000, 0x1427: 0x2000, 0x1428: 0x2000, 0x1429: 0x2000, - 0x1430: 0x2000, 0x1431: 0x2000, 0x1432: 0x2000, 0x1433: 0x2000, 0x1434: 0x2000, 0x1435: 0x2000, - 0x1436: 0x2000, 0x1437: 0x2000, 0x1438: 0x2000, 0x1439: 0x2000, 0x143a: 0x2000, 0x143b: 0x2000, - 0x143c: 0x2000, 0x143d: 0x2000, 0x143e: 0x2000, 0x143f: 0x2000, - // Block 0x51, offset 0x1440 - 0x1440: 0x2000, 0x1441: 0x2000, 0x1442: 0x2000, 0x1443: 0x2000, 0x1444: 0x2000, 0x1445: 0x2000, - 0x1446: 0x2000, 0x1447: 0x2000, 0x1448: 0x2000, 0x1449: 0x2000, 0x144a: 0x2000, 0x144b: 0x2000, - 0x144c: 0x2000, 0x144d: 0x2000, 0x144e: 0x4000, 0x144f: 0x2000, 0x1450: 0x2000, 0x1451: 0x4000, - 0x1452: 0x4000, 0x1453: 0x4000, 0x1454: 0x4000, 0x1455: 0x4000, 0x1456: 0x4000, 0x1457: 0x4000, - 0x1458: 0x4000, 0x1459: 0x4000, 0x145a: 0x4000, 0x145b: 0x2000, 0x145c: 0x2000, 0x145d: 0x2000, - 0x145e: 0x2000, 0x145f: 0x2000, 0x1460: 0x2000, 0x1461: 0x2000, 0x1462: 0x2000, 0x1463: 0x2000, - 0x1464: 0x2000, 0x1465: 0x2000, 0x1466: 0x2000, 0x1467: 0x2000, 0x1468: 0x2000, 0x1469: 0x2000, - 0x146a: 0x2000, 0x146b: 0x2000, 0x146c: 0x2000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, - 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, 0x14a1: 0x4000, 0x14a2: 0x4000, 0x14a3: 0x4000, - 0x14a4: 0x4000, 0x14a5: 0x4000, 0x14a6: 0x4000, 0x14a7: 0x4000, 0x14a8: 0x4000, 0x14a9: 0x4000, - 0x14aa: 0x4000, 0x14ab: 0x4000, 0x14ac: 0x4000, 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b6: 0x4000, 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, - 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, 0x1514: 0x4000, 0x1515: 0x4000, 0x1516: 0x4000, 0x1517: 0x4000, - 0x1518: 0x4000, 0x1519: 0x4000, 0x151a: 0x4000, 0x151b: 0x4000, 0x151c: 0x4000, 0x151d: 0x4000, - 0x151e: 0x4000, 0x151f: 0x4000, 0x1520: 0x4000, - 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, 0x154b: 0x4000, - 0x154c: 0x4000, 0x154d: 0x4000, 0x154e: 0x4000, 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, 0x1554: 0x4000, 0x1555: 0x4000, 0x1556: 0x4000, 0x1557: 0x4000, - 0x1558: 0x4000, 0x1559: 0x4000, 0x155a: 0x4000, 0x155b: 0x4000, 0x155c: 0x4000, 0x155d: 0x4000, - 0x155e: 0x4000, 0x155f: 0x4000, 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1571: 0x4000, 0x1572: 0x4000, 0x1573: 0x4000, 0x1574: 0x4000, 0x1575: 0x4000, - 0x1576: 0x4000, 0x1577: 0x4000, 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1581: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, - 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, - 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, - 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f4: 0x4000, - 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15fd: 0x4000, 0x15fe: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, 0x163e: 0x4000, 0x163f: 0x4000, - // Block 0x59, offset 0x1640 - 0x1640: 0x4000, 0x1641: 0x4000, 0x1642: 0x4000, 0x1643: 0x4000, 0x1644: 0x4000, 0x1645: 0x4000, - 0x1646: 0x4000, 0x1647: 0x4000, 0x1648: 0x4000, 0x1649: 0x4000, 0x164a: 0x4000, 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x164f: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, 0x1668: 0x4000, 0x1669: 0x4000, - 0x166a: 0x4000, 0x166b: 0x4000, 0x166c: 0x4000, 0x166d: 0x4000, 0x166e: 0x4000, 0x166f: 0x4000, - 0x1670: 0x4000, 0x1671: 0x4000, 0x1672: 0x4000, 0x1673: 0x4000, 0x1674: 0x4000, 0x1675: 0x4000, - 0x1676: 0x4000, 0x1677: 0x4000, 0x1678: 0x4000, 0x1679: 0x4000, 0x167a: 0x4000, 0x167b: 0x4000, - 0x167c: 0x4000, 0x167f: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1680: 0x4000, 0x1681: 0x4000, 0x1682: 0x4000, 0x1683: 0x4000, 0x1684: 0x4000, 0x1685: 0x4000, - 0x1686: 0x4000, 0x1687: 0x4000, 0x1688: 0x4000, 0x1689: 0x4000, 0x168a: 0x4000, 0x168b: 0x4000, - 0x168c: 0x4000, 0x168d: 0x4000, 0x168e: 0x4000, 0x168f: 0x4000, 0x1690: 0x4000, 0x1691: 0x4000, - 0x1692: 0x4000, 0x1693: 0x4000, 0x1694: 0x4000, 0x1695: 0x4000, 0x1696: 0x4000, 0x1697: 0x4000, - 0x1698: 0x4000, 0x1699: 0x4000, 0x169a: 0x4000, 0x169b: 0x4000, 0x169c: 0x4000, 0x169d: 0x4000, - 0x169e: 0x4000, 0x169f: 0x4000, 0x16a0: 0x4000, 0x16a1: 0x4000, 0x16a2: 0x4000, 0x16a3: 0x4000, - 0x16a4: 0x4000, 0x16a5: 0x4000, 0x16a6: 0x4000, 0x16a7: 0x4000, 0x16a8: 0x4000, 0x16a9: 0x4000, - 0x16aa: 0x4000, 0x16ab: 0x4000, 0x16ac: 0x4000, 0x16ad: 0x4000, 0x16ae: 0x4000, 0x16af: 0x4000, - 0x16b0: 0x4000, 0x16b1: 0x4000, 0x16b2: 0x4000, 0x16b3: 0x4000, 0x16b4: 0x4000, 0x16b5: 0x4000, - 0x16b6: 0x4000, 0x16b7: 0x4000, 0x16b8: 0x4000, 0x16b9: 0x4000, 0x16ba: 0x4000, 0x16bb: 0x4000, - 0x16bc: 0x4000, 0x16bd: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16d0: 0x4000, 0x16d1: 0x4000, - 0x16d2: 0x4000, 0x16d3: 0x4000, 0x16d4: 0x4000, 0x16d5: 0x4000, 0x16d6: 0x4000, 0x16d7: 0x4000, - 0x16d8: 0x4000, 0x16d9: 0x4000, 0x16da: 0x4000, 0x16db: 0x4000, 0x16dc: 0x4000, 0x16dd: 0x4000, - 0x16de: 0x4000, 0x16df: 0x4000, 0x16e0: 0x4000, 0x16e1: 0x4000, 0x16e2: 0x4000, 0x16e3: 0x4000, - 0x16e4: 0x4000, 0x16e5: 0x4000, 0x16e6: 0x4000, 0x16e7: 0x4000, - 0x16fa: 0x4000, - // Block 0x5c, offset 0x1700 - 0x1715: 0x4000, 0x1716: 0x4000, - 0x1724: 0x4000, - // Block 0x5d, offset 0x1740 - 0x177b: 0x4000, - 0x177c: 0x4000, 0x177d: 0x4000, 0x177e: 0x4000, 0x177f: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1780: 0x4000, 0x1781: 0x4000, 0x1782: 0x4000, 0x1783: 0x4000, 0x1784: 0x4000, 0x1785: 0x4000, - 0x1786: 0x4000, 0x1787: 0x4000, 0x1788: 0x4000, 0x1789: 0x4000, 0x178a: 0x4000, 0x178b: 0x4000, - 0x178c: 0x4000, 0x178d: 0x4000, 0x178e: 0x4000, 0x178f: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17cc: 0x4000, 0x17d0: 0x4000, 0x17d1: 0x4000, - 0x17d2: 0x4000, - 0x17eb: 0x4000, 0x17ec: 0x4000, - 0x17f4: 0x4000, 0x17f5: 0x4000, - 0x17f6: 0x4000, 0x17f7: 0x4000, 0x17f8: 0x4000, 0x17f9: 0x4000, - // Block 0x60, offset 0x1800 - 0x1810: 0x4000, 0x1811: 0x4000, - 0x1812: 0x4000, 0x1813: 0x4000, 0x1814: 0x4000, 0x1815: 0x4000, 0x1816: 0x4000, 0x1817: 0x4000, - 0x1818: 0x4000, 0x1819: 0x4000, 0x181a: 0x4000, 0x181b: 0x4000, 0x181c: 0x4000, 0x181d: 0x4000, - 0x181e: 0x4000, 0x181f: 0x4000, 0x1820: 0x4000, 0x1821: 0x4000, 0x1822: 0x4000, 0x1823: 0x4000, - 0x1824: 0x4000, 0x1825: 0x4000, 0x1826: 0x4000, 0x1827: 0x4000, 0x1828: 0x4000, 0x1829: 0x4000, - 0x182a: 0x4000, 0x182b: 0x4000, 0x182c: 0x4000, 0x182d: 0x4000, 0x182e: 0x4000, 0x182f: 0x4000, - 0x1830: 0x4000, 0x1831: 0x4000, 0x1832: 0x4000, 0x1833: 0x4000, 0x1834: 0x4000, 0x1835: 0x4000, - 0x1836: 0x4000, 0x1837: 0x4000, 0x1838: 0x4000, 0x1839: 0x4000, 0x183a: 0x4000, 0x183b: 0x4000, - 0x183c: 0x4000, 0x183d: 0x4000, 0x183e: 0x4000, - // Block 0x61, offset 0x1840 - 0x1840: 0x4000, 0x1841: 0x4000, 0x1842: 0x4000, 0x1843: 0x4000, 0x1844: 0x4000, 0x1845: 0x4000, - 0x1846: 0x4000, 0x1847: 0x4000, 0x1848: 0x4000, 0x1849: 0x4000, 0x184a: 0x4000, 0x184b: 0x4000, - 0x184c: 0x4000, 0x184d: 0x4000, 0x184e: 0x4000, 0x184f: 0x4000, 0x1850: 0x4000, 0x1851: 0x4000, - 0x1852: 0x4000, 0x1853: 0x4000, 0x1854: 0x4000, 0x1855: 0x4000, 0x1856: 0x4000, 0x1857: 0x4000, - 0x1858: 0x4000, 0x1859: 0x4000, 0x185a: 0x4000, 0x185b: 0x4000, 0x185c: 0x4000, 0x185d: 0x4000, - 0x185e: 0x4000, 0x185f: 0x4000, 0x1860: 0x4000, 0x1861: 0x4000, 0x1862: 0x4000, 0x1863: 0x4000, - 0x1864: 0x4000, 0x1865: 0x4000, 0x1866: 0x4000, 0x1867: 0x4000, 0x1868: 0x4000, 0x1869: 0x4000, - 0x186a: 0x4000, 0x186b: 0x4000, 0x186c: 0x4000, 0x186d: 0x4000, 0x186e: 0x4000, 0x186f: 0x4000, - 0x1870: 0x4000, 0x1873: 0x4000, 0x1874: 0x4000, 0x1875: 0x4000, - 0x1876: 0x4000, 0x187a: 0x4000, - 0x187c: 0x4000, 0x187d: 0x4000, 0x187e: 0x4000, 0x187f: 0x4000, - // Block 0x62, offset 0x1880 - 0x1880: 0x4000, 0x1881: 0x4000, 0x1882: 0x4000, 0x1883: 0x4000, 0x1884: 0x4000, 0x1885: 0x4000, - 0x1886: 0x4000, 0x1887: 0x4000, 0x1888: 0x4000, 0x1889: 0x4000, 0x188a: 0x4000, 0x188b: 0x4000, - 0x188c: 0x4000, 0x188d: 0x4000, 0x188e: 0x4000, 0x188f: 0x4000, 0x1890: 0x4000, 0x1891: 0x4000, - 0x1892: 0x4000, 0x1893: 0x4000, 0x1894: 0x4000, 0x1895: 0x4000, 0x1896: 0x4000, 0x1897: 0x4000, - 0x1898: 0x4000, 0x1899: 0x4000, 0x189a: 0x4000, 0x189b: 0x4000, 0x189c: 0x4000, 0x189d: 0x4000, - 0x189e: 0x4000, 0x189f: 0x4000, 0x18a0: 0x4000, 0x18a1: 0x4000, 0x18a2: 0x4000, - 0x18b0: 0x4000, 0x18b1: 0x4000, 0x18b2: 0x4000, 0x18b3: 0x4000, 0x18b4: 0x4000, 0x18b5: 0x4000, - 0x18b6: 0x4000, 0x18b7: 0x4000, 0x18b8: 0x4000, 0x18b9: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, 0x18c1: 0x4000, 0x18c2: 0x4000, - 0x18d0: 0x4000, 0x18d1: 0x4000, - 0x18d2: 0x4000, 0x18d3: 0x4000, 0x18d4: 0x4000, 0x18d5: 0x4000, 0x18d6: 0x4000, 0x18d7: 0x4000, - 0x18d8: 0x4000, 0x18d9: 0x4000, 0x18da: 0x4000, 0x18db: 0x4000, 0x18dc: 0x4000, 0x18dd: 0x4000, - 0x18de: 0x4000, 0x18df: 0x4000, 0x18e0: 0x4000, 0x18e1: 0x4000, 0x18e2: 0x4000, 0x18e3: 0x4000, - 0x18e4: 0x4000, 0x18e5: 0x4000, 0x18e6: 0x4000, 0x18e7: 0x4000, 0x18e8: 0x4000, 0x18e9: 0x4000, - 0x18ea: 0x4000, 0x18eb: 0x4000, 0x18ec: 0x4000, 0x18ed: 0x4000, 0x18ee: 0x4000, 0x18ef: 0x4000, - 0x18f0: 0x4000, 0x18f1: 0x4000, 0x18f2: 0x4000, 0x18f3: 0x4000, 0x18f4: 0x4000, 0x18f5: 0x4000, - 0x18f6: 0x4000, 0x18f7: 0x4000, 0x18f8: 0x4000, 0x18f9: 0x4000, 0x18fa: 0x4000, 0x18fb: 0x4000, - 0x18fc: 0x4000, 0x18fd: 0x4000, 0x18fe: 0x4000, 0x18ff: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x2000, 0x1901: 0x2000, 0x1902: 0x2000, 0x1903: 0x2000, 0x1904: 0x2000, 0x1905: 0x2000, - 0x1906: 0x2000, 0x1907: 0x2000, 0x1908: 0x2000, 0x1909: 0x2000, 0x190a: 0x2000, 0x190b: 0x2000, - 0x190c: 0x2000, 0x190d: 0x2000, 0x190e: 0x2000, 0x190f: 0x2000, 0x1910: 0x2000, 0x1911: 0x2000, - 0x1912: 0x2000, 0x1913: 0x2000, 0x1914: 0x2000, 0x1915: 0x2000, 0x1916: 0x2000, 0x1917: 0x2000, - 0x1918: 0x2000, 0x1919: 0x2000, 0x191a: 0x2000, 0x191b: 0x2000, 0x191c: 0x2000, 0x191d: 0x2000, - 0x191e: 0x2000, 0x191f: 0x2000, 0x1920: 0x2000, 0x1921: 0x2000, 0x1922: 0x2000, 0x1923: 0x2000, - 0x1924: 0x2000, 0x1925: 0x2000, 0x1926: 0x2000, 0x1927: 0x2000, 0x1928: 0x2000, 0x1929: 0x2000, - 0x192a: 0x2000, 0x192b: 0x2000, 0x192c: 0x2000, 0x192d: 0x2000, 0x192e: 0x2000, 0x192f: 0x2000, - 0x1930: 0x2000, 0x1931: 0x2000, 0x1932: 0x2000, 0x1933: 0x2000, 0x1934: 0x2000, 0x1935: 0x2000, - 0x1936: 0x2000, 0x1937: 0x2000, 0x1938: 0x2000, 0x1939: 0x2000, 0x193a: 0x2000, 0x193b: 0x2000, - 0x193c: 0x2000, 0x193d: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x3a, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3b, 0x253: 0x3c, - 0x265: 0x3d, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3e, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3f, 0x339: 0x40, 0x33c: 0x41, 0x33d: 0x42, 0x33e: 0x43, 0x33f: 0x44, - // Block 0xd, offset 0x340 - 0x37f: 0x45, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x46, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x0e, 0x3c1: 0x0e, 0x3c2: 0x0e, 0x3c3: 0x0e, 0x3c4: 0x48, 0x3c5: 0x49, 0x3c6: 0x0e, 0x3c7: 0x0e, - 0x3c8: 0x0e, 0x3c9: 0x0e, 0x3ca: 0x0e, 0x3cb: 0x4a, - // Block 0x10, offset 0x400 - 0x400: 0x4b, 0x403: 0x4c, 0x404: 0x4d, 0x405: 0x4e, 0x406: 0x4f, - 0x408: 0x50, 0x409: 0x51, 0x40c: 0x52, 0x40d: 0x53, 0x40e: 0x54, 0x40f: 0x55, - 0x410: 0x3a, 0x411: 0x56, 0x412: 0x0e, 0x413: 0x57, 0x414: 0x58, 0x415: 0x59, 0x416: 0x5a, 0x417: 0x5b, - 0x418: 0x0e, 0x419: 0x5c, 0x41a: 0x0e, 0x41b: 0x5d, - 0x424: 0x5e, 0x425: 0x5f, 0x426: 0x60, 0x427: 0x61, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x62, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 14936 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/tables12.0.0.go b/vendor/golang.org/x/text/width/tables12.0.0.go deleted file mode 100644 index 85296297e..000000000 --- a/vendor/golang.org/x/text/width/tables12.0.0.go +++ /dev/null @@ -1,1351 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.14 && !go1.16 -// +build go1.14,!go1.16 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "12.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14720 bytes (14.38 KiB). Checksum: 3f4f2516ded5489b. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 104 blocks, 6656 entries, 13312 bytes -// The third block is the zero block. -var widthValues = [6656]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, 0xdae: 0x4000, 0xdaf: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf0d: 0x4000, 0xf0e: 0x4000, 0xf0f: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, 0xf47: 0x4000, 0xf48: 0x4000, 0xf49: 0x4000, 0xf4a: 0x4000, 0xf4b: 0x4000, - 0xf4c: 0x4000, 0xf50: 0x4000, 0xf51: 0x4000, - 0xf52: 0x4000, 0xf53: 0x4000, 0xf54: 0x4000, 0xf55: 0x4000, 0xf56: 0x4000, 0xf57: 0x4000, - 0xf58: 0x4000, 0xf59: 0x4000, 0xf5a: 0x4000, 0xf5b: 0x4000, 0xf5c: 0x4000, 0xf5d: 0x4000, - 0xf5e: 0x4000, 0xf5f: 0x4000, 0xf60: 0x4000, 0xf61: 0x4000, 0xf62: 0x4000, 0xf63: 0x4000, - 0xf64: 0x4000, 0xf65: 0x4000, 0xf66: 0x4000, 0xf67: 0x4000, 0xf68: 0x4000, 0xf69: 0x4000, - 0xf6a: 0x4000, 0xf6b: 0x4000, 0xf6c: 0x4000, 0xf6d: 0x4000, 0xf6e: 0x4000, 0xf6f: 0x4000, - 0xf70: 0x4000, 0xf71: 0x4000, 0xf72: 0x4000, 0xf73: 0x4000, 0xf74: 0x4000, 0xf75: 0x4000, - 0xf76: 0x4000, 0xf77: 0x4000, 0xf78: 0x4000, 0xf79: 0x4000, 0xf7a: 0x4000, 0xf7b: 0x4000, - 0xf7c: 0x4000, 0xf7d: 0x4000, 0xf7e: 0x4000, 0xf7f: 0x4000, - // Block 0x3e, offset 0xf80 - 0xf80: 0x4000, 0xf81: 0x4000, 0xf82: 0x4000, 0xf83: 0x4000, 0xf84: 0x4000, 0xf85: 0x4000, - 0xf86: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - 0xfe4: 0x4000, 0xfe5: 0x4000, 0xfe6: 0x4000, 0xfe7: 0x4000, 0xfe8: 0x4000, 0xfe9: 0x4000, - 0xfea: 0x4000, 0xfeb: 0x4000, 0xfec: 0x4000, 0xfed: 0x4000, 0xfee: 0x4000, 0xfef: 0x4000, - 0xff0: 0x4000, 0xff1: 0x4000, 0xff2: 0x4000, 0xff3: 0x4000, 0xff4: 0x4000, 0xff5: 0x4000, - 0xff6: 0x4000, 0xff7: 0x4000, 0xff8: 0x4000, 0xff9: 0x4000, 0xffa: 0x4000, 0xffb: 0x4000, - 0xffc: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x4000, 0x1001: 0x4000, 0x1002: 0x4000, 0x1003: 0x4000, 0x1004: 0x4000, 0x1005: 0x4000, - 0x1006: 0x4000, 0x1007: 0x4000, 0x1008: 0x4000, 0x1009: 0x4000, 0x100a: 0x4000, 0x100b: 0x4000, - 0x100c: 0x4000, 0x100d: 0x4000, 0x100e: 0x4000, 0x100f: 0x4000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, 0x101a: 0x4000, 0x101b: 0x4000, 0x101c: 0x4000, 0x101d: 0x4000, - 0x101e: 0x4000, 0x101f: 0x4000, 0x1020: 0x4000, 0x1021: 0x4000, 0x1022: 0x4000, 0x1023: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x2000, 0x1041: 0x2000, 0x1042: 0x2000, 0x1043: 0x2000, 0x1044: 0x2000, 0x1045: 0x2000, - 0x1046: 0x2000, 0x1047: 0x2000, 0x1048: 0x2000, 0x1049: 0x2000, 0x104a: 0x2000, 0x104b: 0x2000, - 0x104c: 0x2000, 0x104d: 0x2000, 0x104e: 0x2000, 0x104f: 0x2000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1053: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, - 0x1070: 0x4000, 0x1071: 0x4000, 0x1072: 0x4000, 0x1073: 0x4000, 0x1074: 0x4000, 0x1075: 0x4000, - 0x1076: 0x4000, 0x1077: 0x4000, 0x1078: 0x4000, 0x1079: 0x4000, 0x107a: 0x4000, 0x107b: 0x4000, - 0x107c: 0x4000, 0x107d: 0x4000, 0x107e: 0x4000, 0x107f: 0x4000, - // Block 0x42, offset 0x1080 - 0x1080: 0x4000, 0x1081: 0x4000, 0x1082: 0x4000, 0x1083: 0x4000, 0x1084: 0x4000, 0x1085: 0x4000, - 0x1086: 0x4000, 0x1087: 0x4000, 0x1088: 0x4000, 0x1089: 0x4000, 0x108a: 0x4000, 0x108b: 0x4000, - 0x108c: 0x4000, 0x108d: 0x4000, 0x108e: 0x4000, 0x108f: 0x4000, 0x1090: 0x4000, 0x1091: 0x4000, - 0x1092: 0x4000, 0x1094: 0x4000, 0x1095: 0x4000, 0x1096: 0x4000, 0x1097: 0x4000, - 0x1098: 0x4000, 0x1099: 0x4000, 0x109a: 0x4000, 0x109b: 0x4000, 0x109c: 0x4000, 0x109d: 0x4000, - 0x109e: 0x4000, 0x109f: 0x4000, 0x10a0: 0x4000, 0x10a1: 0x4000, 0x10a2: 0x4000, 0x10a3: 0x4000, - 0x10a4: 0x4000, 0x10a5: 0x4000, 0x10a6: 0x4000, 0x10a8: 0x4000, 0x10a9: 0x4000, - 0x10aa: 0x4000, 0x10ab: 0x4000, - // Block 0x43, offset 0x10c0 - 0x10c1: 0x9012, 0x10c2: 0x9012, 0x10c3: 0x9012, 0x10c4: 0x9012, 0x10c5: 0x9012, - 0x10c6: 0x9012, 0x10c7: 0x9012, 0x10c8: 0x9012, 0x10c9: 0x9012, 0x10ca: 0x9012, 0x10cb: 0x9012, - 0x10cc: 0x9012, 0x10cd: 0x9012, 0x10ce: 0x9012, 0x10cf: 0x9012, 0x10d0: 0x9012, 0x10d1: 0x9012, - 0x10d2: 0x9012, 0x10d3: 0x9012, 0x10d4: 0x9012, 0x10d5: 0x9012, 0x10d6: 0x9012, 0x10d7: 0x9012, - 0x10d8: 0x9012, 0x10d9: 0x9012, 0x10da: 0x9012, 0x10db: 0x9012, 0x10dc: 0x9012, 0x10dd: 0x9012, - 0x10de: 0x9012, 0x10df: 0x9012, 0x10e0: 0x9049, 0x10e1: 0x9049, 0x10e2: 0x9049, 0x10e3: 0x9049, - 0x10e4: 0x9049, 0x10e5: 0x9049, 0x10e6: 0x9049, 0x10e7: 0x9049, 0x10e8: 0x9049, 0x10e9: 0x9049, - 0x10ea: 0x9049, 0x10eb: 0x9049, 0x10ec: 0x9049, 0x10ed: 0x9049, 0x10ee: 0x9049, 0x10ef: 0x9049, - 0x10f0: 0x9049, 0x10f1: 0x9049, 0x10f2: 0x9049, 0x10f3: 0x9049, 0x10f4: 0x9049, 0x10f5: 0x9049, - 0x10f6: 0x9049, 0x10f7: 0x9049, 0x10f8: 0x9049, 0x10f9: 0x9049, 0x10fa: 0x9049, 0x10fb: 0x9049, - 0x10fc: 0x9049, 0x10fd: 0x9049, 0x10fe: 0x9049, 0x10ff: 0x9049, - // Block 0x44, offset 0x1100 - 0x1100: 0x9049, 0x1101: 0x9049, 0x1102: 0x9049, 0x1103: 0x9049, 0x1104: 0x9049, 0x1105: 0x9049, - 0x1106: 0x9049, 0x1107: 0x9049, 0x1108: 0x9049, 0x1109: 0x9049, 0x110a: 0x9049, 0x110b: 0x9049, - 0x110c: 0x9049, 0x110d: 0x9049, 0x110e: 0x9049, 0x110f: 0x9049, 0x1110: 0x9049, 0x1111: 0x9049, - 0x1112: 0x9049, 0x1113: 0x9049, 0x1114: 0x9049, 0x1115: 0x9049, 0x1116: 0x9049, 0x1117: 0x9049, - 0x1118: 0x9049, 0x1119: 0x9049, 0x111a: 0x9049, 0x111b: 0x9049, 0x111c: 0x9049, 0x111d: 0x9049, - 0x111e: 0x9049, 0x111f: 0x904a, 0x1120: 0x904b, 0x1121: 0xb04c, 0x1122: 0xb04d, 0x1123: 0xb04d, - 0x1124: 0xb04e, 0x1125: 0xb04f, 0x1126: 0xb050, 0x1127: 0xb051, 0x1128: 0xb052, 0x1129: 0xb053, - 0x112a: 0xb054, 0x112b: 0xb055, 0x112c: 0xb056, 0x112d: 0xb057, 0x112e: 0xb058, 0x112f: 0xb059, - 0x1130: 0xb05a, 0x1131: 0xb05b, 0x1132: 0xb05c, 0x1133: 0xb05d, 0x1134: 0xb05e, 0x1135: 0xb05f, - 0x1136: 0xb060, 0x1137: 0xb061, 0x1138: 0xb062, 0x1139: 0xb063, 0x113a: 0xb064, 0x113b: 0xb065, - 0x113c: 0xb052, 0x113d: 0xb066, 0x113e: 0xb067, 0x113f: 0xb055, - // Block 0x45, offset 0x1140 - 0x1140: 0xb068, 0x1141: 0xb069, 0x1142: 0xb06a, 0x1143: 0xb06b, 0x1144: 0xb05a, 0x1145: 0xb056, - 0x1146: 0xb06c, 0x1147: 0xb06d, 0x1148: 0xb06b, 0x1149: 0xb06e, 0x114a: 0xb06b, 0x114b: 0xb06f, - 0x114c: 0xb06f, 0x114d: 0xb070, 0x114e: 0xb070, 0x114f: 0xb071, 0x1150: 0xb056, 0x1151: 0xb072, - 0x1152: 0xb073, 0x1153: 0xb072, 0x1154: 0xb074, 0x1155: 0xb073, 0x1156: 0xb075, 0x1157: 0xb075, - 0x1158: 0xb076, 0x1159: 0xb076, 0x115a: 0xb077, 0x115b: 0xb077, 0x115c: 0xb073, 0x115d: 0xb078, - 0x115e: 0xb079, 0x115f: 0xb067, 0x1160: 0xb07a, 0x1161: 0xb07b, 0x1162: 0xb07b, 0x1163: 0xb07b, - 0x1164: 0xb07b, 0x1165: 0xb07b, 0x1166: 0xb07b, 0x1167: 0xb07b, 0x1168: 0xb07b, 0x1169: 0xb07b, - 0x116a: 0xb07b, 0x116b: 0xb07b, 0x116c: 0xb07b, 0x116d: 0xb07b, 0x116e: 0xb07b, 0x116f: 0xb07b, - 0x1170: 0xb07c, 0x1171: 0xb07c, 0x1172: 0xb07c, 0x1173: 0xb07c, 0x1174: 0xb07c, 0x1175: 0xb07c, - 0x1176: 0xb07c, 0x1177: 0xb07c, 0x1178: 0xb07c, 0x1179: 0xb07c, 0x117a: 0xb07c, 0x117b: 0xb07c, - 0x117c: 0xb07c, 0x117d: 0xb07c, 0x117e: 0xb07c, - // Block 0x46, offset 0x1180 - 0x1182: 0xb07d, 0x1183: 0xb07e, 0x1184: 0xb07f, 0x1185: 0xb080, - 0x1186: 0xb07f, 0x1187: 0xb07e, 0x118a: 0xb081, 0x118b: 0xb082, - 0x118c: 0xb083, 0x118d: 0xb07f, 0x118e: 0xb080, 0x118f: 0xb07f, - 0x1192: 0xb084, 0x1193: 0xb085, 0x1194: 0xb084, 0x1195: 0xb086, 0x1196: 0xb084, 0x1197: 0xb087, - 0x119a: 0xb088, 0x119b: 0xb089, 0x119c: 0xb08a, - 0x11a0: 0x908b, 0x11a1: 0x908b, 0x11a2: 0x908c, 0x11a3: 0x908d, - 0x11a4: 0x908b, 0x11a5: 0x908e, 0x11a6: 0x908f, 0x11a8: 0xb090, 0x11a9: 0xb091, - 0x11aa: 0xb092, 0x11ab: 0xb091, 0x11ac: 0xb093, 0x11ad: 0xb094, 0x11ae: 0xb095, - 0x11bd: 0x2000, - // Block 0x47, offset 0x11c0 - 0x11e0: 0x4000, 0x11e1: 0x4000, 0x11e2: 0x4000, 0x11e3: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, 0x1216: 0x4000, 0x1217: 0x4000, - 0x1218: 0x4000, 0x1219: 0x4000, 0x121a: 0x4000, 0x121b: 0x4000, 0x121c: 0x4000, 0x121d: 0x4000, - 0x121e: 0x4000, 0x121f: 0x4000, 0x1220: 0x4000, 0x1221: 0x4000, 0x1222: 0x4000, 0x1223: 0x4000, - 0x1224: 0x4000, 0x1225: 0x4000, 0x1226: 0x4000, 0x1227: 0x4000, 0x1228: 0x4000, 0x1229: 0x4000, - 0x122a: 0x4000, 0x122b: 0x4000, 0x122c: 0x4000, 0x122d: 0x4000, 0x122e: 0x4000, 0x122f: 0x4000, - 0x1230: 0x4000, 0x1231: 0x4000, 0x1232: 0x4000, 0x1233: 0x4000, 0x1234: 0x4000, 0x1235: 0x4000, - 0x1236: 0x4000, 0x1237: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, 0x1249: 0x4000, 0x124a: 0x4000, 0x124b: 0x4000, - 0x124c: 0x4000, 0x124d: 0x4000, 0x124e: 0x4000, 0x124f: 0x4000, 0x1250: 0x4000, 0x1251: 0x4000, - 0x1252: 0x4000, 0x1253: 0x4000, 0x1254: 0x4000, 0x1255: 0x4000, 0x1256: 0x4000, 0x1257: 0x4000, - 0x1258: 0x4000, 0x1259: 0x4000, 0x125a: 0x4000, 0x125b: 0x4000, 0x125c: 0x4000, 0x125d: 0x4000, - 0x125e: 0x4000, 0x125f: 0x4000, 0x1260: 0x4000, 0x1261: 0x4000, 0x1262: 0x4000, 0x1263: 0x4000, - 0x1264: 0x4000, 0x1265: 0x4000, 0x1266: 0x4000, 0x1267: 0x4000, 0x1268: 0x4000, 0x1269: 0x4000, - 0x126a: 0x4000, 0x126b: 0x4000, 0x126c: 0x4000, 0x126d: 0x4000, 0x126e: 0x4000, 0x126f: 0x4000, - 0x1270: 0x4000, 0x1271: 0x4000, 0x1272: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, 0x1282: 0x4000, 0x1283: 0x4000, 0x1284: 0x4000, 0x1285: 0x4000, - 0x1286: 0x4000, 0x1287: 0x4000, 0x1288: 0x4000, 0x1289: 0x4000, 0x128a: 0x4000, 0x128b: 0x4000, - 0x128c: 0x4000, 0x128d: 0x4000, 0x128e: 0x4000, 0x128f: 0x4000, 0x1290: 0x4000, 0x1291: 0x4000, - 0x1292: 0x4000, 0x1293: 0x4000, 0x1294: 0x4000, 0x1295: 0x4000, 0x1296: 0x4000, 0x1297: 0x4000, - 0x1298: 0x4000, 0x1299: 0x4000, 0x129a: 0x4000, 0x129b: 0x4000, 0x129c: 0x4000, 0x129d: 0x4000, - 0x129e: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12d0: 0x4000, 0x12d1: 0x4000, - 0x12d2: 0x4000, - 0x12e4: 0x4000, 0x12e5: 0x4000, 0x12e6: 0x4000, 0x12e7: 0x4000, - 0x12f0: 0x4000, 0x12f1: 0x4000, 0x12f2: 0x4000, 0x12f3: 0x4000, 0x12f4: 0x4000, 0x12f5: 0x4000, - 0x12f6: 0x4000, 0x12f7: 0x4000, 0x12f8: 0x4000, 0x12f9: 0x4000, 0x12fa: 0x4000, 0x12fb: 0x4000, - 0x12fc: 0x4000, 0x12fd: 0x4000, 0x12fe: 0x4000, 0x12ff: 0x4000, - // Block 0x4c, offset 0x1300 - 0x1300: 0x4000, 0x1301: 0x4000, 0x1302: 0x4000, 0x1303: 0x4000, 0x1304: 0x4000, 0x1305: 0x4000, - 0x1306: 0x4000, 0x1307: 0x4000, 0x1308: 0x4000, 0x1309: 0x4000, 0x130a: 0x4000, 0x130b: 0x4000, - 0x130c: 0x4000, 0x130d: 0x4000, 0x130e: 0x4000, 0x130f: 0x4000, 0x1310: 0x4000, 0x1311: 0x4000, - 0x1312: 0x4000, 0x1313: 0x4000, 0x1314: 0x4000, 0x1315: 0x4000, 0x1316: 0x4000, 0x1317: 0x4000, - 0x1318: 0x4000, 0x1319: 0x4000, 0x131a: 0x4000, 0x131b: 0x4000, 0x131c: 0x4000, 0x131d: 0x4000, - 0x131e: 0x4000, 0x131f: 0x4000, 0x1320: 0x4000, 0x1321: 0x4000, 0x1322: 0x4000, 0x1323: 0x4000, - 0x1324: 0x4000, 0x1325: 0x4000, 0x1326: 0x4000, 0x1327: 0x4000, 0x1328: 0x4000, 0x1329: 0x4000, - 0x132a: 0x4000, 0x132b: 0x4000, 0x132c: 0x4000, 0x132d: 0x4000, 0x132e: 0x4000, 0x132f: 0x4000, - 0x1330: 0x4000, 0x1331: 0x4000, 0x1332: 0x4000, 0x1333: 0x4000, 0x1334: 0x4000, 0x1335: 0x4000, - 0x1336: 0x4000, 0x1337: 0x4000, 0x1338: 0x4000, 0x1339: 0x4000, 0x133a: 0x4000, 0x133b: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1344: 0x4000, - // Block 0x4e, offset 0x1380 - 0x138f: 0x4000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, - 0x13d0: 0x2000, 0x13d1: 0x2000, - 0x13d2: 0x2000, 0x13d3: 0x2000, 0x13d4: 0x2000, 0x13d5: 0x2000, 0x13d6: 0x2000, 0x13d7: 0x2000, - 0x13d8: 0x2000, 0x13d9: 0x2000, 0x13da: 0x2000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, 0x13ed: 0x2000, - 0x13f0: 0x2000, 0x13f1: 0x2000, 0x13f2: 0x2000, 0x13f3: 0x2000, 0x13f4: 0x2000, 0x13f5: 0x2000, - 0x13f6: 0x2000, 0x13f7: 0x2000, 0x13f8: 0x2000, 0x13f9: 0x2000, 0x13fa: 0x2000, 0x13fb: 0x2000, - 0x13fc: 0x2000, 0x13fd: 0x2000, 0x13fe: 0x2000, 0x13ff: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x2000, 0x1401: 0x2000, 0x1402: 0x2000, 0x1403: 0x2000, 0x1404: 0x2000, 0x1405: 0x2000, - 0x1406: 0x2000, 0x1407: 0x2000, 0x1408: 0x2000, 0x1409: 0x2000, 0x140a: 0x2000, 0x140b: 0x2000, - 0x140c: 0x2000, 0x140d: 0x2000, 0x140e: 0x2000, 0x140f: 0x2000, 0x1410: 0x2000, 0x1411: 0x2000, - 0x1412: 0x2000, 0x1413: 0x2000, 0x1414: 0x2000, 0x1415: 0x2000, 0x1416: 0x2000, 0x1417: 0x2000, - 0x1418: 0x2000, 0x1419: 0x2000, 0x141a: 0x2000, 0x141b: 0x2000, 0x141c: 0x2000, 0x141d: 0x2000, - 0x141e: 0x2000, 0x141f: 0x2000, 0x1420: 0x2000, 0x1421: 0x2000, 0x1422: 0x2000, 0x1423: 0x2000, - 0x1424: 0x2000, 0x1425: 0x2000, 0x1426: 0x2000, 0x1427: 0x2000, 0x1428: 0x2000, 0x1429: 0x2000, - 0x1430: 0x2000, 0x1431: 0x2000, 0x1432: 0x2000, 0x1433: 0x2000, 0x1434: 0x2000, 0x1435: 0x2000, - 0x1436: 0x2000, 0x1437: 0x2000, 0x1438: 0x2000, 0x1439: 0x2000, 0x143a: 0x2000, 0x143b: 0x2000, - 0x143c: 0x2000, 0x143d: 0x2000, 0x143e: 0x2000, 0x143f: 0x2000, - // Block 0x51, offset 0x1440 - 0x1440: 0x2000, 0x1441: 0x2000, 0x1442: 0x2000, 0x1443: 0x2000, 0x1444: 0x2000, 0x1445: 0x2000, - 0x1446: 0x2000, 0x1447: 0x2000, 0x1448: 0x2000, 0x1449: 0x2000, 0x144a: 0x2000, 0x144b: 0x2000, - 0x144c: 0x2000, 0x144d: 0x2000, 0x144e: 0x4000, 0x144f: 0x2000, 0x1450: 0x2000, 0x1451: 0x4000, - 0x1452: 0x4000, 0x1453: 0x4000, 0x1454: 0x4000, 0x1455: 0x4000, 0x1456: 0x4000, 0x1457: 0x4000, - 0x1458: 0x4000, 0x1459: 0x4000, 0x145a: 0x4000, 0x145b: 0x2000, 0x145c: 0x2000, 0x145d: 0x2000, - 0x145e: 0x2000, 0x145f: 0x2000, 0x1460: 0x2000, 0x1461: 0x2000, 0x1462: 0x2000, 0x1463: 0x2000, - 0x1464: 0x2000, 0x1465: 0x2000, 0x1466: 0x2000, 0x1467: 0x2000, 0x1468: 0x2000, 0x1469: 0x2000, - 0x146a: 0x2000, 0x146b: 0x2000, 0x146c: 0x2000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, - 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, 0x14a1: 0x4000, 0x14a2: 0x4000, 0x14a3: 0x4000, - 0x14a4: 0x4000, 0x14a5: 0x4000, 0x14a6: 0x4000, 0x14a7: 0x4000, 0x14a8: 0x4000, 0x14a9: 0x4000, - 0x14aa: 0x4000, 0x14ab: 0x4000, 0x14ac: 0x4000, 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b6: 0x4000, 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, - 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, 0x1514: 0x4000, 0x1515: 0x4000, 0x1516: 0x4000, 0x1517: 0x4000, - 0x1518: 0x4000, 0x1519: 0x4000, 0x151a: 0x4000, 0x151b: 0x4000, 0x151c: 0x4000, 0x151d: 0x4000, - 0x151e: 0x4000, 0x151f: 0x4000, 0x1520: 0x4000, - 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, 0x154b: 0x4000, - 0x154c: 0x4000, 0x154d: 0x4000, 0x154e: 0x4000, 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, 0x1554: 0x4000, 0x1555: 0x4000, 0x1556: 0x4000, 0x1557: 0x4000, - 0x1558: 0x4000, 0x1559: 0x4000, 0x155a: 0x4000, 0x155b: 0x4000, 0x155c: 0x4000, 0x155d: 0x4000, - 0x155e: 0x4000, 0x155f: 0x4000, 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1571: 0x4000, 0x1572: 0x4000, 0x1573: 0x4000, 0x1574: 0x4000, 0x1575: 0x4000, - 0x1576: 0x4000, 0x1577: 0x4000, 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1581: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, - 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, - 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, - 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f4: 0x4000, - 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15fd: 0x4000, 0x15fe: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, 0x163e: 0x4000, 0x163f: 0x4000, - // Block 0x59, offset 0x1640 - 0x1640: 0x4000, 0x1641: 0x4000, 0x1642: 0x4000, 0x1643: 0x4000, 0x1644: 0x4000, 0x1645: 0x4000, - 0x1646: 0x4000, 0x1647: 0x4000, 0x1648: 0x4000, 0x1649: 0x4000, 0x164a: 0x4000, 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x164f: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, 0x1668: 0x4000, 0x1669: 0x4000, - 0x166a: 0x4000, 0x166b: 0x4000, 0x166c: 0x4000, 0x166d: 0x4000, 0x166e: 0x4000, 0x166f: 0x4000, - 0x1670: 0x4000, 0x1671: 0x4000, 0x1672: 0x4000, 0x1673: 0x4000, 0x1674: 0x4000, 0x1675: 0x4000, - 0x1676: 0x4000, 0x1677: 0x4000, 0x1678: 0x4000, 0x1679: 0x4000, 0x167a: 0x4000, 0x167b: 0x4000, - 0x167c: 0x4000, 0x167f: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1680: 0x4000, 0x1681: 0x4000, 0x1682: 0x4000, 0x1683: 0x4000, 0x1684: 0x4000, 0x1685: 0x4000, - 0x1686: 0x4000, 0x1687: 0x4000, 0x1688: 0x4000, 0x1689: 0x4000, 0x168a: 0x4000, 0x168b: 0x4000, - 0x168c: 0x4000, 0x168d: 0x4000, 0x168e: 0x4000, 0x168f: 0x4000, 0x1690: 0x4000, 0x1691: 0x4000, - 0x1692: 0x4000, 0x1693: 0x4000, 0x1694: 0x4000, 0x1695: 0x4000, 0x1696: 0x4000, 0x1697: 0x4000, - 0x1698: 0x4000, 0x1699: 0x4000, 0x169a: 0x4000, 0x169b: 0x4000, 0x169c: 0x4000, 0x169d: 0x4000, - 0x169e: 0x4000, 0x169f: 0x4000, 0x16a0: 0x4000, 0x16a1: 0x4000, 0x16a2: 0x4000, 0x16a3: 0x4000, - 0x16a4: 0x4000, 0x16a5: 0x4000, 0x16a6: 0x4000, 0x16a7: 0x4000, 0x16a8: 0x4000, 0x16a9: 0x4000, - 0x16aa: 0x4000, 0x16ab: 0x4000, 0x16ac: 0x4000, 0x16ad: 0x4000, 0x16ae: 0x4000, 0x16af: 0x4000, - 0x16b0: 0x4000, 0x16b1: 0x4000, 0x16b2: 0x4000, 0x16b3: 0x4000, 0x16b4: 0x4000, 0x16b5: 0x4000, - 0x16b6: 0x4000, 0x16b7: 0x4000, 0x16b8: 0x4000, 0x16b9: 0x4000, 0x16ba: 0x4000, 0x16bb: 0x4000, - 0x16bc: 0x4000, 0x16bd: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16d0: 0x4000, 0x16d1: 0x4000, - 0x16d2: 0x4000, 0x16d3: 0x4000, 0x16d4: 0x4000, 0x16d5: 0x4000, 0x16d6: 0x4000, 0x16d7: 0x4000, - 0x16d8: 0x4000, 0x16d9: 0x4000, 0x16da: 0x4000, 0x16db: 0x4000, 0x16dc: 0x4000, 0x16dd: 0x4000, - 0x16de: 0x4000, 0x16df: 0x4000, 0x16e0: 0x4000, 0x16e1: 0x4000, 0x16e2: 0x4000, 0x16e3: 0x4000, - 0x16e4: 0x4000, 0x16e5: 0x4000, 0x16e6: 0x4000, 0x16e7: 0x4000, - 0x16fa: 0x4000, - // Block 0x5c, offset 0x1700 - 0x1715: 0x4000, 0x1716: 0x4000, - 0x1724: 0x4000, - // Block 0x5d, offset 0x1740 - 0x177b: 0x4000, - 0x177c: 0x4000, 0x177d: 0x4000, 0x177e: 0x4000, 0x177f: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1780: 0x4000, 0x1781: 0x4000, 0x1782: 0x4000, 0x1783: 0x4000, 0x1784: 0x4000, 0x1785: 0x4000, - 0x1786: 0x4000, 0x1787: 0x4000, 0x1788: 0x4000, 0x1789: 0x4000, 0x178a: 0x4000, 0x178b: 0x4000, - 0x178c: 0x4000, 0x178d: 0x4000, 0x178e: 0x4000, 0x178f: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17cc: 0x4000, 0x17d0: 0x4000, 0x17d1: 0x4000, - 0x17d2: 0x4000, 0x17d5: 0x4000, - 0x17eb: 0x4000, 0x17ec: 0x4000, - 0x17f4: 0x4000, 0x17f5: 0x4000, - 0x17f6: 0x4000, 0x17f7: 0x4000, 0x17f8: 0x4000, 0x17f9: 0x4000, 0x17fa: 0x4000, - // Block 0x60, offset 0x1800 - 0x1820: 0x4000, 0x1821: 0x4000, 0x1822: 0x4000, 0x1823: 0x4000, - 0x1824: 0x4000, 0x1825: 0x4000, 0x1826: 0x4000, 0x1827: 0x4000, 0x1828: 0x4000, 0x1829: 0x4000, - 0x182a: 0x4000, 0x182b: 0x4000, - // Block 0x61, offset 0x1840 - 0x184d: 0x4000, 0x184e: 0x4000, 0x184f: 0x4000, 0x1850: 0x4000, 0x1851: 0x4000, - 0x1852: 0x4000, 0x1853: 0x4000, 0x1854: 0x4000, 0x1855: 0x4000, 0x1856: 0x4000, 0x1857: 0x4000, - 0x1858: 0x4000, 0x1859: 0x4000, 0x185a: 0x4000, 0x185b: 0x4000, 0x185c: 0x4000, 0x185d: 0x4000, - 0x185e: 0x4000, 0x185f: 0x4000, 0x1860: 0x4000, 0x1861: 0x4000, 0x1862: 0x4000, 0x1863: 0x4000, - 0x1864: 0x4000, 0x1865: 0x4000, 0x1866: 0x4000, 0x1867: 0x4000, 0x1868: 0x4000, 0x1869: 0x4000, - 0x186a: 0x4000, 0x186b: 0x4000, 0x186c: 0x4000, 0x186d: 0x4000, 0x186e: 0x4000, 0x186f: 0x4000, - 0x1870: 0x4000, 0x1871: 0x4000, 0x1872: 0x4000, 0x1873: 0x4000, 0x1874: 0x4000, 0x1875: 0x4000, - 0x1876: 0x4000, 0x1877: 0x4000, 0x1878: 0x4000, 0x1879: 0x4000, 0x187a: 0x4000, 0x187b: 0x4000, - 0x187c: 0x4000, 0x187d: 0x4000, 0x187e: 0x4000, 0x187f: 0x4000, - // Block 0x62, offset 0x1880 - 0x1880: 0x4000, 0x1881: 0x4000, 0x1882: 0x4000, 0x1883: 0x4000, 0x1884: 0x4000, 0x1885: 0x4000, - 0x1886: 0x4000, 0x1887: 0x4000, 0x1888: 0x4000, 0x1889: 0x4000, 0x188a: 0x4000, 0x188b: 0x4000, - 0x188c: 0x4000, 0x188d: 0x4000, 0x188e: 0x4000, 0x188f: 0x4000, 0x1890: 0x4000, 0x1891: 0x4000, - 0x1892: 0x4000, 0x1893: 0x4000, 0x1894: 0x4000, 0x1895: 0x4000, 0x1896: 0x4000, 0x1897: 0x4000, - 0x1898: 0x4000, 0x1899: 0x4000, 0x189a: 0x4000, 0x189b: 0x4000, 0x189c: 0x4000, 0x189d: 0x4000, - 0x189e: 0x4000, 0x189f: 0x4000, 0x18a0: 0x4000, 0x18a1: 0x4000, 0x18a2: 0x4000, 0x18a3: 0x4000, - 0x18a4: 0x4000, 0x18a5: 0x4000, 0x18a6: 0x4000, 0x18a7: 0x4000, 0x18a8: 0x4000, 0x18a9: 0x4000, - 0x18aa: 0x4000, 0x18ab: 0x4000, 0x18ac: 0x4000, 0x18ad: 0x4000, 0x18ae: 0x4000, 0x18af: 0x4000, - 0x18b0: 0x4000, 0x18b1: 0x4000, 0x18b3: 0x4000, 0x18b4: 0x4000, 0x18b5: 0x4000, - 0x18b6: 0x4000, 0x18ba: 0x4000, 0x18bb: 0x4000, - 0x18bc: 0x4000, 0x18bd: 0x4000, 0x18be: 0x4000, 0x18bf: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, 0x18c1: 0x4000, 0x18c2: 0x4000, 0x18c3: 0x4000, 0x18c4: 0x4000, 0x18c5: 0x4000, - 0x18c6: 0x4000, 0x18c7: 0x4000, 0x18c8: 0x4000, 0x18c9: 0x4000, 0x18ca: 0x4000, 0x18cb: 0x4000, - 0x18cc: 0x4000, 0x18cd: 0x4000, 0x18ce: 0x4000, 0x18cf: 0x4000, 0x18d0: 0x4000, 0x18d1: 0x4000, - 0x18d2: 0x4000, 0x18d3: 0x4000, 0x18d4: 0x4000, 0x18d5: 0x4000, 0x18d6: 0x4000, 0x18d7: 0x4000, - 0x18d8: 0x4000, 0x18d9: 0x4000, 0x18da: 0x4000, 0x18db: 0x4000, 0x18dc: 0x4000, 0x18dd: 0x4000, - 0x18de: 0x4000, 0x18df: 0x4000, 0x18e0: 0x4000, 0x18e1: 0x4000, 0x18e2: 0x4000, - 0x18e5: 0x4000, 0x18e6: 0x4000, 0x18e7: 0x4000, 0x18e8: 0x4000, 0x18e9: 0x4000, - 0x18ea: 0x4000, 0x18ee: 0x4000, 0x18ef: 0x4000, - 0x18f0: 0x4000, 0x18f1: 0x4000, 0x18f2: 0x4000, 0x18f3: 0x4000, 0x18f4: 0x4000, 0x18f5: 0x4000, - 0x18f6: 0x4000, 0x18f7: 0x4000, 0x18f8: 0x4000, 0x18f9: 0x4000, 0x18fa: 0x4000, 0x18fb: 0x4000, - 0x18fc: 0x4000, 0x18fd: 0x4000, 0x18fe: 0x4000, 0x18ff: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x4000, 0x1901: 0x4000, 0x1902: 0x4000, 0x1903: 0x4000, 0x1904: 0x4000, 0x1905: 0x4000, - 0x1906: 0x4000, 0x1907: 0x4000, 0x1908: 0x4000, 0x1909: 0x4000, 0x190a: 0x4000, - 0x190d: 0x4000, 0x190e: 0x4000, 0x190f: 0x4000, 0x1910: 0x4000, 0x1911: 0x4000, - 0x1912: 0x4000, 0x1913: 0x4000, 0x1914: 0x4000, 0x1915: 0x4000, 0x1916: 0x4000, 0x1917: 0x4000, - 0x1918: 0x4000, 0x1919: 0x4000, 0x191a: 0x4000, 0x191b: 0x4000, 0x191c: 0x4000, 0x191d: 0x4000, - 0x191e: 0x4000, 0x191f: 0x4000, 0x1920: 0x4000, 0x1921: 0x4000, 0x1922: 0x4000, 0x1923: 0x4000, - 0x1924: 0x4000, 0x1925: 0x4000, 0x1926: 0x4000, 0x1927: 0x4000, 0x1928: 0x4000, 0x1929: 0x4000, - 0x192a: 0x4000, 0x192b: 0x4000, 0x192c: 0x4000, 0x192d: 0x4000, 0x192e: 0x4000, 0x192f: 0x4000, - 0x1930: 0x4000, 0x1931: 0x4000, 0x1932: 0x4000, 0x1933: 0x4000, 0x1934: 0x4000, 0x1935: 0x4000, - 0x1936: 0x4000, 0x1937: 0x4000, 0x1938: 0x4000, 0x1939: 0x4000, 0x193a: 0x4000, 0x193b: 0x4000, - 0x193c: 0x4000, 0x193d: 0x4000, 0x193e: 0x4000, 0x193f: 0x4000, - // Block 0x65, offset 0x1940 - 0x1970: 0x4000, 0x1971: 0x4000, 0x1972: 0x4000, 0x1973: 0x4000, - 0x1978: 0x4000, 0x1979: 0x4000, 0x197a: 0x4000, - // Block 0x66, offset 0x1980 - 0x1980: 0x4000, 0x1981: 0x4000, 0x1982: 0x4000, - 0x1990: 0x4000, 0x1991: 0x4000, - 0x1992: 0x4000, 0x1993: 0x4000, 0x1994: 0x4000, 0x1995: 0x4000, - // Block 0x67, offset 0x19c0 - 0x19c0: 0x2000, 0x19c1: 0x2000, 0x19c2: 0x2000, 0x19c3: 0x2000, 0x19c4: 0x2000, 0x19c5: 0x2000, - 0x19c6: 0x2000, 0x19c7: 0x2000, 0x19c8: 0x2000, 0x19c9: 0x2000, 0x19ca: 0x2000, 0x19cb: 0x2000, - 0x19cc: 0x2000, 0x19cd: 0x2000, 0x19ce: 0x2000, 0x19cf: 0x2000, 0x19d0: 0x2000, 0x19d1: 0x2000, - 0x19d2: 0x2000, 0x19d3: 0x2000, 0x19d4: 0x2000, 0x19d5: 0x2000, 0x19d6: 0x2000, 0x19d7: 0x2000, - 0x19d8: 0x2000, 0x19d9: 0x2000, 0x19da: 0x2000, 0x19db: 0x2000, 0x19dc: 0x2000, 0x19dd: 0x2000, - 0x19de: 0x2000, 0x19df: 0x2000, 0x19e0: 0x2000, 0x19e1: 0x2000, 0x19e2: 0x2000, 0x19e3: 0x2000, - 0x19e4: 0x2000, 0x19e5: 0x2000, 0x19e6: 0x2000, 0x19e7: 0x2000, 0x19e8: 0x2000, 0x19e9: 0x2000, - 0x19ea: 0x2000, 0x19eb: 0x2000, 0x19ec: 0x2000, 0x19ed: 0x2000, 0x19ee: 0x2000, 0x19ef: 0x2000, - 0x19f0: 0x2000, 0x19f1: 0x2000, 0x19f2: 0x2000, 0x19f3: 0x2000, 0x19f4: 0x2000, 0x19f5: 0x2000, - 0x19f6: 0x2000, 0x19f7: 0x2000, 0x19f8: 0x2000, 0x19f9: 0x2000, 0x19fa: 0x2000, 0x19fb: 0x2000, - 0x19fc: 0x2000, 0x19fd: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x3a, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3b, 0x253: 0x3c, - 0x265: 0x3d, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3e, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3f, 0x339: 0x40, 0x33c: 0x41, 0x33d: 0x42, 0x33e: 0x43, 0x33f: 0x44, - // Block 0xd, offset 0x340 - 0x37f: 0x45, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x46, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x0e, 0x3c1: 0x0e, 0x3c2: 0x0e, 0x3c3: 0x0e, 0x3c4: 0x48, 0x3c5: 0x49, 0x3c6: 0x0e, 0x3c7: 0x0e, - 0x3c8: 0x0e, 0x3c9: 0x0e, 0x3ca: 0x0e, 0x3cb: 0x4a, - // Block 0x10, offset 0x400 - 0x400: 0x4b, 0x403: 0x4c, 0x404: 0x4d, 0x405: 0x4e, 0x406: 0x4f, - 0x408: 0x50, 0x409: 0x51, 0x40c: 0x52, 0x40d: 0x53, 0x40e: 0x54, 0x40f: 0x55, - 0x410: 0x3a, 0x411: 0x56, 0x412: 0x0e, 0x413: 0x57, 0x414: 0x58, 0x415: 0x59, 0x416: 0x5a, 0x417: 0x5b, - 0x418: 0x0e, 0x419: 0x5c, 0x41a: 0x0e, 0x41b: 0x5d, 0x41f: 0x5e, - 0x424: 0x5f, 0x425: 0x60, 0x426: 0x61, 0x427: 0x62, - 0x429: 0x63, 0x42a: 0x64, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x65, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 15320 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/tables13.0.0.go b/vendor/golang.org/x/text/width/tables13.0.0.go deleted file mode 100644 index bac3f1aee..000000000 --- a/vendor/golang.org/x/text/width/tables13.0.0.go +++ /dev/null @@ -1,1352 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build go1.16 -// +build go1.16 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "13.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14848 bytes (14.50 KiB). Checksum: 17e24343536472f6. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 105 blocks, 6720 entries, 13440 bytes -// The third block is the zero block. -var widthValues = [6720]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, 0xdae: 0x4000, 0xdaf: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, 0xe3b: 0x4000, - 0xe3c: 0x4000, 0xe3d: 0x4000, 0xe3e: 0x4000, 0xe3f: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, 0xf3f: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, - // Block 0x3e, offset 0xf80 - 0xfa0: 0x4000, 0xfa1: 0x4000, 0xfa2: 0x4000, 0xfa3: 0x4000, - 0xfa4: 0x4000, 0xfa5: 0x4000, 0xfa6: 0x4000, 0xfa7: 0x4000, 0xfa8: 0x4000, 0xfa9: 0x4000, - 0xfaa: 0x4000, 0xfab: 0x4000, 0xfac: 0x4000, 0xfad: 0x4000, 0xfae: 0x4000, 0xfaf: 0x4000, - 0xfb0: 0x4000, 0xfb1: 0x4000, 0xfb2: 0x4000, 0xfb3: 0x4000, 0xfb4: 0x4000, 0xfb5: 0x4000, - 0xfb6: 0x4000, 0xfb7: 0x4000, 0xfb8: 0x4000, 0xfb9: 0x4000, 0xfba: 0x4000, 0xfbb: 0x4000, - 0xfbc: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfc0: 0x4000, 0xfc1: 0x4000, 0xfc2: 0x4000, 0xfc3: 0x4000, 0xfc4: 0x4000, 0xfc5: 0x4000, - 0xfc6: 0x4000, 0xfc7: 0x4000, 0xfc8: 0x4000, 0xfc9: 0x4000, 0xfca: 0x4000, 0xfcb: 0x4000, - 0xfcc: 0x4000, 0xfcd: 0x4000, 0xfce: 0x4000, 0xfcf: 0x4000, 0xfd0: 0x4000, 0xfd1: 0x4000, - 0xfd2: 0x4000, 0xfd3: 0x4000, 0xfd4: 0x4000, 0xfd5: 0x4000, 0xfd6: 0x4000, 0xfd7: 0x4000, - 0xfd8: 0x4000, 0xfd9: 0x4000, 0xfda: 0x4000, 0xfdb: 0x4000, 0xfdc: 0x4000, 0xfdd: 0x4000, - 0xfde: 0x4000, 0xfdf: 0x4000, 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x2000, 0x1001: 0x2000, 0x1002: 0x2000, 0x1003: 0x2000, 0x1004: 0x2000, 0x1005: 0x2000, - 0x1006: 0x2000, 0x1007: 0x2000, 0x1008: 0x2000, 0x1009: 0x2000, 0x100a: 0x2000, 0x100b: 0x2000, - 0x100c: 0x2000, 0x100d: 0x2000, 0x100e: 0x2000, 0x100f: 0x2000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, - 0x1030: 0x4000, 0x1031: 0x4000, 0x1032: 0x4000, 0x1033: 0x4000, 0x1034: 0x4000, 0x1035: 0x4000, - 0x1036: 0x4000, 0x1037: 0x4000, 0x1038: 0x4000, 0x1039: 0x4000, 0x103a: 0x4000, 0x103b: 0x4000, - 0x103c: 0x4000, 0x103d: 0x4000, 0x103e: 0x4000, 0x103f: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x4000, 0x1041: 0x4000, 0x1042: 0x4000, 0x1043: 0x4000, 0x1044: 0x4000, 0x1045: 0x4000, - 0x1046: 0x4000, 0x1047: 0x4000, 0x1048: 0x4000, 0x1049: 0x4000, 0x104a: 0x4000, 0x104b: 0x4000, - 0x104c: 0x4000, 0x104d: 0x4000, 0x104e: 0x4000, 0x104f: 0x4000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, 0x105a: 0x4000, 0x105b: 0x4000, 0x105c: 0x4000, 0x105d: 0x4000, - 0x105e: 0x4000, 0x105f: 0x4000, 0x1060: 0x4000, 0x1061: 0x4000, 0x1062: 0x4000, 0x1063: 0x4000, - 0x1064: 0x4000, 0x1065: 0x4000, 0x1066: 0x4000, 0x1068: 0x4000, 0x1069: 0x4000, - 0x106a: 0x4000, 0x106b: 0x4000, - // Block 0x42, offset 0x1080 - 0x1081: 0x9012, 0x1082: 0x9012, 0x1083: 0x9012, 0x1084: 0x9012, 0x1085: 0x9012, - 0x1086: 0x9012, 0x1087: 0x9012, 0x1088: 0x9012, 0x1089: 0x9012, 0x108a: 0x9012, 0x108b: 0x9012, - 0x108c: 0x9012, 0x108d: 0x9012, 0x108e: 0x9012, 0x108f: 0x9012, 0x1090: 0x9012, 0x1091: 0x9012, - 0x1092: 0x9012, 0x1093: 0x9012, 0x1094: 0x9012, 0x1095: 0x9012, 0x1096: 0x9012, 0x1097: 0x9012, - 0x1098: 0x9012, 0x1099: 0x9012, 0x109a: 0x9012, 0x109b: 0x9012, 0x109c: 0x9012, 0x109d: 0x9012, - 0x109e: 0x9012, 0x109f: 0x9012, 0x10a0: 0x9049, 0x10a1: 0x9049, 0x10a2: 0x9049, 0x10a3: 0x9049, - 0x10a4: 0x9049, 0x10a5: 0x9049, 0x10a6: 0x9049, 0x10a7: 0x9049, 0x10a8: 0x9049, 0x10a9: 0x9049, - 0x10aa: 0x9049, 0x10ab: 0x9049, 0x10ac: 0x9049, 0x10ad: 0x9049, 0x10ae: 0x9049, 0x10af: 0x9049, - 0x10b0: 0x9049, 0x10b1: 0x9049, 0x10b2: 0x9049, 0x10b3: 0x9049, 0x10b4: 0x9049, 0x10b5: 0x9049, - 0x10b6: 0x9049, 0x10b7: 0x9049, 0x10b8: 0x9049, 0x10b9: 0x9049, 0x10ba: 0x9049, 0x10bb: 0x9049, - 0x10bc: 0x9049, 0x10bd: 0x9049, 0x10be: 0x9049, 0x10bf: 0x9049, - // Block 0x43, offset 0x10c0 - 0x10c0: 0x9049, 0x10c1: 0x9049, 0x10c2: 0x9049, 0x10c3: 0x9049, 0x10c4: 0x9049, 0x10c5: 0x9049, - 0x10c6: 0x9049, 0x10c7: 0x9049, 0x10c8: 0x9049, 0x10c9: 0x9049, 0x10ca: 0x9049, 0x10cb: 0x9049, - 0x10cc: 0x9049, 0x10cd: 0x9049, 0x10ce: 0x9049, 0x10cf: 0x9049, 0x10d0: 0x9049, 0x10d1: 0x9049, - 0x10d2: 0x9049, 0x10d3: 0x9049, 0x10d4: 0x9049, 0x10d5: 0x9049, 0x10d6: 0x9049, 0x10d7: 0x9049, - 0x10d8: 0x9049, 0x10d9: 0x9049, 0x10da: 0x9049, 0x10db: 0x9049, 0x10dc: 0x9049, 0x10dd: 0x9049, - 0x10de: 0x9049, 0x10df: 0x904a, 0x10e0: 0x904b, 0x10e1: 0xb04c, 0x10e2: 0xb04d, 0x10e3: 0xb04d, - 0x10e4: 0xb04e, 0x10e5: 0xb04f, 0x10e6: 0xb050, 0x10e7: 0xb051, 0x10e8: 0xb052, 0x10e9: 0xb053, - 0x10ea: 0xb054, 0x10eb: 0xb055, 0x10ec: 0xb056, 0x10ed: 0xb057, 0x10ee: 0xb058, 0x10ef: 0xb059, - 0x10f0: 0xb05a, 0x10f1: 0xb05b, 0x10f2: 0xb05c, 0x10f3: 0xb05d, 0x10f4: 0xb05e, 0x10f5: 0xb05f, - 0x10f6: 0xb060, 0x10f7: 0xb061, 0x10f8: 0xb062, 0x10f9: 0xb063, 0x10fa: 0xb064, 0x10fb: 0xb065, - 0x10fc: 0xb052, 0x10fd: 0xb066, 0x10fe: 0xb067, 0x10ff: 0xb055, - // Block 0x44, offset 0x1100 - 0x1100: 0xb068, 0x1101: 0xb069, 0x1102: 0xb06a, 0x1103: 0xb06b, 0x1104: 0xb05a, 0x1105: 0xb056, - 0x1106: 0xb06c, 0x1107: 0xb06d, 0x1108: 0xb06b, 0x1109: 0xb06e, 0x110a: 0xb06b, 0x110b: 0xb06f, - 0x110c: 0xb06f, 0x110d: 0xb070, 0x110e: 0xb070, 0x110f: 0xb071, 0x1110: 0xb056, 0x1111: 0xb072, - 0x1112: 0xb073, 0x1113: 0xb072, 0x1114: 0xb074, 0x1115: 0xb073, 0x1116: 0xb075, 0x1117: 0xb075, - 0x1118: 0xb076, 0x1119: 0xb076, 0x111a: 0xb077, 0x111b: 0xb077, 0x111c: 0xb073, 0x111d: 0xb078, - 0x111e: 0xb079, 0x111f: 0xb067, 0x1120: 0xb07a, 0x1121: 0xb07b, 0x1122: 0xb07b, 0x1123: 0xb07b, - 0x1124: 0xb07b, 0x1125: 0xb07b, 0x1126: 0xb07b, 0x1127: 0xb07b, 0x1128: 0xb07b, 0x1129: 0xb07b, - 0x112a: 0xb07b, 0x112b: 0xb07b, 0x112c: 0xb07b, 0x112d: 0xb07b, 0x112e: 0xb07b, 0x112f: 0xb07b, - 0x1130: 0xb07c, 0x1131: 0xb07c, 0x1132: 0xb07c, 0x1133: 0xb07c, 0x1134: 0xb07c, 0x1135: 0xb07c, - 0x1136: 0xb07c, 0x1137: 0xb07c, 0x1138: 0xb07c, 0x1139: 0xb07c, 0x113a: 0xb07c, 0x113b: 0xb07c, - 0x113c: 0xb07c, 0x113d: 0xb07c, 0x113e: 0xb07c, - // Block 0x45, offset 0x1140 - 0x1142: 0xb07d, 0x1143: 0xb07e, 0x1144: 0xb07f, 0x1145: 0xb080, - 0x1146: 0xb07f, 0x1147: 0xb07e, 0x114a: 0xb081, 0x114b: 0xb082, - 0x114c: 0xb083, 0x114d: 0xb07f, 0x114e: 0xb080, 0x114f: 0xb07f, - 0x1152: 0xb084, 0x1153: 0xb085, 0x1154: 0xb084, 0x1155: 0xb086, 0x1156: 0xb084, 0x1157: 0xb087, - 0x115a: 0xb088, 0x115b: 0xb089, 0x115c: 0xb08a, - 0x1160: 0x908b, 0x1161: 0x908b, 0x1162: 0x908c, 0x1163: 0x908d, - 0x1164: 0x908b, 0x1165: 0x908e, 0x1166: 0x908f, 0x1168: 0xb090, 0x1169: 0xb091, - 0x116a: 0xb092, 0x116b: 0xb091, 0x116c: 0xb093, 0x116d: 0xb094, 0x116e: 0xb095, - 0x117d: 0x2000, - // Block 0x46, offset 0x1180 - 0x11a0: 0x4000, 0x11a1: 0x4000, 0x11a2: 0x4000, 0x11a3: 0x4000, - 0x11a4: 0x4000, - 0x11b0: 0x4000, 0x11b1: 0x4000, - // Block 0x47, offset 0x11c0 - 0x11c0: 0x4000, 0x11c1: 0x4000, 0x11c2: 0x4000, 0x11c3: 0x4000, 0x11c4: 0x4000, 0x11c5: 0x4000, - 0x11c6: 0x4000, 0x11c7: 0x4000, 0x11c8: 0x4000, 0x11c9: 0x4000, 0x11ca: 0x4000, 0x11cb: 0x4000, - 0x11cc: 0x4000, 0x11cd: 0x4000, 0x11ce: 0x4000, 0x11cf: 0x4000, 0x11d0: 0x4000, 0x11d1: 0x4000, - 0x11d2: 0x4000, 0x11d3: 0x4000, 0x11d4: 0x4000, 0x11d5: 0x4000, 0x11d6: 0x4000, 0x11d7: 0x4000, - 0x11d8: 0x4000, 0x11d9: 0x4000, 0x11da: 0x4000, 0x11db: 0x4000, 0x11dc: 0x4000, 0x11dd: 0x4000, - 0x11de: 0x4000, 0x11df: 0x4000, 0x11e0: 0x4000, 0x11e1: 0x4000, 0x11e2: 0x4000, 0x11e3: 0x4000, - 0x11e4: 0x4000, 0x11e5: 0x4000, 0x11e6: 0x4000, 0x11e7: 0x4000, 0x11e8: 0x4000, 0x11e9: 0x4000, - 0x11ea: 0x4000, 0x11eb: 0x4000, 0x11ec: 0x4000, 0x11ed: 0x4000, 0x11ee: 0x4000, 0x11ef: 0x4000, - 0x11f0: 0x4000, 0x11f1: 0x4000, 0x11f2: 0x4000, 0x11f3: 0x4000, 0x11f4: 0x4000, 0x11f5: 0x4000, - 0x11f6: 0x4000, 0x11f7: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, 0x1282: 0x4000, 0x1283: 0x4000, 0x1284: 0x4000, 0x1285: 0x4000, - 0x1286: 0x4000, 0x1287: 0x4000, 0x1288: 0x4000, 0x1289: 0x4000, 0x128a: 0x4000, 0x128b: 0x4000, - 0x128c: 0x4000, 0x128d: 0x4000, 0x128e: 0x4000, 0x128f: 0x4000, 0x1290: 0x4000, 0x1291: 0x4000, - 0x1292: 0x4000, 0x1293: 0x4000, 0x1294: 0x4000, 0x1295: 0x4000, 0x1296: 0x4000, 0x1297: 0x4000, - 0x1298: 0x4000, 0x1299: 0x4000, 0x129a: 0x4000, 0x129b: 0x4000, 0x129c: 0x4000, 0x129d: 0x4000, - 0x129e: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12d0: 0x4000, 0x12d1: 0x4000, - 0x12d2: 0x4000, - 0x12e4: 0x4000, 0x12e5: 0x4000, 0x12e6: 0x4000, 0x12e7: 0x4000, - 0x12f0: 0x4000, 0x12f1: 0x4000, 0x12f2: 0x4000, 0x12f3: 0x4000, 0x12f4: 0x4000, 0x12f5: 0x4000, - 0x12f6: 0x4000, 0x12f7: 0x4000, 0x12f8: 0x4000, 0x12f9: 0x4000, 0x12fa: 0x4000, 0x12fb: 0x4000, - 0x12fc: 0x4000, 0x12fd: 0x4000, 0x12fe: 0x4000, 0x12ff: 0x4000, - // Block 0x4c, offset 0x1300 - 0x1300: 0x4000, 0x1301: 0x4000, 0x1302: 0x4000, 0x1303: 0x4000, 0x1304: 0x4000, 0x1305: 0x4000, - 0x1306: 0x4000, 0x1307: 0x4000, 0x1308: 0x4000, 0x1309: 0x4000, 0x130a: 0x4000, 0x130b: 0x4000, - 0x130c: 0x4000, 0x130d: 0x4000, 0x130e: 0x4000, 0x130f: 0x4000, 0x1310: 0x4000, 0x1311: 0x4000, - 0x1312: 0x4000, 0x1313: 0x4000, 0x1314: 0x4000, 0x1315: 0x4000, 0x1316: 0x4000, 0x1317: 0x4000, - 0x1318: 0x4000, 0x1319: 0x4000, 0x131a: 0x4000, 0x131b: 0x4000, 0x131c: 0x4000, 0x131d: 0x4000, - 0x131e: 0x4000, 0x131f: 0x4000, 0x1320: 0x4000, 0x1321: 0x4000, 0x1322: 0x4000, 0x1323: 0x4000, - 0x1324: 0x4000, 0x1325: 0x4000, 0x1326: 0x4000, 0x1327: 0x4000, 0x1328: 0x4000, 0x1329: 0x4000, - 0x132a: 0x4000, 0x132b: 0x4000, 0x132c: 0x4000, 0x132d: 0x4000, 0x132e: 0x4000, 0x132f: 0x4000, - 0x1330: 0x4000, 0x1331: 0x4000, 0x1332: 0x4000, 0x1333: 0x4000, 0x1334: 0x4000, 0x1335: 0x4000, - 0x1336: 0x4000, 0x1337: 0x4000, 0x1338: 0x4000, 0x1339: 0x4000, 0x133a: 0x4000, 0x133b: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1344: 0x4000, - // Block 0x4e, offset 0x1380 - 0x138f: 0x4000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, - 0x13d0: 0x2000, 0x13d1: 0x2000, - 0x13d2: 0x2000, 0x13d3: 0x2000, 0x13d4: 0x2000, 0x13d5: 0x2000, 0x13d6: 0x2000, 0x13d7: 0x2000, - 0x13d8: 0x2000, 0x13d9: 0x2000, 0x13da: 0x2000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, 0x13ed: 0x2000, - 0x13f0: 0x2000, 0x13f1: 0x2000, 0x13f2: 0x2000, 0x13f3: 0x2000, 0x13f4: 0x2000, 0x13f5: 0x2000, - 0x13f6: 0x2000, 0x13f7: 0x2000, 0x13f8: 0x2000, 0x13f9: 0x2000, 0x13fa: 0x2000, 0x13fb: 0x2000, - 0x13fc: 0x2000, 0x13fd: 0x2000, 0x13fe: 0x2000, 0x13ff: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x2000, 0x1401: 0x2000, 0x1402: 0x2000, 0x1403: 0x2000, 0x1404: 0x2000, 0x1405: 0x2000, - 0x1406: 0x2000, 0x1407: 0x2000, 0x1408: 0x2000, 0x1409: 0x2000, 0x140a: 0x2000, 0x140b: 0x2000, - 0x140c: 0x2000, 0x140d: 0x2000, 0x140e: 0x2000, 0x140f: 0x2000, 0x1410: 0x2000, 0x1411: 0x2000, - 0x1412: 0x2000, 0x1413: 0x2000, 0x1414: 0x2000, 0x1415: 0x2000, 0x1416: 0x2000, 0x1417: 0x2000, - 0x1418: 0x2000, 0x1419: 0x2000, 0x141a: 0x2000, 0x141b: 0x2000, 0x141c: 0x2000, 0x141d: 0x2000, - 0x141e: 0x2000, 0x141f: 0x2000, 0x1420: 0x2000, 0x1421: 0x2000, 0x1422: 0x2000, 0x1423: 0x2000, - 0x1424: 0x2000, 0x1425: 0x2000, 0x1426: 0x2000, 0x1427: 0x2000, 0x1428: 0x2000, 0x1429: 0x2000, - 0x1430: 0x2000, 0x1431: 0x2000, 0x1432: 0x2000, 0x1433: 0x2000, 0x1434: 0x2000, 0x1435: 0x2000, - 0x1436: 0x2000, 0x1437: 0x2000, 0x1438: 0x2000, 0x1439: 0x2000, 0x143a: 0x2000, 0x143b: 0x2000, - 0x143c: 0x2000, 0x143d: 0x2000, 0x143e: 0x2000, 0x143f: 0x2000, - // Block 0x51, offset 0x1440 - 0x1440: 0x2000, 0x1441: 0x2000, 0x1442: 0x2000, 0x1443: 0x2000, 0x1444: 0x2000, 0x1445: 0x2000, - 0x1446: 0x2000, 0x1447: 0x2000, 0x1448: 0x2000, 0x1449: 0x2000, 0x144a: 0x2000, 0x144b: 0x2000, - 0x144c: 0x2000, 0x144d: 0x2000, 0x144e: 0x4000, 0x144f: 0x2000, 0x1450: 0x2000, 0x1451: 0x4000, - 0x1452: 0x4000, 0x1453: 0x4000, 0x1454: 0x4000, 0x1455: 0x4000, 0x1456: 0x4000, 0x1457: 0x4000, - 0x1458: 0x4000, 0x1459: 0x4000, 0x145a: 0x4000, 0x145b: 0x2000, 0x145c: 0x2000, 0x145d: 0x2000, - 0x145e: 0x2000, 0x145f: 0x2000, 0x1460: 0x2000, 0x1461: 0x2000, 0x1462: 0x2000, 0x1463: 0x2000, - 0x1464: 0x2000, 0x1465: 0x2000, 0x1466: 0x2000, 0x1467: 0x2000, 0x1468: 0x2000, 0x1469: 0x2000, - 0x146a: 0x2000, 0x146b: 0x2000, 0x146c: 0x2000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, - 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, 0x14a1: 0x4000, 0x14a2: 0x4000, 0x14a3: 0x4000, - 0x14a4: 0x4000, 0x14a5: 0x4000, 0x14a6: 0x4000, 0x14a7: 0x4000, 0x14a8: 0x4000, 0x14a9: 0x4000, - 0x14aa: 0x4000, 0x14ab: 0x4000, 0x14ac: 0x4000, 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b6: 0x4000, 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, - 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, 0x1514: 0x4000, 0x1515: 0x4000, 0x1516: 0x4000, 0x1517: 0x4000, - 0x1518: 0x4000, 0x1519: 0x4000, 0x151a: 0x4000, 0x151b: 0x4000, 0x151c: 0x4000, 0x151d: 0x4000, - 0x151e: 0x4000, 0x151f: 0x4000, 0x1520: 0x4000, - 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, 0x154b: 0x4000, - 0x154c: 0x4000, 0x154d: 0x4000, 0x154e: 0x4000, 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, 0x1554: 0x4000, 0x1555: 0x4000, 0x1556: 0x4000, 0x1557: 0x4000, - 0x1558: 0x4000, 0x1559: 0x4000, 0x155a: 0x4000, 0x155b: 0x4000, 0x155c: 0x4000, 0x155d: 0x4000, - 0x155e: 0x4000, 0x155f: 0x4000, 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1571: 0x4000, 0x1572: 0x4000, 0x1573: 0x4000, 0x1574: 0x4000, 0x1575: 0x4000, - 0x1576: 0x4000, 0x1577: 0x4000, 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1581: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, - 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, - 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, - 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f4: 0x4000, - 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15fd: 0x4000, 0x15fe: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1601: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, 0x163e: 0x4000, - // Block 0x59, offset 0x1640 - 0x1640: 0x4000, 0x1642: 0x4000, 0x1643: 0x4000, 0x1644: 0x4000, 0x1645: 0x4000, - 0x1646: 0x4000, 0x1647: 0x4000, 0x1648: 0x4000, 0x1649: 0x4000, 0x164a: 0x4000, 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x164f: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, 0x1668: 0x4000, 0x1669: 0x4000, - 0x166a: 0x4000, 0x166b: 0x4000, 0x166c: 0x4000, 0x166d: 0x4000, 0x166e: 0x4000, 0x166f: 0x4000, - 0x1670: 0x4000, 0x1671: 0x4000, 0x1672: 0x4000, 0x1673: 0x4000, 0x1674: 0x4000, 0x1675: 0x4000, - 0x1676: 0x4000, 0x1677: 0x4000, 0x1678: 0x4000, 0x1679: 0x4000, 0x167a: 0x4000, 0x167b: 0x4000, - 0x167c: 0x4000, 0x167d: 0x4000, 0x167e: 0x4000, 0x167f: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1680: 0x4000, 0x1681: 0x4000, 0x1682: 0x4000, 0x1683: 0x4000, 0x1684: 0x4000, 0x1685: 0x4000, - 0x1686: 0x4000, 0x1687: 0x4000, 0x1688: 0x4000, 0x1689: 0x4000, 0x168a: 0x4000, 0x168b: 0x4000, - 0x168c: 0x4000, 0x168d: 0x4000, 0x168e: 0x4000, 0x168f: 0x4000, 0x1690: 0x4000, 0x1691: 0x4000, - 0x1692: 0x4000, 0x1693: 0x4000, 0x1694: 0x4000, 0x1695: 0x4000, 0x1696: 0x4000, 0x1697: 0x4000, - 0x1698: 0x4000, 0x1699: 0x4000, 0x169a: 0x4000, 0x169b: 0x4000, 0x169c: 0x4000, 0x169d: 0x4000, - 0x169e: 0x4000, 0x169f: 0x4000, 0x16a0: 0x4000, 0x16a1: 0x4000, 0x16a2: 0x4000, 0x16a3: 0x4000, - 0x16a4: 0x4000, 0x16a5: 0x4000, 0x16a6: 0x4000, 0x16a7: 0x4000, 0x16a8: 0x4000, 0x16a9: 0x4000, - 0x16aa: 0x4000, 0x16ab: 0x4000, 0x16ac: 0x4000, 0x16ad: 0x4000, 0x16ae: 0x4000, 0x16af: 0x4000, - 0x16b0: 0x4000, 0x16b1: 0x4000, 0x16b2: 0x4000, 0x16b3: 0x4000, 0x16b4: 0x4000, 0x16b5: 0x4000, - 0x16b6: 0x4000, 0x16b7: 0x4000, 0x16b8: 0x4000, 0x16b9: 0x4000, 0x16ba: 0x4000, 0x16bb: 0x4000, - 0x16bc: 0x4000, 0x16bf: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16c0: 0x4000, 0x16c1: 0x4000, 0x16c2: 0x4000, 0x16c3: 0x4000, 0x16c4: 0x4000, 0x16c5: 0x4000, - 0x16c6: 0x4000, 0x16c7: 0x4000, 0x16c8: 0x4000, 0x16c9: 0x4000, 0x16ca: 0x4000, 0x16cb: 0x4000, - 0x16cc: 0x4000, 0x16cd: 0x4000, 0x16ce: 0x4000, 0x16cf: 0x4000, 0x16d0: 0x4000, 0x16d1: 0x4000, - 0x16d2: 0x4000, 0x16d3: 0x4000, 0x16d4: 0x4000, 0x16d5: 0x4000, 0x16d6: 0x4000, 0x16d7: 0x4000, - 0x16d8: 0x4000, 0x16d9: 0x4000, 0x16da: 0x4000, 0x16db: 0x4000, 0x16dc: 0x4000, 0x16dd: 0x4000, - 0x16de: 0x4000, 0x16df: 0x4000, 0x16e0: 0x4000, 0x16e1: 0x4000, 0x16e2: 0x4000, 0x16e3: 0x4000, - 0x16e4: 0x4000, 0x16e5: 0x4000, 0x16e6: 0x4000, 0x16e7: 0x4000, 0x16e8: 0x4000, 0x16e9: 0x4000, - 0x16ea: 0x4000, 0x16eb: 0x4000, 0x16ec: 0x4000, 0x16ed: 0x4000, 0x16ee: 0x4000, 0x16ef: 0x4000, - 0x16f0: 0x4000, 0x16f1: 0x4000, 0x16f2: 0x4000, 0x16f3: 0x4000, 0x16f4: 0x4000, 0x16f5: 0x4000, - 0x16f6: 0x4000, 0x16f7: 0x4000, 0x16f8: 0x4000, 0x16f9: 0x4000, 0x16fa: 0x4000, 0x16fb: 0x4000, - 0x16fc: 0x4000, 0x16fd: 0x4000, - // Block 0x5c, offset 0x1700 - 0x170b: 0x4000, - 0x170c: 0x4000, 0x170d: 0x4000, 0x170e: 0x4000, 0x1710: 0x4000, 0x1711: 0x4000, - 0x1712: 0x4000, 0x1713: 0x4000, 0x1714: 0x4000, 0x1715: 0x4000, 0x1716: 0x4000, 0x1717: 0x4000, - 0x1718: 0x4000, 0x1719: 0x4000, 0x171a: 0x4000, 0x171b: 0x4000, 0x171c: 0x4000, 0x171d: 0x4000, - 0x171e: 0x4000, 0x171f: 0x4000, 0x1720: 0x4000, 0x1721: 0x4000, 0x1722: 0x4000, 0x1723: 0x4000, - 0x1724: 0x4000, 0x1725: 0x4000, 0x1726: 0x4000, 0x1727: 0x4000, - 0x173a: 0x4000, - // Block 0x5d, offset 0x1740 - 0x1755: 0x4000, 0x1756: 0x4000, - 0x1764: 0x4000, - // Block 0x5e, offset 0x1780 - 0x17bb: 0x4000, - 0x17bc: 0x4000, 0x17bd: 0x4000, 0x17be: 0x4000, 0x17bf: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17c6: 0x4000, 0x17c7: 0x4000, 0x17c8: 0x4000, 0x17c9: 0x4000, 0x17ca: 0x4000, 0x17cb: 0x4000, - 0x17cc: 0x4000, 0x17cd: 0x4000, 0x17ce: 0x4000, 0x17cf: 0x4000, - // Block 0x60, offset 0x1800 - 0x1800: 0x4000, 0x1801: 0x4000, 0x1802: 0x4000, 0x1803: 0x4000, 0x1804: 0x4000, 0x1805: 0x4000, - 0x180c: 0x4000, 0x1810: 0x4000, 0x1811: 0x4000, - 0x1812: 0x4000, 0x1815: 0x4000, 0x1816: 0x4000, 0x1817: 0x4000, - 0x182b: 0x4000, 0x182c: 0x4000, - 0x1834: 0x4000, 0x1835: 0x4000, - 0x1836: 0x4000, 0x1837: 0x4000, 0x1838: 0x4000, 0x1839: 0x4000, 0x183a: 0x4000, 0x183b: 0x4000, - 0x183c: 0x4000, - // Block 0x61, offset 0x1840 - 0x1860: 0x4000, 0x1861: 0x4000, 0x1862: 0x4000, 0x1863: 0x4000, - 0x1864: 0x4000, 0x1865: 0x4000, 0x1866: 0x4000, 0x1867: 0x4000, 0x1868: 0x4000, 0x1869: 0x4000, - 0x186a: 0x4000, 0x186b: 0x4000, - // Block 0x62, offset 0x1880 - 0x188c: 0x4000, 0x188d: 0x4000, 0x188e: 0x4000, 0x188f: 0x4000, 0x1890: 0x4000, 0x1891: 0x4000, - 0x1892: 0x4000, 0x1893: 0x4000, 0x1894: 0x4000, 0x1895: 0x4000, 0x1896: 0x4000, 0x1897: 0x4000, - 0x1898: 0x4000, 0x1899: 0x4000, 0x189a: 0x4000, 0x189b: 0x4000, 0x189c: 0x4000, 0x189d: 0x4000, - 0x189e: 0x4000, 0x189f: 0x4000, 0x18a0: 0x4000, 0x18a1: 0x4000, 0x18a2: 0x4000, 0x18a3: 0x4000, - 0x18a4: 0x4000, 0x18a5: 0x4000, 0x18a6: 0x4000, 0x18a7: 0x4000, 0x18a8: 0x4000, 0x18a9: 0x4000, - 0x18aa: 0x4000, 0x18ab: 0x4000, 0x18ac: 0x4000, 0x18ad: 0x4000, 0x18ae: 0x4000, 0x18af: 0x4000, - 0x18b0: 0x4000, 0x18b1: 0x4000, 0x18b2: 0x4000, 0x18b3: 0x4000, 0x18b4: 0x4000, 0x18b5: 0x4000, - 0x18b6: 0x4000, 0x18b7: 0x4000, 0x18b8: 0x4000, 0x18b9: 0x4000, 0x18ba: 0x4000, - 0x18bc: 0x4000, 0x18bd: 0x4000, 0x18be: 0x4000, 0x18bf: 0x4000, - // Block 0x63, offset 0x18c0 - 0x18c0: 0x4000, 0x18c1: 0x4000, 0x18c2: 0x4000, 0x18c3: 0x4000, 0x18c4: 0x4000, 0x18c5: 0x4000, - 0x18c7: 0x4000, 0x18c8: 0x4000, 0x18c9: 0x4000, 0x18ca: 0x4000, 0x18cb: 0x4000, - 0x18cc: 0x4000, 0x18cd: 0x4000, 0x18ce: 0x4000, 0x18cf: 0x4000, 0x18d0: 0x4000, 0x18d1: 0x4000, - 0x18d2: 0x4000, 0x18d3: 0x4000, 0x18d4: 0x4000, 0x18d5: 0x4000, 0x18d6: 0x4000, 0x18d7: 0x4000, - 0x18d8: 0x4000, 0x18d9: 0x4000, 0x18da: 0x4000, 0x18db: 0x4000, 0x18dc: 0x4000, 0x18dd: 0x4000, - 0x18de: 0x4000, 0x18df: 0x4000, 0x18e0: 0x4000, 0x18e1: 0x4000, 0x18e2: 0x4000, 0x18e3: 0x4000, - 0x18e4: 0x4000, 0x18e5: 0x4000, 0x18e6: 0x4000, 0x18e7: 0x4000, 0x18e8: 0x4000, 0x18e9: 0x4000, - 0x18ea: 0x4000, 0x18eb: 0x4000, 0x18ec: 0x4000, 0x18ed: 0x4000, 0x18ee: 0x4000, 0x18ef: 0x4000, - 0x18f0: 0x4000, 0x18f1: 0x4000, 0x18f2: 0x4000, 0x18f3: 0x4000, 0x18f4: 0x4000, 0x18f5: 0x4000, - 0x18f6: 0x4000, 0x18f7: 0x4000, 0x18f8: 0x4000, 0x18fa: 0x4000, 0x18fb: 0x4000, - 0x18fc: 0x4000, 0x18fd: 0x4000, 0x18fe: 0x4000, 0x18ff: 0x4000, - // Block 0x64, offset 0x1900 - 0x1900: 0x4000, 0x1901: 0x4000, 0x1902: 0x4000, 0x1903: 0x4000, 0x1904: 0x4000, 0x1905: 0x4000, - 0x1906: 0x4000, 0x1907: 0x4000, 0x1908: 0x4000, 0x1909: 0x4000, 0x190a: 0x4000, 0x190b: 0x4000, - 0x190d: 0x4000, 0x190e: 0x4000, 0x190f: 0x4000, 0x1910: 0x4000, 0x1911: 0x4000, - 0x1912: 0x4000, 0x1913: 0x4000, 0x1914: 0x4000, 0x1915: 0x4000, 0x1916: 0x4000, 0x1917: 0x4000, - 0x1918: 0x4000, 0x1919: 0x4000, 0x191a: 0x4000, 0x191b: 0x4000, 0x191c: 0x4000, 0x191d: 0x4000, - 0x191e: 0x4000, 0x191f: 0x4000, 0x1920: 0x4000, 0x1921: 0x4000, 0x1922: 0x4000, 0x1923: 0x4000, - 0x1924: 0x4000, 0x1925: 0x4000, 0x1926: 0x4000, 0x1927: 0x4000, 0x1928: 0x4000, 0x1929: 0x4000, - 0x192a: 0x4000, 0x192b: 0x4000, 0x192c: 0x4000, 0x192d: 0x4000, 0x192e: 0x4000, 0x192f: 0x4000, - 0x1930: 0x4000, 0x1931: 0x4000, 0x1932: 0x4000, 0x1933: 0x4000, 0x1934: 0x4000, 0x1935: 0x4000, - 0x1936: 0x4000, 0x1937: 0x4000, 0x1938: 0x4000, 0x1939: 0x4000, 0x193a: 0x4000, 0x193b: 0x4000, - 0x193c: 0x4000, 0x193d: 0x4000, 0x193e: 0x4000, 0x193f: 0x4000, - // Block 0x65, offset 0x1940 - 0x1970: 0x4000, 0x1971: 0x4000, 0x1972: 0x4000, 0x1973: 0x4000, 0x1974: 0x4000, - 0x1978: 0x4000, 0x1979: 0x4000, 0x197a: 0x4000, - // Block 0x66, offset 0x1980 - 0x1980: 0x4000, 0x1981: 0x4000, 0x1982: 0x4000, 0x1983: 0x4000, 0x1984: 0x4000, 0x1985: 0x4000, - 0x1986: 0x4000, - 0x1990: 0x4000, 0x1991: 0x4000, - 0x1992: 0x4000, 0x1993: 0x4000, 0x1994: 0x4000, 0x1995: 0x4000, 0x1996: 0x4000, 0x1997: 0x4000, - 0x1998: 0x4000, 0x1999: 0x4000, 0x199a: 0x4000, 0x199b: 0x4000, 0x199c: 0x4000, 0x199d: 0x4000, - 0x199e: 0x4000, 0x199f: 0x4000, 0x19a0: 0x4000, 0x19a1: 0x4000, 0x19a2: 0x4000, 0x19a3: 0x4000, - 0x19a4: 0x4000, 0x19a5: 0x4000, 0x19a6: 0x4000, 0x19a7: 0x4000, 0x19a8: 0x4000, - 0x19b0: 0x4000, 0x19b1: 0x4000, 0x19b2: 0x4000, 0x19b3: 0x4000, 0x19b4: 0x4000, 0x19b5: 0x4000, - 0x19b6: 0x4000, - // Block 0x67, offset 0x19c0 - 0x19c0: 0x4000, 0x19c1: 0x4000, 0x19c2: 0x4000, - 0x19d0: 0x4000, 0x19d1: 0x4000, - 0x19d2: 0x4000, 0x19d3: 0x4000, 0x19d4: 0x4000, 0x19d5: 0x4000, 0x19d6: 0x4000, - // Block 0x68, offset 0x1a00 - 0x1a00: 0x2000, 0x1a01: 0x2000, 0x1a02: 0x2000, 0x1a03: 0x2000, 0x1a04: 0x2000, 0x1a05: 0x2000, - 0x1a06: 0x2000, 0x1a07: 0x2000, 0x1a08: 0x2000, 0x1a09: 0x2000, 0x1a0a: 0x2000, 0x1a0b: 0x2000, - 0x1a0c: 0x2000, 0x1a0d: 0x2000, 0x1a0e: 0x2000, 0x1a0f: 0x2000, 0x1a10: 0x2000, 0x1a11: 0x2000, - 0x1a12: 0x2000, 0x1a13: 0x2000, 0x1a14: 0x2000, 0x1a15: 0x2000, 0x1a16: 0x2000, 0x1a17: 0x2000, - 0x1a18: 0x2000, 0x1a19: 0x2000, 0x1a1a: 0x2000, 0x1a1b: 0x2000, 0x1a1c: 0x2000, 0x1a1d: 0x2000, - 0x1a1e: 0x2000, 0x1a1f: 0x2000, 0x1a20: 0x2000, 0x1a21: 0x2000, 0x1a22: 0x2000, 0x1a23: 0x2000, - 0x1a24: 0x2000, 0x1a25: 0x2000, 0x1a26: 0x2000, 0x1a27: 0x2000, 0x1a28: 0x2000, 0x1a29: 0x2000, - 0x1a2a: 0x2000, 0x1a2b: 0x2000, 0x1a2c: 0x2000, 0x1a2d: 0x2000, 0x1a2e: 0x2000, 0x1a2f: 0x2000, - 0x1a30: 0x2000, 0x1a31: 0x2000, 0x1a32: 0x2000, 0x1a33: 0x2000, 0x1a34: 0x2000, 0x1a35: 0x2000, - 0x1a36: 0x2000, 0x1a37: 0x2000, 0x1a38: 0x2000, 0x1a39: 0x2000, 0x1a3a: 0x2000, 0x1a3b: 0x2000, - 0x1a3c: 0x2000, 0x1a3d: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x0e, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3a, 0x253: 0x3b, - 0x265: 0x3c, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3d, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3e, 0x339: 0x3f, 0x33c: 0x40, 0x33d: 0x41, 0x33e: 0x42, 0x33f: 0x43, - // Block 0xd, offset 0x340 - 0x37f: 0x44, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x45, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x0e, 0x3ac: 0x0e, 0x3ad: 0x0e, 0x3ae: 0x0e, 0x3af: 0x0e, - 0x3b0: 0x0e, 0x3b1: 0x0e, 0x3b2: 0x0e, 0x3b3: 0x46, 0x3b4: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x0e, 0x3c1: 0x0e, 0x3c2: 0x0e, 0x3c3: 0x0e, 0x3c4: 0x48, 0x3c5: 0x49, 0x3c6: 0x0e, 0x3c7: 0x0e, - 0x3c8: 0x0e, 0x3c9: 0x0e, 0x3ca: 0x0e, 0x3cb: 0x4a, - // Block 0x10, offset 0x400 - 0x400: 0x4b, 0x403: 0x4c, 0x404: 0x4d, 0x405: 0x4e, 0x406: 0x4f, - 0x408: 0x50, 0x409: 0x51, 0x40c: 0x52, 0x40d: 0x53, 0x40e: 0x54, 0x40f: 0x55, - 0x410: 0x56, 0x411: 0x57, 0x412: 0x0e, 0x413: 0x58, 0x414: 0x59, 0x415: 0x5a, 0x416: 0x5b, 0x417: 0x5c, - 0x418: 0x0e, 0x419: 0x5d, 0x41a: 0x0e, 0x41b: 0x5e, 0x41f: 0x5f, - 0x424: 0x60, 0x425: 0x61, 0x426: 0x0e, 0x427: 0x62, - 0x429: 0x63, 0x42a: 0x64, 0x42b: 0x65, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x66, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 15448 bytes (15KiB) diff --git a/vendor/golang.org/x/text/width/tables9.0.0.go b/vendor/golang.org/x/text/width/tables9.0.0.go deleted file mode 100644 index b3db84f6f..000000000 --- a/vendor/golang.org/x/text/width/tables9.0.0.go +++ /dev/null @@ -1,1287 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -//go:build !go1.10 -// +build !go1.10 - -package width - -// UnicodeVersion is the Unicode version from which the tables in this package are derived. -const UnicodeVersion = "9.0.0" - -// lookup returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookup(s []byte) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupUnsafe(s []byte) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// lookupString returns the trie value for the first UTF-8 encoding in s and -// the width in bytes of this encoding. The size will be 0 if s does not -// hold enough bytes to complete the encoding. len(s) must be greater than 0. -func (t *widthTrie) lookupString(s string) (v uint16, sz int) { - c0 := s[0] - switch { - case c0 < 0x80: // is ASCII - return widthValues[c0], 1 - case c0 < 0xC2: - return 0, 1 // Illegal UTF-8: not a starter, not ASCII. - case c0 < 0xE0: // 2-byte UTF-8 - if len(s) < 2 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c1), 2 - case c0 < 0xF0: // 3-byte UTF-8 - if len(s) < 3 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c2), 3 - case c0 < 0xF8: // 4-byte UTF-8 - if len(s) < 4 { - return 0, 0 - } - i := widthIndex[c0] - c1 := s[1] - if c1 < 0x80 || 0xC0 <= c1 { - return 0, 1 // Illegal UTF-8: not a continuation byte. - } - o := uint32(i)<<6 + uint32(c1) - i = widthIndex[o] - c2 := s[2] - if c2 < 0x80 || 0xC0 <= c2 { - return 0, 2 // Illegal UTF-8: not a continuation byte. - } - o = uint32(i)<<6 + uint32(c2) - i = widthIndex[o] - c3 := s[3] - if c3 < 0x80 || 0xC0 <= c3 { - return 0, 3 // Illegal UTF-8: not a continuation byte. - } - return t.lookupValue(uint32(i), c3), 4 - } - // Illegal rune - return 0, 1 -} - -// lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. -// s must start with a full and valid UTF-8 encoded rune. -func (t *widthTrie) lookupStringUnsafe(s string) uint16 { - c0 := s[0] - if c0 < 0x80 { // is ASCII - return widthValues[c0] - } - i := widthIndex[c0] - if c0 < 0xE0 { // 2-byte UTF-8 - return t.lookupValue(uint32(i), s[1]) - } - i = widthIndex[uint32(i)<<6+uint32(s[1])] - if c0 < 0xF0 { // 3-byte UTF-8 - return t.lookupValue(uint32(i), s[2]) - } - i = widthIndex[uint32(i)<<6+uint32(s[2])] - if c0 < 0xF8 { // 4-byte UTF-8 - return t.lookupValue(uint32(i), s[3]) - } - return 0 -} - -// widthTrie. Total size: 14080 bytes (13.75 KiB). Checksum: 3b8aeb3dc03667a3. -type widthTrie struct{} - -func newWidthTrie(i int) *widthTrie { - return &widthTrie{} -} - -// lookupValue determines the type of block n and looks up the value for b. -func (t *widthTrie) lookupValue(n uint32, b byte) uint16 { - switch { - default: - return uint16(widthValues[n<<6+uint32(b)]) - } -} - -// widthValues: 99 blocks, 6336 entries, 12672 bytes -// The third block is the zero block. -var widthValues = [6336]uint16{ - // Block 0x0, offset 0x0 - 0x20: 0x6001, 0x21: 0x6002, 0x22: 0x6002, 0x23: 0x6002, - 0x24: 0x6002, 0x25: 0x6002, 0x26: 0x6002, 0x27: 0x6002, 0x28: 0x6002, 0x29: 0x6002, - 0x2a: 0x6002, 0x2b: 0x6002, 0x2c: 0x6002, 0x2d: 0x6002, 0x2e: 0x6002, 0x2f: 0x6002, - 0x30: 0x6002, 0x31: 0x6002, 0x32: 0x6002, 0x33: 0x6002, 0x34: 0x6002, 0x35: 0x6002, - 0x36: 0x6002, 0x37: 0x6002, 0x38: 0x6002, 0x39: 0x6002, 0x3a: 0x6002, 0x3b: 0x6002, - 0x3c: 0x6002, 0x3d: 0x6002, 0x3e: 0x6002, 0x3f: 0x6002, - // Block 0x1, offset 0x40 - 0x40: 0x6003, 0x41: 0x6003, 0x42: 0x6003, 0x43: 0x6003, 0x44: 0x6003, 0x45: 0x6003, - 0x46: 0x6003, 0x47: 0x6003, 0x48: 0x6003, 0x49: 0x6003, 0x4a: 0x6003, 0x4b: 0x6003, - 0x4c: 0x6003, 0x4d: 0x6003, 0x4e: 0x6003, 0x4f: 0x6003, 0x50: 0x6003, 0x51: 0x6003, - 0x52: 0x6003, 0x53: 0x6003, 0x54: 0x6003, 0x55: 0x6003, 0x56: 0x6003, 0x57: 0x6003, - 0x58: 0x6003, 0x59: 0x6003, 0x5a: 0x6003, 0x5b: 0x6003, 0x5c: 0x6003, 0x5d: 0x6003, - 0x5e: 0x6003, 0x5f: 0x6003, 0x60: 0x6004, 0x61: 0x6004, 0x62: 0x6004, 0x63: 0x6004, - 0x64: 0x6004, 0x65: 0x6004, 0x66: 0x6004, 0x67: 0x6004, 0x68: 0x6004, 0x69: 0x6004, - 0x6a: 0x6004, 0x6b: 0x6004, 0x6c: 0x6004, 0x6d: 0x6004, 0x6e: 0x6004, 0x6f: 0x6004, - 0x70: 0x6004, 0x71: 0x6004, 0x72: 0x6004, 0x73: 0x6004, 0x74: 0x6004, 0x75: 0x6004, - 0x76: 0x6004, 0x77: 0x6004, 0x78: 0x6004, 0x79: 0x6004, 0x7a: 0x6004, 0x7b: 0x6004, - 0x7c: 0x6004, 0x7d: 0x6004, 0x7e: 0x6004, - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xe1: 0x2000, 0xe2: 0x6005, 0xe3: 0x6005, - 0xe4: 0x2000, 0xe5: 0x6006, 0xe6: 0x6005, 0xe7: 0x2000, 0xe8: 0x2000, - 0xea: 0x2000, 0xec: 0x6007, 0xed: 0x2000, 0xee: 0x2000, 0xef: 0x6008, - 0xf0: 0x2000, 0xf1: 0x2000, 0xf2: 0x2000, 0xf3: 0x2000, 0xf4: 0x2000, - 0xf6: 0x2000, 0xf7: 0x2000, 0xf8: 0x2000, 0xf9: 0x2000, 0xfa: 0x2000, - 0xfc: 0x2000, 0xfd: 0x2000, 0xfe: 0x2000, 0xff: 0x2000, - // Block 0x4, offset 0x100 - 0x106: 0x2000, - 0x110: 0x2000, - 0x117: 0x2000, - 0x118: 0x2000, - 0x11e: 0x2000, 0x11f: 0x2000, 0x120: 0x2000, 0x121: 0x2000, - 0x126: 0x2000, 0x128: 0x2000, 0x129: 0x2000, - 0x12a: 0x2000, 0x12c: 0x2000, 0x12d: 0x2000, - 0x130: 0x2000, 0x132: 0x2000, 0x133: 0x2000, - 0x137: 0x2000, 0x138: 0x2000, 0x139: 0x2000, 0x13a: 0x2000, - 0x13c: 0x2000, 0x13e: 0x2000, - // Block 0x5, offset 0x140 - 0x141: 0x2000, - 0x151: 0x2000, - 0x153: 0x2000, - 0x15b: 0x2000, - 0x166: 0x2000, 0x167: 0x2000, - 0x16b: 0x2000, - 0x171: 0x2000, 0x172: 0x2000, 0x173: 0x2000, - 0x178: 0x2000, - 0x17f: 0x2000, - // Block 0x6, offset 0x180 - 0x180: 0x2000, 0x181: 0x2000, 0x182: 0x2000, 0x184: 0x2000, - 0x188: 0x2000, 0x189: 0x2000, 0x18a: 0x2000, 0x18b: 0x2000, - 0x18d: 0x2000, - 0x192: 0x2000, 0x193: 0x2000, - 0x1a6: 0x2000, 0x1a7: 0x2000, - 0x1ab: 0x2000, - // Block 0x7, offset 0x1c0 - 0x1ce: 0x2000, 0x1d0: 0x2000, - 0x1d2: 0x2000, 0x1d4: 0x2000, 0x1d6: 0x2000, - 0x1d8: 0x2000, 0x1da: 0x2000, 0x1dc: 0x2000, - // Block 0x8, offset 0x200 - 0x211: 0x2000, - 0x221: 0x2000, - // Block 0x9, offset 0x240 - 0x244: 0x2000, - 0x247: 0x2000, 0x249: 0x2000, 0x24a: 0x2000, 0x24b: 0x2000, - 0x24d: 0x2000, 0x250: 0x2000, - 0x258: 0x2000, 0x259: 0x2000, 0x25a: 0x2000, 0x25b: 0x2000, 0x25d: 0x2000, - 0x25f: 0x2000, - // Block 0xa, offset 0x280 - 0x280: 0x2000, 0x281: 0x2000, 0x282: 0x2000, 0x283: 0x2000, 0x284: 0x2000, 0x285: 0x2000, - 0x286: 0x2000, 0x287: 0x2000, 0x288: 0x2000, 0x289: 0x2000, 0x28a: 0x2000, 0x28b: 0x2000, - 0x28c: 0x2000, 0x28d: 0x2000, 0x28e: 0x2000, 0x28f: 0x2000, 0x290: 0x2000, 0x291: 0x2000, - 0x292: 0x2000, 0x293: 0x2000, 0x294: 0x2000, 0x295: 0x2000, 0x296: 0x2000, 0x297: 0x2000, - 0x298: 0x2000, 0x299: 0x2000, 0x29a: 0x2000, 0x29b: 0x2000, 0x29c: 0x2000, 0x29d: 0x2000, - 0x29e: 0x2000, 0x29f: 0x2000, 0x2a0: 0x2000, 0x2a1: 0x2000, 0x2a2: 0x2000, 0x2a3: 0x2000, - 0x2a4: 0x2000, 0x2a5: 0x2000, 0x2a6: 0x2000, 0x2a7: 0x2000, 0x2a8: 0x2000, 0x2a9: 0x2000, - 0x2aa: 0x2000, 0x2ab: 0x2000, 0x2ac: 0x2000, 0x2ad: 0x2000, 0x2ae: 0x2000, 0x2af: 0x2000, - 0x2b0: 0x2000, 0x2b1: 0x2000, 0x2b2: 0x2000, 0x2b3: 0x2000, 0x2b4: 0x2000, 0x2b5: 0x2000, - 0x2b6: 0x2000, 0x2b7: 0x2000, 0x2b8: 0x2000, 0x2b9: 0x2000, 0x2ba: 0x2000, 0x2bb: 0x2000, - 0x2bc: 0x2000, 0x2bd: 0x2000, 0x2be: 0x2000, 0x2bf: 0x2000, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x2000, 0x2c1: 0x2000, 0x2c2: 0x2000, 0x2c3: 0x2000, 0x2c4: 0x2000, 0x2c5: 0x2000, - 0x2c6: 0x2000, 0x2c7: 0x2000, 0x2c8: 0x2000, 0x2c9: 0x2000, 0x2ca: 0x2000, 0x2cb: 0x2000, - 0x2cc: 0x2000, 0x2cd: 0x2000, 0x2ce: 0x2000, 0x2cf: 0x2000, 0x2d0: 0x2000, 0x2d1: 0x2000, - 0x2d2: 0x2000, 0x2d3: 0x2000, 0x2d4: 0x2000, 0x2d5: 0x2000, 0x2d6: 0x2000, 0x2d7: 0x2000, - 0x2d8: 0x2000, 0x2d9: 0x2000, 0x2da: 0x2000, 0x2db: 0x2000, 0x2dc: 0x2000, 0x2dd: 0x2000, - 0x2de: 0x2000, 0x2df: 0x2000, 0x2e0: 0x2000, 0x2e1: 0x2000, 0x2e2: 0x2000, 0x2e3: 0x2000, - 0x2e4: 0x2000, 0x2e5: 0x2000, 0x2e6: 0x2000, 0x2e7: 0x2000, 0x2e8: 0x2000, 0x2e9: 0x2000, - 0x2ea: 0x2000, 0x2eb: 0x2000, 0x2ec: 0x2000, 0x2ed: 0x2000, 0x2ee: 0x2000, 0x2ef: 0x2000, - // Block 0xc, offset 0x300 - 0x311: 0x2000, - 0x312: 0x2000, 0x313: 0x2000, 0x314: 0x2000, 0x315: 0x2000, 0x316: 0x2000, 0x317: 0x2000, - 0x318: 0x2000, 0x319: 0x2000, 0x31a: 0x2000, 0x31b: 0x2000, 0x31c: 0x2000, 0x31d: 0x2000, - 0x31e: 0x2000, 0x31f: 0x2000, 0x320: 0x2000, 0x321: 0x2000, 0x323: 0x2000, - 0x324: 0x2000, 0x325: 0x2000, 0x326: 0x2000, 0x327: 0x2000, 0x328: 0x2000, 0x329: 0x2000, - 0x331: 0x2000, 0x332: 0x2000, 0x333: 0x2000, 0x334: 0x2000, 0x335: 0x2000, - 0x336: 0x2000, 0x337: 0x2000, 0x338: 0x2000, 0x339: 0x2000, 0x33a: 0x2000, 0x33b: 0x2000, - 0x33c: 0x2000, 0x33d: 0x2000, 0x33e: 0x2000, 0x33f: 0x2000, - // Block 0xd, offset 0x340 - 0x340: 0x2000, 0x341: 0x2000, 0x343: 0x2000, 0x344: 0x2000, 0x345: 0x2000, - 0x346: 0x2000, 0x347: 0x2000, 0x348: 0x2000, 0x349: 0x2000, - // Block 0xe, offset 0x380 - 0x381: 0x2000, - 0x390: 0x2000, 0x391: 0x2000, - 0x392: 0x2000, 0x393: 0x2000, 0x394: 0x2000, 0x395: 0x2000, 0x396: 0x2000, 0x397: 0x2000, - 0x398: 0x2000, 0x399: 0x2000, 0x39a: 0x2000, 0x39b: 0x2000, 0x39c: 0x2000, 0x39d: 0x2000, - 0x39e: 0x2000, 0x39f: 0x2000, 0x3a0: 0x2000, 0x3a1: 0x2000, 0x3a2: 0x2000, 0x3a3: 0x2000, - 0x3a4: 0x2000, 0x3a5: 0x2000, 0x3a6: 0x2000, 0x3a7: 0x2000, 0x3a8: 0x2000, 0x3a9: 0x2000, - 0x3aa: 0x2000, 0x3ab: 0x2000, 0x3ac: 0x2000, 0x3ad: 0x2000, 0x3ae: 0x2000, 0x3af: 0x2000, - 0x3b0: 0x2000, 0x3b1: 0x2000, 0x3b2: 0x2000, 0x3b3: 0x2000, 0x3b4: 0x2000, 0x3b5: 0x2000, - 0x3b6: 0x2000, 0x3b7: 0x2000, 0x3b8: 0x2000, 0x3b9: 0x2000, 0x3ba: 0x2000, 0x3bb: 0x2000, - 0x3bc: 0x2000, 0x3bd: 0x2000, 0x3be: 0x2000, 0x3bf: 0x2000, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x2000, 0x3c1: 0x2000, 0x3c2: 0x2000, 0x3c3: 0x2000, 0x3c4: 0x2000, 0x3c5: 0x2000, - 0x3c6: 0x2000, 0x3c7: 0x2000, 0x3c8: 0x2000, 0x3c9: 0x2000, 0x3ca: 0x2000, 0x3cb: 0x2000, - 0x3cc: 0x2000, 0x3cd: 0x2000, 0x3ce: 0x2000, 0x3cf: 0x2000, 0x3d1: 0x2000, - // Block 0x10, offset 0x400 - 0x400: 0x4000, 0x401: 0x4000, 0x402: 0x4000, 0x403: 0x4000, 0x404: 0x4000, 0x405: 0x4000, - 0x406: 0x4000, 0x407: 0x4000, 0x408: 0x4000, 0x409: 0x4000, 0x40a: 0x4000, 0x40b: 0x4000, - 0x40c: 0x4000, 0x40d: 0x4000, 0x40e: 0x4000, 0x40f: 0x4000, 0x410: 0x4000, 0x411: 0x4000, - 0x412: 0x4000, 0x413: 0x4000, 0x414: 0x4000, 0x415: 0x4000, 0x416: 0x4000, 0x417: 0x4000, - 0x418: 0x4000, 0x419: 0x4000, 0x41a: 0x4000, 0x41b: 0x4000, 0x41c: 0x4000, 0x41d: 0x4000, - 0x41e: 0x4000, 0x41f: 0x4000, 0x420: 0x4000, 0x421: 0x4000, 0x422: 0x4000, 0x423: 0x4000, - 0x424: 0x4000, 0x425: 0x4000, 0x426: 0x4000, 0x427: 0x4000, 0x428: 0x4000, 0x429: 0x4000, - 0x42a: 0x4000, 0x42b: 0x4000, 0x42c: 0x4000, 0x42d: 0x4000, 0x42e: 0x4000, 0x42f: 0x4000, - 0x430: 0x4000, 0x431: 0x4000, 0x432: 0x4000, 0x433: 0x4000, 0x434: 0x4000, 0x435: 0x4000, - 0x436: 0x4000, 0x437: 0x4000, 0x438: 0x4000, 0x439: 0x4000, 0x43a: 0x4000, 0x43b: 0x4000, - 0x43c: 0x4000, 0x43d: 0x4000, 0x43e: 0x4000, 0x43f: 0x4000, - // Block 0x11, offset 0x440 - 0x440: 0x4000, 0x441: 0x4000, 0x442: 0x4000, 0x443: 0x4000, 0x444: 0x4000, 0x445: 0x4000, - 0x446: 0x4000, 0x447: 0x4000, 0x448: 0x4000, 0x449: 0x4000, 0x44a: 0x4000, 0x44b: 0x4000, - 0x44c: 0x4000, 0x44d: 0x4000, 0x44e: 0x4000, 0x44f: 0x4000, 0x450: 0x4000, 0x451: 0x4000, - 0x452: 0x4000, 0x453: 0x4000, 0x454: 0x4000, 0x455: 0x4000, 0x456: 0x4000, 0x457: 0x4000, - 0x458: 0x4000, 0x459: 0x4000, 0x45a: 0x4000, 0x45b: 0x4000, 0x45c: 0x4000, 0x45d: 0x4000, - 0x45e: 0x4000, 0x45f: 0x4000, - // Block 0x12, offset 0x480 - 0x490: 0x2000, - 0x493: 0x2000, 0x494: 0x2000, 0x495: 0x2000, 0x496: 0x2000, - 0x498: 0x2000, 0x499: 0x2000, 0x49c: 0x2000, 0x49d: 0x2000, - 0x4a0: 0x2000, 0x4a1: 0x2000, 0x4a2: 0x2000, - 0x4a4: 0x2000, 0x4a5: 0x2000, 0x4a6: 0x2000, 0x4a7: 0x2000, - 0x4b0: 0x2000, 0x4b2: 0x2000, 0x4b3: 0x2000, 0x4b5: 0x2000, - 0x4bb: 0x2000, - 0x4be: 0x2000, - // Block 0x13, offset 0x4c0 - 0x4f4: 0x2000, - 0x4ff: 0x2000, - // Block 0x14, offset 0x500 - 0x501: 0x2000, 0x502: 0x2000, 0x503: 0x2000, 0x504: 0x2000, - 0x529: 0xa009, - 0x52c: 0x2000, - // Block 0x15, offset 0x540 - 0x543: 0x2000, 0x545: 0x2000, - 0x549: 0x2000, - 0x553: 0x2000, 0x556: 0x2000, - 0x561: 0x2000, 0x562: 0x2000, - 0x566: 0x2000, - 0x56b: 0x2000, - // Block 0x16, offset 0x580 - 0x593: 0x2000, 0x594: 0x2000, - 0x59b: 0x2000, 0x59c: 0x2000, 0x59d: 0x2000, - 0x59e: 0x2000, 0x5a0: 0x2000, 0x5a1: 0x2000, 0x5a2: 0x2000, 0x5a3: 0x2000, - 0x5a4: 0x2000, 0x5a5: 0x2000, 0x5a6: 0x2000, 0x5a7: 0x2000, 0x5a8: 0x2000, 0x5a9: 0x2000, - 0x5aa: 0x2000, 0x5ab: 0x2000, - 0x5b0: 0x2000, 0x5b1: 0x2000, 0x5b2: 0x2000, 0x5b3: 0x2000, 0x5b4: 0x2000, 0x5b5: 0x2000, - 0x5b6: 0x2000, 0x5b7: 0x2000, 0x5b8: 0x2000, 0x5b9: 0x2000, - // Block 0x17, offset 0x5c0 - 0x5c9: 0x2000, - 0x5d0: 0x200a, 0x5d1: 0x200b, - 0x5d2: 0x200a, 0x5d3: 0x200c, 0x5d4: 0x2000, 0x5d5: 0x2000, 0x5d6: 0x2000, 0x5d7: 0x2000, - 0x5d8: 0x2000, 0x5d9: 0x2000, - 0x5f8: 0x2000, 0x5f9: 0x2000, - // Block 0x18, offset 0x600 - 0x612: 0x2000, 0x614: 0x2000, - 0x627: 0x2000, - // Block 0x19, offset 0x640 - 0x640: 0x2000, 0x642: 0x2000, 0x643: 0x2000, - 0x647: 0x2000, 0x648: 0x2000, 0x64b: 0x2000, - 0x64f: 0x2000, 0x651: 0x2000, - 0x655: 0x2000, - 0x65a: 0x2000, 0x65d: 0x2000, - 0x65e: 0x2000, 0x65f: 0x2000, 0x660: 0x2000, 0x663: 0x2000, - 0x665: 0x2000, 0x667: 0x2000, 0x668: 0x2000, 0x669: 0x2000, - 0x66a: 0x2000, 0x66b: 0x2000, 0x66c: 0x2000, 0x66e: 0x2000, - 0x674: 0x2000, 0x675: 0x2000, - 0x676: 0x2000, 0x677: 0x2000, - 0x67c: 0x2000, 0x67d: 0x2000, - // Block 0x1a, offset 0x680 - 0x688: 0x2000, - 0x68c: 0x2000, - 0x692: 0x2000, - 0x6a0: 0x2000, 0x6a1: 0x2000, - 0x6a4: 0x2000, 0x6a5: 0x2000, 0x6a6: 0x2000, 0x6a7: 0x2000, - 0x6aa: 0x2000, 0x6ab: 0x2000, 0x6ae: 0x2000, 0x6af: 0x2000, - // Block 0x1b, offset 0x6c0 - 0x6c2: 0x2000, 0x6c3: 0x2000, - 0x6c6: 0x2000, 0x6c7: 0x2000, - 0x6d5: 0x2000, - 0x6d9: 0x2000, - 0x6e5: 0x2000, - 0x6ff: 0x2000, - // Block 0x1c, offset 0x700 - 0x712: 0x2000, - 0x71a: 0x4000, 0x71b: 0x4000, - 0x729: 0x4000, - 0x72a: 0x4000, - // Block 0x1d, offset 0x740 - 0x769: 0x4000, - 0x76a: 0x4000, 0x76b: 0x4000, 0x76c: 0x4000, - 0x770: 0x4000, 0x773: 0x4000, - // Block 0x1e, offset 0x780 - 0x7a0: 0x2000, 0x7a1: 0x2000, 0x7a2: 0x2000, 0x7a3: 0x2000, - 0x7a4: 0x2000, 0x7a5: 0x2000, 0x7a6: 0x2000, 0x7a7: 0x2000, 0x7a8: 0x2000, 0x7a9: 0x2000, - 0x7aa: 0x2000, 0x7ab: 0x2000, 0x7ac: 0x2000, 0x7ad: 0x2000, 0x7ae: 0x2000, 0x7af: 0x2000, - 0x7b0: 0x2000, 0x7b1: 0x2000, 0x7b2: 0x2000, 0x7b3: 0x2000, 0x7b4: 0x2000, 0x7b5: 0x2000, - 0x7b6: 0x2000, 0x7b7: 0x2000, 0x7b8: 0x2000, 0x7b9: 0x2000, 0x7ba: 0x2000, 0x7bb: 0x2000, - 0x7bc: 0x2000, 0x7bd: 0x2000, 0x7be: 0x2000, 0x7bf: 0x2000, - // Block 0x1f, offset 0x7c0 - 0x7c0: 0x2000, 0x7c1: 0x2000, 0x7c2: 0x2000, 0x7c3: 0x2000, 0x7c4: 0x2000, 0x7c5: 0x2000, - 0x7c6: 0x2000, 0x7c7: 0x2000, 0x7c8: 0x2000, 0x7c9: 0x2000, 0x7ca: 0x2000, 0x7cb: 0x2000, - 0x7cc: 0x2000, 0x7cd: 0x2000, 0x7ce: 0x2000, 0x7cf: 0x2000, 0x7d0: 0x2000, 0x7d1: 0x2000, - 0x7d2: 0x2000, 0x7d3: 0x2000, 0x7d4: 0x2000, 0x7d5: 0x2000, 0x7d6: 0x2000, 0x7d7: 0x2000, - 0x7d8: 0x2000, 0x7d9: 0x2000, 0x7da: 0x2000, 0x7db: 0x2000, 0x7dc: 0x2000, 0x7dd: 0x2000, - 0x7de: 0x2000, 0x7df: 0x2000, 0x7e0: 0x2000, 0x7e1: 0x2000, 0x7e2: 0x2000, 0x7e3: 0x2000, - 0x7e4: 0x2000, 0x7e5: 0x2000, 0x7e6: 0x2000, 0x7e7: 0x2000, 0x7e8: 0x2000, 0x7e9: 0x2000, - 0x7eb: 0x2000, 0x7ec: 0x2000, 0x7ed: 0x2000, 0x7ee: 0x2000, 0x7ef: 0x2000, - 0x7f0: 0x2000, 0x7f1: 0x2000, 0x7f2: 0x2000, 0x7f3: 0x2000, 0x7f4: 0x2000, 0x7f5: 0x2000, - 0x7f6: 0x2000, 0x7f7: 0x2000, 0x7f8: 0x2000, 0x7f9: 0x2000, 0x7fa: 0x2000, 0x7fb: 0x2000, - 0x7fc: 0x2000, 0x7fd: 0x2000, 0x7fe: 0x2000, 0x7ff: 0x2000, - // Block 0x20, offset 0x800 - 0x800: 0x2000, 0x801: 0x2000, 0x802: 0x200d, 0x803: 0x2000, 0x804: 0x2000, 0x805: 0x2000, - 0x806: 0x2000, 0x807: 0x2000, 0x808: 0x2000, 0x809: 0x2000, 0x80a: 0x2000, 0x80b: 0x2000, - 0x80c: 0x2000, 0x80d: 0x2000, 0x80e: 0x2000, 0x80f: 0x2000, 0x810: 0x2000, 0x811: 0x2000, - 0x812: 0x2000, 0x813: 0x2000, 0x814: 0x2000, 0x815: 0x2000, 0x816: 0x2000, 0x817: 0x2000, - 0x818: 0x2000, 0x819: 0x2000, 0x81a: 0x2000, 0x81b: 0x2000, 0x81c: 0x2000, 0x81d: 0x2000, - 0x81e: 0x2000, 0x81f: 0x2000, 0x820: 0x2000, 0x821: 0x2000, 0x822: 0x2000, 0x823: 0x2000, - 0x824: 0x2000, 0x825: 0x2000, 0x826: 0x2000, 0x827: 0x2000, 0x828: 0x2000, 0x829: 0x2000, - 0x82a: 0x2000, 0x82b: 0x2000, 0x82c: 0x2000, 0x82d: 0x2000, 0x82e: 0x2000, 0x82f: 0x2000, - 0x830: 0x2000, 0x831: 0x2000, 0x832: 0x2000, 0x833: 0x2000, 0x834: 0x2000, 0x835: 0x2000, - 0x836: 0x2000, 0x837: 0x2000, 0x838: 0x2000, 0x839: 0x2000, 0x83a: 0x2000, 0x83b: 0x2000, - 0x83c: 0x2000, 0x83d: 0x2000, 0x83e: 0x2000, 0x83f: 0x2000, - // Block 0x21, offset 0x840 - 0x840: 0x2000, 0x841: 0x2000, 0x842: 0x2000, 0x843: 0x2000, 0x844: 0x2000, 0x845: 0x2000, - 0x846: 0x2000, 0x847: 0x2000, 0x848: 0x2000, 0x849: 0x2000, 0x84a: 0x2000, 0x84b: 0x2000, - 0x850: 0x2000, 0x851: 0x2000, - 0x852: 0x2000, 0x853: 0x2000, 0x854: 0x2000, 0x855: 0x2000, 0x856: 0x2000, 0x857: 0x2000, - 0x858: 0x2000, 0x859: 0x2000, 0x85a: 0x2000, 0x85b: 0x2000, 0x85c: 0x2000, 0x85d: 0x2000, - 0x85e: 0x2000, 0x85f: 0x2000, 0x860: 0x2000, 0x861: 0x2000, 0x862: 0x2000, 0x863: 0x2000, - 0x864: 0x2000, 0x865: 0x2000, 0x866: 0x2000, 0x867: 0x2000, 0x868: 0x2000, 0x869: 0x2000, - 0x86a: 0x2000, 0x86b: 0x2000, 0x86c: 0x2000, 0x86d: 0x2000, 0x86e: 0x2000, 0x86f: 0x2000, - 0x870: 0x2000, 0x871: 0x2000, 0x872: 0x2000, 0x873: 0x2000, - // Block 0x22, offset 0x880 - 0x880: 0x2000, 0x881: 0x2000, 0x882: 0x2000, 0x883: 0x2000, 0x884: 0x2000, 0x885: 0x2000, - 0x886: 0x2000, 0x887: 0x2000, 0x888: 0x2000, 0x889: 0x2000, 0x88a: 0x2000, 0x88b: 0x2000, - 0x88c: 0x2000, 0x88d: 0x2000, 0x88e: 0x2000, 0x88f: 0x2000, - 0x892: 0x2000, 0x893: 0x2000, 0x894: 0x2000, 0x895: 0x2000, - 0x8a0: 0x200e, 0x8a1: 0x2000, 0x8a3: 0x2000, - 0x8a4: 0x2000, 0x8a5: 0x2000, 0x8a6: 0x2000, 0x8a7: 0x2000, 0x8a8: 0x2000, 0x8a9: 0x2000, - 0x8b2: 0x2000, 0x8b3: 0x2000, - 0x8b6: 0x2000, 0x8b7: 0x2000, - 0x8bc: 0x2000, 0x8bd: 0x2000, - // Block 0x23, offset 0x8c0 - 0x8c0: 0x2000, 0x8c1: 0x2000, - 0x8c6: 0x2000, 0x8c7: 0x2000, 0x8c8: 0x2000, 0x8cb: 0x200f, - 0x8ce: 0x2000, 0x8cf: 0x2000, 0x8d0: 0x2000, 0x8d1: 0x2000, - 0x8e2: 0x2000, 0x8e3: 0x2000, - 0x8e4: 0x2000, 0x8e5: 0x2000, - 0x8ef: 0x2000, - 0x8fd: 0x4000, 0x8fe: 0x4000, - // Block 0x24, offset 0x900 - 0x905: 0x2000, - 0x906: 0x2000, 0x909: 0x2000, - 0x90e: 0x2000, 0x90f: 0x2000, - 0x914: 0x4000, 0x915: 0x4000, - 0x91c: 0x2000, - 0x91e: 0x2000, - // Block 0x25, offset 0x940 - 0x940: 0x2000, 0x942: 0x2000, - 0x948: 0x4000, 0x949: 0x4000, 0x94a: 0x4000, 0x94b: 0x4000, - 0x94c: 0x4000, 0x94d: 0x4000, 0x94e: 0x4000, 0x94f: 0x4000, 0x950: 0x4000, 0x951: 0x4000, - 0x952: 0x4000, 0x953: 0x4000, - 0x960: 0x2000, 0x961: 0x2000, 0x963: 0x2000, - 0x964: 0x2000, 0x965: 0x2000, 0x967: 0x2000, 0x968: 0x2000, 0x969: 0x2000, - 0x96a: 0x2000, 0x96c: 0x2000, 0x96d: 0x2000, 0x96f: 0x2000, - 0x97f: 0x4000, - // Block 0x26, offset 0x980 - 0x993: 0x4000, - 0x99e: 0x2000, 0x99f: 0x2000, 0x9a1: 0x4000, - 0x9aa: 0x4000, 0x9ab: 0x4000, - 0x9bd: 0x4000, 0x9be: 0x4000, 0x9bf: 0x2000, - // Block 0x27, offset 0x9c0 - 0x9c4: 0x4000, 0x9c5: 0x4000, - 0x9c6: 0x2000, 0x9c7: 0x2000, 0x9c8: 0x2000, 0x9c9: 0x2000, 0x9ca: 0x2000, 0x9cb: 0x2000, - 0x9cc: 0x2000, 0x9cd: 0x2000, 0x9ce: 0x4000, 0x9cf: 0x2000, 0x9d0: 0x2000, 0x9d1: 0x2000, - 0x9d2: 0x2000, 0x9d3: 0x2000, 0x9d4: 0x4000, 0x9d5: 0x2000, 0x9d6: 0x2000, 0x9d7: 0x2000, - 0x9d8: 0x2000, 0x9d9: 0x2000, 0x9da: 0x2000, 0x9db: 0x2000, 0x9dc: 0x2000, 0x9dd: 0x2000, - 0x9de: 0x2000, 0x9df: 0x2000, 0x9e0: 0x2000, 0x9e1: 0x2000, 0x9e3: 0x2000, - 0x9e8: 0x2000, 0x9e9: 0x2000, - 0x9ea: 0x4000, 0x9eb: 0x2000, 0x9ec: 0x2000, 0x9ed: 0x2000, 0x9ee: 0x2000, 0x9ef: 0x2000, - 0x9f0: 0x2000, 0x9f1: 0x2000, 0x9f2: 0x4000, 0x9f3: 0x4000, 0x9f4: 0x2000, 0x9f5: 0x4000, - 0x9f6: 0x2000, 0x9f7: 0x2000, 0x9f8: 0x2000, 0x9f9: 0x2000, 0x9fa: 0x4000, 0x9fb: 0x2000, - 0x9fc: 0x2000, 0x9fd: 0x4000, 0x9fe: 0x2000, 0x9ff: 0x2000, - // Block 0x28, offset 0xa00 - 0xa05: 0x4000, - 0xa0a: 0x4000, 0xa0b: 0x4000, - 0xa28: 0x4000, - 0xa3d: 0x2000, - // Block 0x29, offset 0xa40 - 0xa4c: 0x4000, 0xa4e: 0x4000, - 0xa53: 0x4000, 0xa54: 0x4000, 0xa55: 0x4000, 0xa57: 0x4000, - 0xa76: 0x2000, 0xa77: 0x2000, 0xa78: 0x2000, 0xa79: 0x2000, 0xa7a: 0x2000, 0xa7b: 0x2000, - 0xa7c: 0x2000, 0xa7d: 0x2000, 0xa7e: 0x2000, 0xa7f: 0x2000, - // Block 0x2a, offset 0xa80 - 0xa95: 0x4000, 0xa96: 0x4000, 0xa97: 0x4000, - 0xab0: 0x4000, - 0xabf: 0x4000, - // Block 0x2b, offset 0xac0 - 0xae6: 0x6000, 0xae7: 0x6000, 0xae8: 0x6000, 0xae9: 0x6000, - 0xaea: 0x6000, 0xaeb: 0x6000, 0xaec: 0x6000, 0xaed: 0x6000, - // Block 0x2c, offset 0xb00 - 0xb05: 0x6010, - 0xb06: 0x6011, - // Block 0x2d, offset 0xb40 - 0xb5b: 0x4000, 0xb5c: 0x4000, - // Block 0x2e, offset 0xb80 - 0xb90: 0x4000, - 0xb95: 0x4000, 0xb96: 0x2000, 0xb97: 0x2000, - 0xb98: 0x2000, 0xb99: 0x2000, - // Block 0x2f, offset 0xbc0 - 0xbc0: 0x4000, 0xbc1: 0x4000, 0xbc2: 0x4000, 0xbc3: 0x4000, 0xbc4: 0x4000, 0xbc5: 0x4000, - 0xbc6: 0x4000, 0xbc7: 0x4000, 0xbc8: 0x4000, 0xbc9: 0x4000, 0xbca: 0x4000, 0xbcb: 0x4000, - 0xbcc: 0x4000, 0xbcd: 0x4000, 0xbce: 0x4000, 0xbcf: 0x4000, 0xbd0: 0x4000, 0xbd1: 0x4000, - 0xbd2: 0x4000, 0xbd3: 0x4000, 0xbd4: 0x4000, 0xbd5: 0x4000, 0xbd6: 0x4000, 0xbd7: 0x4000, - 0xbd8: 0x4000, 0xbd9: 0x4000, 0xbdb: 0x4000, 0xbdc: 0x4000, 0xbdd: 0x4000, - 0xbde: 0x4000, 0xbdf: 0x4000, 0xbe0: 0x4000, 0xbe1: 0x4000, 0xbe2: 0x4000, 0xbe3: 0x4000, - 0xbe4: 0x4000, 0xbe5: 0x4000, 0xbe6: 0x4000, 0xbe7: 0x4000, 0xbe8: 0x4000, 0xbe9: 0x4000, - 0xbea: 0x4000, 0xbeb: 0x4000, 0xbec: 0x4000, 0xbed: 0x4000, 0xbee: 0x4000, 0xbef: 0x4000, - 0xbf0: 0x4000, 0xbf1: 0x4000, 0xbf2: 0x4000, 0xbf3: 0x4000, 0xbf4: 0x4000, 0xbf5: 0x4000, - 0xbf6: 0x4000, 0xbf7: 0x4000, 0xbf8: 0x4000, 0xbf9: 0x4000, 0xbfa: 0x4000, 0xbfb: 0x4000, - 0xbfc: 0x4000, 0xbfd: 0x4000, 0xbfe: 0x4000, 0xbff: 0x4000, - // Block 0x30, offset 0xc00 - 0xc00: 0x4000, 0xc01: 0x4000, 0xc02: 0x4000, 0xc03: 0x4000, 0xc04: 0x4000, 0xc05: 0x4000, - 0xc06: 0x4000, 0xc07: 0x4000, 0xc08: 0x4000, 0xc09: 0x4000, 0xc0a: 0x4000, 0xc0b: 0x4000, - 0xc0c: 0x4000, 0xc0d: 0x4000, 0xc0e: 0x4000, 0xc0f: 0x4000, 0xc10: 0x4000, 0xc11: 0x4000, - 0xc12: 0x4000, 0xc13: 0x4000, 0xc14: 0x4000, 0xc15: 0x4000, 0xc16: 0x4000, 0xc17: 0x4000, - 0xc18: 0x4000, 0xc19: 0x4000, 0xc1a: 0x4000, 0xc1b: 0x4000, 0xc1c: 0x4000, 0xc1d: 0x4000, - 0xc1e: 0x4000, 0xc1f: 0x4000, 0xc20: 0x4000, 0xc21: 0x4000, 0xc22: 0x4000, 0xc23: 0x4000, - 0xc24: 0x4000, 0xc25: 0x4000, 0xc26: 0x4000, 0xc27: 0x4000, 0xc28: 0x4000, 0xc29: 0x4000, - 0xc2a: 0x4000, 0xc2b: 0x4000, 0xc2c: 0x4000, 0xc2d: 0x4000, 0xc2e: 0x4000, 0xc2f: 0x4000, - 0xc30: 0x4000, 0xc31: 0x4000, 0xc32: 0x4000, 0xc33: 0x4000, - // Block 0x31, offset 0xc40 - 0xc40: 0x4000, 0xc41: 0x4000, 0xc42: 0x4000, 0xc43: 0x4000, 0xc44: 0x4000, 0xc45: 0x4000, - 0xc46: 0x4000, 0xc47: 0x4000, 0xc48: 0x4000, 0xc49: 0x4000, 0xc4a: 0x4000, 0xc4b: 0x4000, - 0xc4c: 0x4000, 0xc4d: 0x4000, 0xc4e: 0x4000, 0xc4f: 0x4000, 0xc50: 0x4000, 0xc51: 0x4000, - 0xc52: 0x4000, 0xc53: 0x4000, 0xc54: 0x4000, 0xc55: 0x4000, - 0xc70: 0x4000, 0xc71: 0x4000, 0xc72: 0x4000, 0xc73: 0x4000, 0xc74: 0x4000, 0xc75: 0x4000, - 0xc76: 0x4000, 0xc77: 0x4000, 0xc78: 0x4000, 0xc79: 0x4000, 0xc7a: 0x4000, 0xc7b: 0x4000, - // Block 0x32, offset 0xc80 - 0xc80: 0x9012, 0xc81: 0x4013, 0xc82: 0x4014, 0xc83: 0x4000, 0xc84: 0x4000, 0xc85: 0x4000, - 0xc86: 0x4000, 0xc87: 0x4000, 0xc88: 0x4000, 0xc89: 0x4000, 0xc8a: 0x4000, 0xc8b: 0x4000, - 0xc8c: 0x4015, 0xc8d: 0x4015, 0xc8e: 0x4000, 0xc8f: 0x4000, 0xc90: 0x4000, 0xc91: 0x4000, - 0xc92: 0x4000, 0xc93: 0x4000, 0xc94: 0x4000, 0xc95: 0x4000, 0xc96: 0x4000, 0xc97: 0x4000, - 0xc98: 0x4000, 0xc99: 0x4000, 0xc9a: 0x4000, 0xc9b: 0x4000, 0xc9c: 0x4000, 0xc9d: 0x4000, - 0xc9e: 0x4000, 0xc9f: 0x4000, 0xca0: 0x4000, 0xca1: 0x4000, 0xca2: 0x4000, 0xca3: 0x4000, - 0xca4: 0x4000, 0xca5: 0x4000, 0xca6: 0x4000, 0xca7: 0x4000, 0xca8: 0x4000, 0xca9: 0x4000, - 0xcaa: 0x4000, 0xcab: 0x4000, 0xcac: 0x4000, 0xcad: 0x4000, 0xcae: 0x4000, 0xcaf: 0x4000, - 0xcb0: 0x4000, 0xcb1: 0x4000, 0xcb2: 0x4000, 0xcb3: 0x4000, 0xcb4: 0x4000, 0xcb5: 0x4000, - 0xcb6: 0x4000, 0xcb7: 0x4000, 0xcb8: 0x4000, 0xcb9: 0x4000, 0xcba: 0x4000, 0xcbb: 0x4000, - 0xcbc: 0x4000, 0xcbd: 0x4000, 0xcbe: 0x4000, - // Block 0x33, offset 0xcc0 - 0xcc1: 0x4000, 0xcc2: 0x4000, 0xcc3: 0x4000, 0xcc4: 0x4000, 0xcc5: 0x4000, - 0xcc6: 0x4000, 0xcc7: 0x4000, 0xcc8: 0x4000, 0xcc9: 0x4000, 0xcca: 0x4000, 0xccb: 0x4000, - 0xccc: 0x4000, 0xccd: 0x4000, 0xcce: 0x4000, 0xccf: 0x4000, 0xcd0: 0x4000, 0xcd1: 0x4000, - 0xcd2: 0x4000, 0xcd3: 0x4000, 0xcd4: 0x4000, 0xcd5: 0x4000, 0xcd6: 0x4000, 0xcd7: 0x4000, - 0xcd8: 0x4000, 0xcd9: 0x4000, 0xcda: 0x4000, 0xcdb: 0x4000, 0xcdc: 0x4000, 0xcdd: 0x4000, - 0xcde: 0x4000, 0xcdf: 0x4000, 0xce0: 0x4000, 0xce1: 0x4000, 0xce2: 0x4000, 0xce3: 0x4000, - 0xce4: 0x4000, 0xce5: 0x4000, 0xce6: 0x4000, 0xce7: 0x4000, 0xce8: 0x4000, 0xce9: 0x4000, - 0xcea: 0x4000, 0xceb: 0x4000, 0xcec: 0x4000, 0xced: 0x4000, 0xcee: 0x4000, 0xcef: 0x4000, - 0xcf0: 0x4000, 0xcf1: 0x4000, 0xcf2: 0x4000, 0xcf3: 0x4000, 0xcf4: 0x4000, 0xcf5: 0x4000, - 0xcf6: 0x4000, 0xcf7: 0x4000, 0xcf8: 0x4000, 0xcf9: 0x4000, 0xcfa: 0x4000, 0xcfb: 0x4000, - 0xcfc: 0x4000, 0xcfd: 0x4000, 0xcfe: 0x4000, 0xcff: 0x4000, - // Block 0x34, offset 0xd00 - 0xd00: 0x4000, 0xd01: 0x4000, 0xd02: 0x4000, 0xd03: 0x4000, 0xd04: 0x4000, 0xd05: 0x4000, - 0xd06: 0x4000, 0xd07: 0x4000, 0xd08: 0x4000, 0xd09: 0x4000, 0xd0a: 0x4000, 0xd0b: 0x4000, - 0xd0c: 0x4000, 0xd0d: 0x4000, 0xd0e: 0x4000, 0xd0f: 0x4000, 0xd10: 0x4000, 0xd11: 0x4000, - 0xd12: 0x4000, 0xd13: 0x4000, 0xd14: 0x4000, 0xd15: 0x4000, 0xd16: 0x4000, - 0xd19: 0x4016, 0xd1a: 0x4017, 0xd1b: 0x4000, 0xd1c: 0x4000, 0xd1d: 0x4000, - 0xd1e: 0x4000, 0xd1f: 0x4000, 0xd20: 0x4000, 0xd21: 0x4018, 0xd22: 0x4019, 0xd23: 0x401a, - 0xd24: 0x401b, 0xd25: 0x401c, 0xd26: 0x401d, 0xd27: 0x401e, 0xd28: 0x401f, 0xd29: 0x4020, - 0xd2a: 0x4021, 0xd2b: 0x4022, 0xd2c: 0x4000, 0xd2d: 0x4010, 0xd2e: 0x4000, 0xd2f: 0x4023, - 0xd30: 0x4000, 0xd31: 0x4024, 0xd32: 0x4000, 0xd33: 0x4025, 0xd34: 0x4000, 0xd35: 0x4026, - 0xd36: 0x4000, 0xd37: 0x401a, 0xd38: 0x4000, 0xd39: 0x4027, 0xd3a: 0x4000, 0xd3b: 0x4028, - 0xd3c: 0x4000, 0xd3d: 0x4020, 0xd3e: 0x4000, 0xd3f: 0x4029, - // Block 0x35, offset 0xd40 - 0xd40: 0x4000, 0xd41: 0x402a, 0xd42: 0x4000, 0xd43: 0x402b, 0xd44: 0x402c, 0xd45: 0x4000, - 0xd46: 0x4017, 0xd47: 0x4000, 0xd48: 0x402d, 0xd49: 0x4000, 0xd4a: 0x402e, 0xd4b: 0x402f, - 0xd4c: 0x4030, 0xd4d: 0x4017, 0xd4e: 0x4016, 0xd4f: 0x4017, 0xd50: 0x4000, 0xd51: 0x4000, - 0xd52: 0x4031, 0xd53: 0x4000, 0xd54: 0x4000, 0xd55: 0x4031, 0xd56: 0x4000, 0xd57: 0x4000, - 0xd58: 0x4032, 0xd59: 0x4000, 0xd5a: 0x4000, 0xd5b: 0x4032, 0xd5c: 0x4000, 0xd5d: 0x4000, - 0xd5e: 0x4033, 0xd5f: 0x402e, 0xd60: 0x4034, 0xd61: 0x4035, 0xd62: 0x4034, 0xd63: 0x4036, - 0xd64: 0x4037, 0xd65: 0x4024, 0xd66: 0x4035, 0xd67: 0x4025, 0xd68: 0x4038, 0xd69: 0x4038, - 0xd6a: 0x4039, 0xd6b: 0x4039, 0xd6c: 0x403a, 0xd6d: 0x403a, 0xd6e: 0x4000, 0xd6f: 0x4035, - 0xd70: 0x4000, 0xd71: 0x4000, 0xd72: 0x403b, 0xd73: 0x403c, 0xd74: 0x4000, 0xd75: 0x4000, - 0xd76: 0x4000, 0xd77: 0x4000, 0xd78: 0x4000, 0xd79: 0x4000, 0xd7a: 0x4000, 0xd7b: 0x403d, - 0xd7c: 0x401c, 0xd7d: 0x4000, 0xd7e: 0x4000, 0xd7f: 0x4000, - // Block 0x36, offset 0xd80 - 0xd85: 0x4000, - 0xd86: 0x4000, 0xd87: 0x4000, 0xd88: 0x4000, 0xd89: 0x4000, 0xd8a: 0x4000, 0xd8b: 0x4000, - 0xd8c: 0x4000, 0xd8d: 0x4000, 0xd8e: 0x4000, 0xd8f: 0x4000, 0xd90: 0x4000, 0xd91: 0x4000, - 0xd92: 0x4000, 0xd93: 0x4000, 0xd94: 0x4000, 0xd95: 0x4000, 0xd96: 0x4000, 0xd97: 0x4000, - 0xd98: 0x4000, 0xd99: 0x4000, 0xd9a: 0x4000, 0xd9b: 0x4000, 0xd9c: 0x4000, 0xd9d: 0x4000, - 0xd9e: 0x4000, 0xd9f: 0x4000, 0xda0: 0x4000, 0xda1: 0x4000, 0xda2: 0x4000, 0xda3: 0x4000, - 0xda4: 0x4000, 0xda5: 0x4000, 0xda6: 0x4000, 0xda7: 0x4000, 0xda8: 0x4000, 0xda9: 0x4000, - 0xdaa: 0x4000, 0xdab: 0x4000, 0xdac: 0x4000, 0xdad: 0x4000, - 0xdb1: 0x403e, 0xdb2: 0x403e, 0xdb3: 0x403e, 0xdb4: 0x403e, 0xdb5: 0x403e, - 0xdb6: 0x403e, 0xdb7: 0x403e, 0xdb8: 0x403e, 0xdb9: 0x403e, 0xdba: 0x403e, 0xdbb: 0x403e, - 0xdbc: 0x403e, 0xdbd: 0x403e, 0xdbe: 0x403e, 0xdbf: 0x403e, - // Block 0x37, offset 0xdc0 - 0xdc0: 0x4037, 0xdc1: 0x4037, 0xdc2: 0x4037, 0xdc3: 0x4037, 0xdc4: 0x4037, 0xdc5: 0x4037, - 0xdc6: 0x4037, 0xdc7: 0x4037, 0xdc8: 0x4037, 0xdc9: 0x4037, 0xdca: 0x4037, 0xdcb: 0x4037, - 0xdcc: 0x4037, 0xdcd: 0x4037, 0xdce: 0x4037, 0xdcf: 0x400e, 0xdd0: 0x403f, 0xdd1: 0x4040, - 0xdd2: 0x4041, 0xdd3: 0x4040, 0xdd4: 0x403f, 0xdd5: 0x4042, 0xdd6: 0x4043, 0xdd7: 0x4044, - 0xdd8: 0x4040, 0xdd9: 0x4041, 0xdda: 0x4040, 0xddb: 0x4045, 0xddc: 0x4009, 0xddd: 0x4045, - 0xdde: 0x4046, 0xddf: 0x4045, 0xde0: 0x4047, 0xde1: 0x400b, 0xde2: 0x400a, 0xde3: 0x400c, - 0xde4: 0x4048, 0xde5: 0x4000, 0xde6: 0x4000, 0xde7: 0x4000, 0xde8: 0x4000, 0xde9: 0x4000, - 0xdea: 0x4000, 0xdeb: 0x4000, 0xdec: 0x4000, 0xded: 0x4000, 0xdee: 0x4000, 0xdef: 0x4000, - 0xdf0: 0x4000, 0xdf1: 0x4000, 0xdf2: 0x4000, 0xdf3: 0x4000, 0xdf4: 0x4000, 0xdf5: 0x4000, - 0xdf6: 0x4000, 0xdf7: 0x4000, 0xdf8: 0x4000, 0xdf9: 0x4000, 0xdfa: 0x4000, 0xdfb: 0x4000, - 0xdfc: 0x4000, 0xdfd: 0x4000, 0xdfe: 0x4000, 0xdff: 0x4000, - // Block 0x38, offset 0xe00 - 0xe00: 0x4000, 0xe01: 0x4000, 0xe02: 0x4000, 0xe03: 0x4000, 0xe04: 0x4000, 0xe05: 0x4000, - 0xe06: 0x4000, 0xe07: 0x4000, 0xe08: 0x4000, 0xe09: 0x4000, 0xe0a: 0x4000, 0xe0b: 0x4000, - 0xe0c: 0x4000, 0xe0d: 0x4000, 0xe0e: 0x4000, 0xe10: 0x4000, 0xe11: 0x4000, - 0xe12: 0x4000, 0xe13: 0x4000, 0xe14: 0x4000, 0xe15: 0x4000, 0xe16: 0x4000, 0xe17: 0x4000, - 0xe18: 0x4000, 0xe19: 0x4000, 0xe1a: 0x4000, 0xe1b: 0x4000, 0xe1c: 0x4000, 0xe1d: 0x4000, - 0xe1e: 0x4000, 0xe1f: 0x4000, 0xe20: 0x4000, 0xe21: 0x4000, 0xe22: 0x4000, 0xe23: 0x4000, - 0xe24: 0x4000, 0xe25: 0x4000, 0xe26: 0x4000, 0xe27: 0x4000, 0xe28: 0x4000, 0xe29: 0x4000, - 0xe2a: 0x4000, 0xe2b: 0x4000, 0xe2c: 0x4000, 0xe2d: 0x4000, 0xe2e: 0x4000, 0xe2f: 0x4000, - 0xe30: 0x4000, 0xe31: 0x4000, 0xe32: 0x4000, 0xe33: 0x4000, 0xe34: 0x4000, 0xe35: 0x4000, - 0xe36: 0x4000, 0xe37: 0x4000, 0xe38: 0x4000, 0xe39: 0x4000, 0xe3a: 0x4000, - // Block 0x39, offset 0xe40 - 0xe40: 0x4000, 0xe41: 0x4000, 0xe42: 0x4000, 0xe43: 0x4000, 0xe44: 0x4000, 0xe45: 0x4000, - 0xe46: 0x4000, 0xe47: 0x4000, 0xe48: 0x4000, 0xe49: 0x4000, 0xe4a: 0x4000, 0xe4b: 0x4000, - 0xe4c: 0x4000, 0xe4d: 0x4000, 0xe4e: 0x4000, 0xe4f: 0x4000, 0xe50: 0x4000, 0xe51: 0x4000, - 0xe52: 0x4000, 0xe53: 0x4000, 0xe54: 0x4000, 0xe55: 0x4000, 0xe56: 0x4000, 0xe57: 0x4000, - 0xe58: 0x4000, 0xe59: 0x4000, 0xe5a: 0x4000, 0xe5b: 0x4000, 0xe5c: 0x4000, 0xe5d: 0x4000, - 0xe5e: 0x4000, 0xe5f: 0x4000, 0xe60: 0x4000, 0xe61: 0x4000, 0xe62: 0x4000, 0xe63: 0x4000, - 0xe70: 0x4000, 0xe71: 0x4000, 0xe72: 0x4000, 0xe73: 0x4000, 0xe74: 0x4000, 0xe75: 0x4000, - 0xe76: 0x4000, 0xe77: 0x4000, 0xe78: 0x4000, 0xe79: 0x4000, 0xe7a: 0x4000, 0xe7b: 0x4000, - 0xe7c: 0x4000, 0xe7d: 0x4000, 0xe7e: 0x4000, 0xe7f: 0x4000, - // Block 0x3a, offset 0xe80 - 0xe80: 0x4000, 0xe81: 0x4000, 0xe82: 0x4000, 0xe83: 0x4000, 0xe84: 0x4000, 0xe85: 0x4000, - 0xe86: 0x4000, 0xe87: 0x4000, 0xe88: 0x4000, 0xe89: 0x4000, 0xe8a: 0x4000, 0xe8b: 0x4000, - 0xe8c: 0x4000, 0xe8d: 0x4000, 0xe8e: 0x4000, 0xe8f: 0x4000, 0xe90: 0x4000, 0xe91: 0x4000, - 0xe92: 0x4000, 0xe93: 0x4000, 0xe94: 0x4000, 0xe95: 0x4000, 0xe96: 0x4000, 0xe97: 0x4000, - 0xe98: 0x4000, 0xe99: 0x4000, 0xe9a: 0x4000, 0xe9b: 0x4000, 0xe9c: 0x4000, 0xe9d: 0x4000, - 0xe9e: 0x4000, 0xea0: 0x4000, 0xea1: 0x4000, 0xea2: 0x4000, 0xea3: 0x4000, - 0xea4: 0x4000, 0xea5: 0x4000, 0xea6: 0x4000, 0xea7: 0x4000, 0xea8: 0x4000, 0xea9: 0x4000, - 0xeaa: 0x4000, 0xeab: 0x4000, 0xeac: 0x4000, 0xead: 0x4000, 0xeae: 0x4000, 0xeaf: 0x4000, - 0xeb0: 0x4000, 0xeb1: 0x4000, 0xeb2: 0x4000, 0xeb3: 0x4000, 0xeb4: 0x4000, 0xeb5: 0x4000, - 0xeb6: 0x4000, 0xeb7: 0x4000, 0xeb8: 0x4000, 0xeb9: 0x4000, 0xeba: 0x4000, 0xebb: 0x4000, - 0xebc: 0x4000, 0xebd: 0x4000, 0xebe: 0x4000, 0xebf: 0x4000, - // Block 0x3b, offset 0xec0 - 0xec0: 0x4000, 0xec1: 0x4000, 0xec2: 0x4000, 0xec3: 0x4000, 0xec4: 0x4000, 0xec5: 0x4000, - 0xec6: 0x4000, 0xec7: 0x4000, 0xec8: 0x2000, 0xec9: 0x2000, 0xeca: 0x2000, 0xecb: 0x2000, - 0xecc: 0x2000, 0xecd: 0x2000, 0xece: 0x2000, 0xecf: 0x2000, 0xed0: 0x4000, 0xed1: 0x4000, - 0xed2: 0x4000, 0xed3: 0x4000, 0xed4: 0x4000, 0xed5: 0x4000, 0xed6: 0x4000, 0xed7: 0x4000, - 0xed8: 0x4000, 0xed9: 0x4000, 0xeda: 0x4000, 0xedb: 0x4000, 0xedc: 0x4000, 0xedd: 0x4000, - 0xede: 0x4000, 0xedf: 0x4000, 0xee0: 0x4000, 0xee1: 0x4000, 0xee2: 0x4000, 0xee3: 0x4000, - 0xee4: 0x4000, 0xee5: 0x4000, 0xee6: 0x4000, 0xee7: 0x4000, 0xee8: 0x4000, 0xee9: 0x4000, - 0xeea: 0x4000, 0xeeb: 0x4000, 0xeec: 0x4000, 0xeed: 0x4000, 0xeee: 0x4000, 0xeef: 0x4000, - 0xef0: 0x4000, 0xef1: 0x4000, 0xef2: 0x4000, 0xef3: 0x4000, 0xef4: 0x4000, 0xef5: 0x4000, - 0xef6: 0x4000, 0xef7: 0x4000, 0xef8: 0x4000, 0xef9: 0x4000, 0xefa: 0x4000, 0xefb: 0x4000, - 0xefc: 0x4000, 0xefd: 0x4000, 0xefe: 0x4000, 0xeff: 0x4000, - // Block 0x3c, offset 0xf00 - 0xf00: 0x4000, 0xf01: 0x4000, 0xf02: 0x4000, 0xf03: 0x4000, 0xf04: 0x4000, 0xf05: 0x4000, - 0xf06: 0x4000, 0xf07: 0x4000, 0xf08: 0x4000, 0xf09: 0x4000, 0xf0a: 0x4000, 0xf0b: 0x4000, - 0xf0c: 0x4000, 0xf0d: 0x4000, 0xf0e: 0x4000, 0xf0f: 0x4000, 0xf10: 0x4000, 0xf11: 0x4000, - 0xf12: 0x4000, 0xf13: 0x4000, 0xf14: 0x4000, 0xf15: 0x4000, 0xf16: 0x4000, 0xf17: 0x4000, - 0xf18: 0x4000, 0xf19: 0x4000, 0xf1a: 0x4000, 0xf1b: 0x4000, 0xf1c: 0x4000, 0xf1d: 0x4000, - 0xf1e: 0x4000, 0xf1f: 0x4000, 0xf20: 0x4000, 0xf21: 0x4000, 0xf22: 0x4000, 0xf23: 0x4000, - 0xf24: 0x4000, 0xf25: 0x4000, 0xf26: 0x4000, 0xf27: 0x4000, 0xf28: 0x4000, 0xf29: 0x4000, - 0xf2a: 0x4000, 0xf2b: 0x4000, 0xf2c: 0x4000, 0xf2d: 0x4000, 0xf2e: 0x4000, 0xf2f: 0x4000, - 0xf30: 0x4000, 0xf31: 0x4000, 0xf32: 0x4000, 0xf33: 0x4000, 0xf34: 0x4000, 0xf35: 0x4000, - 0xf36: 0x4000, 0xf37: 0x4000, 0xf38: 0x4000, 0xf39: 0x4000, 0xf3a: 0x4000, 0xf3b: 0x4000, - 0xf3c: 0x4000, 0xf3d: 0x4000, 0xf3e: 0x4000, - // Block 0x3d, offset 0xf40 - 0xf40: 0x4000, 0xf41: 0x4000, 0xf42: 0x4000, 0xf43: 0x4000, 0xf44: 0x4000, 0xf45: 0x4000, - 0xf46: 0x4000, 0xf47: 0x4000, 0xf48: 0x4000, 0xf49: 0x4000, 0xf4a: 0x4000, 0xf4b: 0x4000, - 0xf4c: 0x4000, 0xf50: 0x4000, 0xf51: 0x4000, - 0xf52: 0x4000, 0xf53: 0x4000, 0xf54: 0x4000, 0xf55: 0x4000, 0xf56: 0x4000, 0xf57: 0x4000, - 0xf58: 0x4000, 0xf59: 0x4000, 0xf5a: 0x4000, 0xf5b: 0x4000, 0xf5c: 0x4000, 0xf5d: 0x4000, - 0xf5e: 0x4000, 0xf5f: 0x4000, 0xf60: 0x4000, 0xf61: 0x4000, 0xf62: 0x4000, 0xf63: 0x4000, - 0xf64: 0x4000, 0xf65: 0x4000, 0xf66: 0x4000, 0xf67: 0x4000, 0xf68: 0x4000, 0xf69: 0x4000, - 0xf6a: 0x4000, 0xf6b: 0x4000, 0xf6c: 0x4000, 0xf6d: 0x4000, 0xf6e: 0x4000, 0xf6f: 0x4000, - 0xf70: 0x4000, 0xf71: 0x4000, 0xf72: 0x4000, 0xf73: 0x4000, 0xf74: 0x4000, 0xf75: 0x4000, - 0xf76: 0x4000, 0xf77: 0x4000, 0xf78: 0x4000, 0xf79: 0x4000, 0xf7a: 0x4000, 0xf7b: 0x4000, - 0xf7c: 0x4000, 0xf7d: 0x4000, 0xf7e: 0x4000, 0xf7f: 0x4000, - // Block 0x3e, offset 0xf80 - 0xf80: 0x4000, 0xf81: 0x4000, 0xf82: 0x4000, 0xf83: 0x4000, 0xf84: 0x4000, 0xf85: 0x4000, - 0xf86: 0x4000, - // Block 0x3f, offset 0xfc0 - 0xfe0: 0x4000, 0xfe1: 0x4000, 0xfe2: 0x4000, 0xfe3: 0x4000, - 0xfe4: 0x4000, 0xfe5: 0x4000, 0xfe6: 0x4000, 0xfe7: 0x4000, 0xfe8: 0x4000, 0xfe9: 0x4000, - 0xfea: 0x4000, 0xfeb: 0x4000, 0xfec: 0x4000, 0xfed: 0x4000, 0xfee: 0x4000, 0xfef: 0x4000, - 0xff0: 0x4000, 0xff1: 0x4000, 0xff2: 0x4000, 0xff3: 0x4000, 0xff4: 0x4000, 0xff5: 0x4000, - 0xff6: 0x4000, 0xff7: 0x4000, 0xff8: 0x4000, 0xff9: 0x4000, 0xffa: 0x4000, 0xffb: 0x4000, - 0xffc: 0x4000, - // Block 0x40, offset 0x1000 - 0x1000: 0x4000, 0x1001: 0x4000, 0x1002: 0x4000, 0x1003: 0x4000, 0x1004: 0x4000, 0x1005: 0x4000, - 0x1006: 0x4000, 0x1007: 0x4000, 0x1008: 0x4000, 0x1009: 0x4000, 0x100a: 0x4000, 0x100b: 0x4000, - 0x100c: 0x4000, 0x100d: 0x4000, 0x100e: 0x4000, 0x100f: 0x4000, 0x1010: 0x4000, 0x1011: 0x4000, - 0x1012: 0x4000, 0x1013: 0x4000, 0x1014: 0x4000, 0x1015: 0x4000, 0x1016: 0x4000, 0x1017: 0x4000, - 0x1018: 0x4000, 0x1019: 0x4000, 0x101a: 0x4000, 0x101b: 0x4000, 0x101c: 0x4000, 0x101d: 0x4000, - 0x101e: 0x4000, 0x101f: 0x4000, 0x1020: 0x4000, 0x1021: 0x4000, 0x1022: 0x4000, 0x1023: 0x4000, - // Block 0x41, offset 0x1040 - 0x1040: 0x2000, 0x1041: 0x2000, 0x1042: 0x2000, 0x1043: 0x2000, 0x1044: 0x2000, 0x1045: 0x2000, - 0x1046: 0x2000, 0x1047: 0x2000, 0x1048: 0x2000, 0x1049: 0x2000, 0x104a: 0x2000, 0x104b: 0x2000, - 0x104c: 0x2000, 0x104d: 0x2000, 0x104e: 0x2000, 0x104f: 0x2000, 0x1050: 0x4000, 0x1051: 0x4000, - 0x1052: 0x4000, 0x1053: 0x4000, 0x1054: 0x4000, 0x1055: 0x4000, 0x1056: 0x4000, 0x1057: 0x4000, - 0x1058: 0x4000, 0x1059: 0x4000, - 0x1070: 0x4000, 0x1071: 0x4000, 0x1072: 0x4000, 0x1073: 0x4000, 0x1074: 0x4000, 0x1075: 0x4000, - 0x1076: 0x4000, 0x1077: 0x4000, 0x1078: 0x4000, 0x1079: 0x4000, 0x107a: 0x4000, 0x107b: 0x4000, - 0x107c: 0x4000, 0x107d: 0x4000, 0x107e: 0x4000, 0x107f: 0x4000, - // Block 0x42, offset 0x1080 - 0x1080: 0x4000, 0x1081: 0x4000, 0x1082: 0x4000, 0x1083: 0x4000, 0x1084: 0x4000, 0x1085: 0x4000, - 0x1086: 0x4000, 0x1087: 0x4000, 0x1088: 0x4000, 0x1089: 0x4000, 0x108a: 0x4000, 0x108b: 0x4000, - 0x108c: 0x4000, 0x108d: 0x4000, 0x108e: 0x4000, 0x108f: 0x4000, 0x1090: 0x4000, 0x1091: 0x4000, - 0x1092: 0x4000, 0x1094: 0x4000, 0x1095: 0x4000, 0x1096: 0x4000, 0x1097: 0x4000, - 0x1098: 0x4000, 0x1099: 0x4000, 0x109a: 0x4000, 0x109b: 0x4000, 0x109c: 0x4000, 0x109d: 0x4000, - 0x109e: 0x4000, 0x109f: 0x4000, 0x10a0: 0x4000, 0x10a1: 0x4000, 0x10a2: 0x4000, 0x10a3: 0x4000, - 0x10a4: 0x4000, 0x10a5: 0x4000, 0x10a6: 0x4000, 0x10a8: 0x4000, 0x10a9: 0x4000, - 0x10aa: 0x4000, 0x10ab: 0x4000, - // Block 0x43, offset 0x10c0 - 0x10c1: 0x9012, 0x10c2: 0x9012, 0x10c3: 0x9012, 0x10c4: 0x9012, 0x10c5: 0x9012, - 0x10c6: 0x9012, 0x10c7: 0x9012, 0x10c8: 0x9012, 0x10c9: 0x9012, 0x10ca: 0x9012, 0x10cb: 0x9012, - 0x10cc: 0x9012, 0x10cd: 0x9012, 0x10ce: 0x9012, 0x10cf: 0x9012, 0x10d0: 0x9012, 0x10d1: 0x9012, - 0x10d2: 0x9012, 0x10d3: 0x9012, 0x10d4: 0x9012, 0x10d5: 0x9012, 0x10d6: 0x9012, 0x10d7: 0x9012, - 0x10d8: 0x9012, 0x10d9: 0x9012, 0x10da: 0x9012, 0x10db: 0x9012, 0x10dc: 0x9012, 0x10dd: 0x9012, - 0x10de: 0x9012, 0x10df: 0x9012, 0x10e0: 0x9049, 0x10e1: 0x9049, 0x10e2: 0x9049, 0x10e3: 0x9049, - 0x10e4: 0x9049, 0x10e5: 0x9049, 0x10e6: 0x9049, 0x10e7: 0x9049, 0x10e8: 0x9049, 0x10e9: 0x9049, - 0x10ea: 0x9049, 0x10eb: 0x9049, 0x10ec: 0x9049, 0x10ed: 0x9049, 0x10ee: 0x9049, 0x10ef: 0x9049, - 0x10f0: 0x9049, 0x10f1: 0x9049, 0x10f2: 0x9049, 0x10f3: 0x9049, 0x10f4: 0x9049, 0x10f5: 0x9049, - 0x10f6: 0x9049, 0x10f7: 0x9049, 0x10f8: 0x9049, 0x10f9: 0x9049, 0x10fa: 0x9049, 0x10fb: 0x9049, - 0x10fc: 0x9049, 0x10fd: 0x9049, 0x10fe: 0x9049, 0x10ff: 0x9049, - // Block 0x44, offset 0x1100 - 0x1100: 0x9049, 0x1101: 0x9049, 0x1102: 0x9049, 0x1103: 0x9049, 0x1104: 0x9049, 0x1105: 0x9049, - 0x1106: 0x9049, 0x1107: 0x9049, 0x1108: 0x9049, 0x1109: 0x9049, 0x110a: 0x9049, 0x110b: 0x9049, - 0x110c: 0x9049, 0x110d: 0x9049, 0x110e: 0x9049, 0x110f: 0x9049, 0x1110: 0x9049, 0x1111: 0x9049, - 0x1112: 0x9049, 0x1113: 0x9049, 0x1114: 0x9049, 0x1115: 0x9049, 0x1116: 0x9049, 0x1117: 0x9049, - 0x1118: 0x9049, 0x1119: 0x9049, 0x111a: 0x9049, 0x111b: 0x9049, 0x111c: 0x9049, 0x111d: 0x9049, - 0x111e: 0x9049, 0x111f: 0x904a, 0x1120: 0x904b, 0x1121: 0xb04c, 0x1122: 0xb04d, 0x1123: 0xb04d, - 0x1124: 0xb04e, 0x1125: 0xb04f, 0x1126: 0xb050, 0x1127: 0xb051, 0x1128: 0xb052, 0x1129: 0xb053, - 0x112a: 0xb054, 0x112b: 0xb055, 0x112c: 0xb056, 0x112d: 0xb057, 0x112e: 0xb058, 0x112f: 0xb059, - 0x1130: 0xb05a, 0x1131: 0xb05b, 0x1132: 0xb05c, 0x1133: 0xb05d, 0x1134: 0xb05e, 0x1135: 0xb05f, - 0x1136: 0xb060, 0x1137: 0xb061, 0x1138: 0xb062, 0x1139: 0xb063, 0x113a: 0xb064, 0x113b: 0xb065, - 0x113c: 0xb052, 0x113d: 0xb066, 0x113e: 0xb067, 0x113f: 0xb055, - // Block 0x45, offset 0x1140 - 0x1140: 0xb068, 0x1141: 0xb069, 0x1142: 0xb06a, 0x1143: 0xb06b, 0x1144: 0xb05a, 0x1145: 0xb056, - 0x1146: 0xb06c, 0x1147: 0xb06d, 0x1148: 0xb06b, 0x1149: 0xb06e, 0x114a: 0xb06b, 0x114b: 0xb06f, - 0x114c: 0xb06f, 0x114d: 0xb070, 0x114e: 0xb070, 0x114f: 0xb071, 0x1150: 0xb056, 0x1151: 0xb072, - 0x1152: 0xb073, 0x1153: 0xb072, 0x1154: 0xb074, 0x1155: 0xb073, 0x1156: 0xb075, 0x1157: 0xb075, - 0x1158: 0xb076, 0x1159: 0xb076, 0x115a: 0xb077, 0x115b: 0xb077, 0x115c: 0xb073, 0x115d: 0xb078, - 0x115e: 0xb079, 0x115f: 0xb067, 0x1160: 0xb07a, 0x1161: 0xb07b, 0x1162: 0xb07b, 0x1163: 0xb07b, - 0x1164: 0xb07b, 0x1165: 0xb07b, 0x1166: 0xb07b, 0x1167: 0xb07b, 0x1168: 0xb07b, 0x1169: 0xb07b, - 0x116a: 0xb07b, 0x116b: 0xb07b, 0x116c: 0xb07b, 0x116d: 0xb07b, 0x116e: 0xb07b, 0x116f: 0xb07b, - 0x1170: 0xb07c, 0x1171: 0xb07c, 0x1172: 0xb07c, 0x1173: 0xb07c, 0x1174: 0xb07c, 0x1175: 0xb07c, - 0x1176: 0xb07c, 0x1177: 0xb07c, 0x1178: 0xb07c, 0x1179: 0xb07c, 0x117a: 0xb07c, 0x117b: 0xb07c, - 0x117c: 0xb07c, 0x117d: 0xb07c, 0x117e: 0xb07c, - // Block 0x46, offset 0x1180 - 0x1182: 0xb07d, 0x1183: 0xb07e, 0x1184: 0xb07f, 0x1185: 0xb080, - 0x1186: 0xb07f, 0x1187: 0xb07e, 0x118a: 0xb081, 0x118b: 0xb082, - 0x118c: 0xb083, 0x118d: 0xb07f, 0x118e: 0xb080, 0x118f: 0xb07f, - 0x1192: 0xb084, 0x1193: 0xb085, 0x1194: 0xb084, 0x1195: 0xb086, 0x1196: 0xb084, 0x1197: 0xb087, - 0x119a: 0xb088, 0x119b: 0xb089, 0x119c: 0xb08a, - 0x11a0: 0x908b, 0x11a1: 0x908b, 0x11a2: 0x908c, 0x11a3: 0x908d, - 0x11a4: 0x908b, 0x11a5: 0x908e, 0x11a6: 0x908f, 0x11a8: 0xb090, 0x11a9: 0xb091, - 0x11aa: 0xb092, 0x11ab: 0xb091, 0x11ac: 0xb093, 0x11ad: 0xb094, 0x11ae: 0xb095, - 0x11bd: 0x2000, - // Block 0x47, offset 0x11c0 - 0x11e0: 0x4000, - // Block 0x48, offset 0x1200 - 0x1200: 0x4000, 0x1201: 0x4000, 0x1202: 0x4000, 0x1203: 0x4000, 0x1204: 0x4000, 0x1205: 0x4000, - 0x1206: 0x4000, 0x1207: 0x4000, 0x1208: 0x4000, 0x1209: 0x4000, 0x120a: 0x4000, 0x120b: 0x4000, - 0x120c: 0x4000, 0x120d: 0x4000, 0x120e: 0x4000, 0x120f: 0x4000, 0x1210: 0x4000, 0x1211: 0x4000, - 0x1212: 0x4000, 0x1213: 0x4000, 0x1214: 0x4000, 0x1215: 0x4000, 0x1216: 0x4000, 0x1217: 0x4000, - 0x1218: 0x4000, 0x1219: 0x4000, 0x121a: 0x4000, 0x121b: 0x4000, 0x121c: 0x4000, 0x121d: 0x4000, - 0x121e: 0x4000, 0x121f: 0x4000, 0x1220: 0x4000, 0x1221: 0x4000, 0x1222: 0x4000, 0x1223: 0x4000, - 0x1224: 0x4000, 0x1225: 0x4000, 0x1226: 0x4000, 0x1227: 0x4000, 0x1228: 0x4000, 0x1229: 0x4000, - 0x122a: 0x4000, 0x122b: 0x4000, 0x122c: 0x4000, - // Block 0x49, offset 0x1240 - 0x1240: 0x4000, 0x1241: 0x4000, 0x1242: 0x4000, 0x1243: 0x4000, 0x1244: 0x4000, 0x1245: 0x4000, - 0x1246: 0x4000, 0x1247: 0x4000, 0x1248: 0x4000, 0x1249: 0x4000, 0x124a: 0x4000, 0x124b: 0x4000, - 0x124c: 0x4000, 0x124d: 0x4000, 0x124e: 0x4000, 0x124f: 0x4000, 0x1250: 0x4000, 0x1251: 0x4000, - 0x1252: 0x4000, 0x1253: 0x4000, 0x1254: 0x4000, 0x1255: 0x4000, 0x1256: 0x4000, 0x1257: 0x4000, - 0x1258: 0x4000, 0x1259: 0x4000, 0x125a: 0x4000, 0x125b: 0x4000, 0x125c: 0x4000, 0x125d: 0x4000, - 0x125e: 0x4000, 0x125f: 0x4000, 0x1260: 0x4000, 0x1261: 0x4000, 0x1262: 0x4000, 0x1263: 0x4000, - 0x1264: 0x4000, 0x1265: 0x4000, 0x1266: 0x4000, 0x1267: 0x4000, 0x1268: 0x4000, 0x1269: 0x4000, - 0x126a: 0x4000, 0x126b: 0x4000, 0x126c: 0x4000, 0x126d: 0x4000, 0x126e: 0x4000, 0x126f: 0x4000, - 0x1270: 0x4000, 0x1271: 0x4000, 0x1272: 0x4000, - // Block 0x4a, offset 0x1280 - 0x1280: 0x4000, 0x1281: 0x4000, - // Block 0x4b, offset 0x12c0 - 0x12c4: 0x4000, - // Block 0x4c, offset 0x1300 - 0x130f: 0x4000, - // Block 0x4d, offset 0x1340 - 0x1340: 0x2000, 0x1341: 0x2000, 0x1342: 0x2000, 0x1343: 0x2000, 0x1344: 0x2000, 0x1345: 0x2000, - 0x1346: 0x2000, 0x1347: 0x2000, 0x1348: 0x2000, 0x1349: 0x2000, 0x134a: 0x2000, - 0x1350: 0x2000, 0x1351: 0x2000, - 0x1352: 0x2000, 0x1353: 0x2000, 0x1354: 0x2000, 0x1355: 0x2000, 0x1356: 0x2000, 0x1357: 0x2000, - 0x1358: 0x2000, 0x1359: 0x2000, 0x135a: 0x2000, 0x135b: 0x2000, 0x135c: 0x2000, 0x135d: 0x2000, - 0x135e: 0x2000, 0x135f: 0x2000, 0x1360: 0x2000, 0x1361: 0x2000, 0x1362: 0x2000, 0x1363: 0x2000, - 0x1364: 0x2000, 0x1365: 0x2000, 0x1366: 0x2000, 0x1367: 0x2000, 0x1368: 0x2000, 0x1369: 0x2000, - 0x136a: 0x2000, 0x136b: 0x2000, 0x136c: 0x2000, 0x136d: 0x2000, - 0x1370: 0x2000, 0x1371: 0x2000, 0x1372: 0x2000, 0x1373: 0x2000, 0x1374: 0x2000, 0x1375: 0x2000, - 0x1376: 0x2000, 0x1377: 0x2000, 0x1378: 0x2000, 0x1379: 0x2000, 0x137a: 0x2000, 0x137b: 0x2000, - 0x137c: 0x2000, 0x137d: 0x2000, 0x137e: 0x2000, 0x137f: 0x2000, - // Block 0x4e, offset 0x1380 - 0x1380: 0x2000, 0x1381: 0x2000, 0x1382: 0x2000, 0x1383: 0x2000, 0x1384: 0x2000, 0x1385: 0x2000, - 0x1386: 0x2000, 0x1387: 0x2000, 0x1388: 0x2000, 0x1389: 0x2000, 0x138a: 0x2000, 0x138b: 0x2000, - 0x138c: 0x2000, 0x138d: 0x2000, 0x138e: 0x2000, 0x138f: 0x2000, 0x1390: 0x2000, 0x1391: 0x2000, - 0x1392: 0x2000, 0x1393: 0x2000, 0x1394: 0x2000, 0x1395: 0x2000, 0x1396: 0x2000, 0x1397: 0x2000, - 0x1398: 0x2000, 0x1399: 0x2000, 0x139a: 0x2000, 0x139b: 0x2000, 0x139c: 0x2000, 0x139d: 0x2000, - 0x139e: 0x2000, 0x139f: 0x2000, 0x13a0: 0x2000, 0x13a1: 0x2000, 0x13a2: 0x2000, 0x13a3: 0x2000, - 0x13a4: 0x2000, 0x13a5: 0x2000, 0x13a6: 0x2000, 0x13a7: 0x2000, 0x13a8: 0x2000, 0x13a9: 0x2000, - 0x13b0: 0x2000, 0x13b1: 0x2000, 0x13b2: 0x2000, 0x13b3: 0x2000, 0x13b4: 0x2000, 0x13b5: 0x2000, - 0x13b6: 0x2000, 0x13b7: 0x2000, 0x13b8: 0x2000, 0x13b9: 0x2000, 0x13ba: 0x2000, 0x13bb: 0x2000, - 0x13bc: 0x2000, 0x13bd: 0x2000, 0x13be: 0x2000, 0x13bf: 0x2000, - // Block 0x4f, offset 0x13c0 - 0x13c0: 0x2000, 0x13c1: 0x2000, 0x13c2: 0x2000, 0x13c3: 0x2000, 0x13c4: 0x2000, 0x13c5: 0x2000, - 0x13c6: 0x2000, 0x13c7: 0x2000, 0x13c8: 0x2000, 0x13c9: 0x2000, 0x13ca: 0x2000, 0x13cb: 0x2000, - 0x13cc: 0x2000, 0x13cd: 0x2000, 0x13ce: 0x4000, 0x13cf: 0x2000, 0x13d0: 0x2000, 0x13d1: 0x4000, - 0x13d2: 0x4000, 0x13d3: 0x4000, 0x13d4: 0x4000, 0x13d5: 0x4000, 0x13d6: 0x4000, 0x13d7: 0x4000, - 0x13d8: 0x4000, 0x13d9: 0x4000, 0x13da: 0x4000, 0x13db: 0x2000, 0x13dc: 0x2000, 0x13dd: 0x2000, - 0x13de: 0x2000, 0x13df: 0x2000, 0x13e0: 0x2000, 0x13e1: 0x2000, 0x13e2: 0x2000, 0x13e3: 0x2000, - 0x13e4: 0x2000, 0x13e5: 0x2000, 0x13e6: 0x2000, 0x13e7: 0x2000, 0x13e8: 0x2000, 0x13e9: 0x2000, - 0x13ea: 0x2000, 0x13eb: 0x2000, 0x13ec: 0x2000, - // Block 0x50, offset 0x1400 - 0x1400: 0x4000, 0x1401: 0x4000, 0x1402: 0x4000, - 0x1410: 0x4000, 0x1411: 0x4000, - 0x1412: 0x4000, 0x1413: 0x4000, 0x1414: 0x4000, 0x1415: 0x4000, 0x1416: 0x4000, 0x1417: 0x4000, - 0x1418: 0x4000, 0x1419: 0x4000, 0x141a: 0x4000, 0x141b: 0x4000, 0x141c: 0x4000, 0x141d: 0x4000, - 0x141e: 0x4000, 0x141f: 0x4000, 0x1420: 0x4000, 0x1421: 0x4000, 0x1422: 0x4000, 0x1423: 0x4000, - 0x1424: 0x4000, 0x1425: 0x4000, 0x1426: 0x4000, 0x1427: 0x4000, 0x1428: 0x4000, 0x1429: 0x4000, - 0x142a: 0x4000, 0x142b: 0x4000, 0x142c: 0x4000, 0x142d: 0x4000, 0x142e: 0x4000, 0x142f: 0x4000, - 0x1430: 0x4000, 0x1431: 0x4000, 0x1432: 0x4000, 0x1433: 0x4000, 0x1434: 0x4000, 0x1435: 0x4000, - 0x1436: 0x4000, 0x1437: 0x4000, 0x1438: 0x4000, 0x1439: 0x4000, 0x143a: 0x4000, 0x143b: 0x4000, - // Block 0x51, offset 0x1440 - 0x1440: 0x4000, 0x1441: 0x4000, 0x1442: 0x4000, 0x1443: 0x4000, 0x1444: 0x4000, 0x1445: 0x4000, - 0x1446: 0x4000, 0x1447: 0x4000, 0x1448: 0x4000, - 0x1450: 0x4000, 0x1451: 0x4000, - // Block 0x52, offset 0x1480 - 0x1480: 0x4000, 0x1481: 0x4000, 0x1482: 0x4000, 0x1483: 0x4000, 0x1484: 0x4000, 0x1485: 0x4000, - 0x1486: 0x4000, 0x1487: 0x4000, 0x1488: 0x4000, 0x1489: 0x4000, 0x148a: 0x4000, 0x148b: 0x4000, - 0x148c: 0x4000, 0x148d: 0x4000, 0x148e: 0x4000, 0x148f: 0x4000, 0x1490: 0x4000, 0x1491: 0x4000, - 0x1492: 0x4000, 0x1493: 0x4000, 0x1494: 0x4000, 0x1495: 0x4000, 0x1496: 0x4000, 0x1497: 0x4000, - 0x1498: 0x4000, 0x1499: 0x4000, 0x149a: 0x4000, 0x149b: 0x4000, 0x149c: 0x4000, 0x149d: 0x4000, - 0x149e: 0x4000, 0x149f: 0x4000, 0x14a0: 0x4000, - 0x14ad: 0x4000, 0x14ae: 0x4000, 0x14af: 0x4000, - 0x14b0: 0x4000, 0x14b1: 0x4000, 0x14b2: 0x4000, 0x14b3: 0x4000, 0x14b4: 0x4000, 0x14b5: 0x4000, - 0x14b7: 0x4000, 0x14b8: 0x4000, 0x14b9: 0x4000, 0x14ba: 0x4000, 0x14bb: 0x4000, - 0x14bc: 0x4000, 0x14bd: 0x4000, 0x14be: 0x4000, 0x14bf: 0x4000, - // Block 0x53, offset 0x14c0 - 0x14c0: 0x4000, 0x14c1: 0x4000, 0x14c2: 0x4000, 0x14c3: 0x4000, 0x14c4: 0x4000, 0x14c5: 0x4000, - 0x14c6: 0x4000, 0x14c7: 0x4000, 0x14c8: 0x4000, 0x14c9: 0x4000, 0x14ca: 0x4000, 0x14cb: 0x4000, - 0x14cc: 0x4000, 0x14cd: 0x4000, 0x14ce: 0x4000, 0x14cf: 0x4000, 0x14d0: 0x4000, 0x14d1: 0x4000, - 0x14d2: 0x4000, 0x14d3: 0x4000, 0x14d4: 0x4000, 0x14d5: 0x4000, 0x14d6: 0x4000, 0x14d7: 0x4000, - 0x14d8: 0x4000, 0x14d9: 0x4000, 0x14da: 0x4000, 0x14db: 0x4000, 0x14dc: 0x4000, 0x14dd: 0x4000, - 0x14de: 0x4000, 0x14df: 0x4000, 0x14e0: 0x4000, 0x14e1: 0x4000, 0x14e2: 0x4000, 0x14e3: 0x4000, - 0x14e4: 0x4000, 0x14e5: 0x4000, 0x14e6: 0x4000, 0x14e7: 0x4000, 0x14e8: 0x4000, 0x14e9: 0x4000, - 0x14ea: 0x4000, 0x14eb: 0x4000, 0x14ec: 0x4000, 0x14ed: 0x4000, 0x14ee: 0x4000, 0x14ef: 0x4000, - 0x14f0: 0x4000, 0x14f1: 0x4000, 0x14f2: 0x4000, 0x14f3: 0x4000, 0x14f4: 0x4000, 0x14f5: 0x4000, - 0x14f6: 0x4000, 0x14f7: 0x4000, 0x14f8: 0x4000, 0x14f9: 0x4000, 0x14fa: 0x4000, 0x14fb: 0x4000, - 0x14fc: 0x4000, 0x14fe: 0x4000, 0x14ff: 0x4000, - // Block 0x54, offset 0x1500 - 0x1500: 0x4000, 0x1501: 0x4000, 0x1502: 0x4000, 0x1503: 0x4000, 0x1504: 0x4000, 0x1505: 0x4000, - 0x1506: 0x4000, 0x1507: 0x4000, 0x1508: 0x4000, 0x1509: 0x4000, 0x150a: 0x4000, 0x150b: 0x4000, - 0x150c: 0x4000, 0x150d: 0x4000, 0x150e: 0x4000, 0x150f: 0x4000, 0x1510: 0x4000, 0x1511: 0x4000, - 0x1512: 0x4000, 0x1513: 0x4000, - 0x1520: 0x4000, 0x1521: 0x4000, 0x1522: 0x4000, 0x1523: 0x4000, - 0x1524: 0x4000, 0x1525: 0x4000, 0x1526: 0x4000, 0x1527: 0x4000, 0x1528: 0x4000, 0x1529: 0x4000, - 0x152a: 0x4000, 0x152b: 0x4000, 0x152c: 0x4000, 0x152d: 0x4000, 0x152e: 0x4000, 0x152f: 0x4000, - 0x1530: 0x4000, 0x1531: 0x4000, 0x1532: 0x4000, 0x1533: 0x4000, 0x1534: 0x4000, 0x1535: 0x4000, - 0x1536: 0x4000, 0x1537: 0x4000, 0x1538: 0x4000, 0x1539: 0x4000, 0x153a: 0x4000, 0x153b: 0x4000, - 0x153c: 0x4000, 0x153d: 0x4000, 0x153e: 0x4000, 0x153f: 0x4000, - // Block 0x55, offset 0x1540 - 0x1540: 0x4000, 0x1541: 0x4000, 0x1542: 0x4000, 0x1543: 0x4000, 0x1544: 0x4000, 0x1545: 0x4000, - 0x1546: 0x4000, 0x1547: 0x4000, 0x1548: 0x4000, 0x1549: 0x4000, 0x154a: 0x4000, - 0x154f: 0x4000, 0x1550: 0x4000, 0x1551: 0x4000, - 0x1552: 0x4000, 0x1553: 0x4000, - 0x1560: 0x4000, 0x1561: 0x4000, 0x1562: 0x4000, 0x1563: 0x4000, - 0x1564: 0x4000, 0x1565: 0x4000, 0x1566: 0x4000, 0x1567: 0x4000, 0x1568: 0x4000, 0x1569: 0x4000, - 0x156a: 0x4000, 0x156b: 0x4000, 0x156c: 0x4000, 0x156d: 0x4000, 0x156e: 0x4000, 0x156f: 0x4000, - 0x1570: 0x4000, 0x1574: 0x4000, - 0x1578: 0x4000, 0x1579: 0x4000, 0x157a: 0x4000, 0x157b: 0x4000, - 0x157c: 0x4000, 0x157d: 0x4000, 0x157e: 0x4000, 0x157f: 0x4000, - // Block 0x56, offset 0x1580 - 0x1580: 0x4000, 0x1582: 0x4000, 0x1583: 0x4000, 0x1584: 0x4000, 0x1585: 0x4000, - 0x1586: 0x4000, 0x1587: 0x4000, 0x1588: 0x4000, 0x1589: 0x4000, 0x158a: 0x4000, 0x158b: 0x4000, - 0x158c: 0x4000, 0x158d: 0x4000, 0x158e: 0x4000, 0x158f: 0x4000, 0x1590: 0x4000, 0x1591: 0x4000, - 0x1592: 0x4000, 0x1593: 0x4000, 0x1594: 0x4000, 0x1595: 0x4000, 0x1596: 0x4000, 0x1597: 0x4000, - 0x1598: 0x4000, 0x1599: 0x4000, 0x159a: 0x4000, 0x159b: 0x4000, 0x159c: 0x4000, 0x159d: 0x4000, - 0x159e: 0x4000, 0x159f: 0x4000, 0x15a0: 0x4000, 0x15a1: 0x4000, 0x15a2: 0x4000, 0x15a3: 0x4000, - 0x15a4: 0x4000, 0x15a5: 0x4000, 0x15a6: 0x4000, 0x15a7: 0x4000, 0x15a8: 0x4000, 0x15a9: 0x4000, - 0x15aa: 0x4000, 0x15ab: 0x4000, 0x15ac: 0x4000, 0x15ad: 0x4000, 0x15ae: 0x4000, 0x15af: 0x4000, - 0x15b0: 0x4000, 0x15b1: 0x4000, 0x15b2: 0x4000, 0x15b3: 0x4000, 0x15b4: 0x4000, 0x15b5: 0x4000, - 0x15b6: 0x4000, 0x15b7: 0x4000, 0x15b8: 0x4000, 0x15b9: 0x4000, 0x15ba: 0x4000, 0x15bb: 0x4000, - 0x15bc: 0x4000, 0x15bd: 0x4000, 0x15be: 0x4000, 0x15bf: 0x4000, - // Block 0x57, offset 0x15c0 - 0x15c0: 0x4000, 0x15c1: 0x4000, 0x15c2: 0x4000, 0x15c3: 0x4000, 0x15c4: 0x4000, 0x15c5: 0x4000, - 0x15c6: 0x4000, 0x15c7: 0x4000, 0x15c8: 0x4000, 0x15c9: 0x4000, 0x15ca: 0x4000, 0x15cb: 0x4000, - 0x15cc: 0x4000, 0x15cd: 0x4000, 0x15ce: 0x4000, 0x15cf: 0x4000, 0x15d0: 0x4000, 0x15d1: 0x4000, - 0x15d2: 0x4000, 0x15d3: 0x4000, 0x15d4: 0x4000, 0x15d5: 0x4000, 0x15d6: 0x4000, 0x15d7: 0x4000, - 0x15d8: 0x4000, 0x15d9: 0x4000, 0x15da: 0x4000, 0x15db: 0x4000, 0x15dc: 0x4000, 0x15dd: 0x4000, - 0x15de: 0x4000, 0x15df: 0x4000, 0x15e0: 0x4000, 0x15e1: 0x4000, 0x15e2: 0x4000, 0x15e3: 0x4000, - 0x15e4: 0x4000, 0x15e5: 0x4000, 0x15e6: 0x4000, 0x15e7: 0x4000, 0x15e8: 0x4000, 0x15e9: 0x4000, - 0x15ea: 0x4000, 0x15eb: 0x4000, 0x15ec: 0x4000, 0x15ed: 0x4000, 0x15ee: 0x4000, 0x15ef: 0x4000, - 0x15f0: 0x4000, 0x15f1: 0x4000, 0x15f2: 0x4000, 0x15f3: 0x4000, 0x15f4: 0x4000, 0x15f5: 0x4000, - 0x15f6: 0x4000, 0x15f7: 0x4000, 0x15f8: 0x4000, 0x15f9: 0x4000, 0x15fa: 0x4000, 0x15fb: 0x4000, - 0x15fc: 0x4000, 0x15ff: 0x4000, - // Block 0x58, offset 0x1600 - 0x1600: 0x4000, 0x1601: 0x4000, 0x1602: 0x4000, 0x1603: 0x4000, 0x1604: 0x4000, 0x1605: 0x4000, - 0x1606: 0x4000, 0x1607: 0x4000, 0x1608: 0x4000, 0x1609: 0x4000, 0x160a: 0x4000, 0x160b: 0x4000, - 0x160c: 0x4000, 0x160d: 0x4000, 0x160e: 0x4000, 0x160f: 0x4000, 0x1610: 0x4000, 0x1611: 0x4000, - 0x1612: 0x4000, 0x1613: 0x4000, 0x1614: 0x4000, 0x1615: 0x4000, 0x1616: 0x4000, 0x1617: 0x4000, - 0x1618: 0x4000, 0x1619: 0x4000, 0x161a: 0x4000, 0x161b: 0x4000, 0x161c: 0x4000, 0x161d: 0x4000, - 0x161e: 0x4000, 0x161f: 0x4000, 0x1620: 0x4000, 0x1621: 0x4000, 0x1622: 0x4000, 0x1623: 0x4000, - 0x1624: 0x4000, 0x1625: 0x4000, 0x1626: 0x4000, 0x1627: 0x4000, 0x1628: 0x4000, 0x1629: 0x4000, - 0x162a: 0x4000, 0x162b: 0x4000, 0x162c: 0x4000, 0x162d: 0x4000, 0x162e: 0x4000, 0x162f: 0x4000, - 0x1630: 0x4000, 0x1631: 0x4000, 0x1632: 0x4000, 0x1633: 0x4000, 0x1634: 0x4000, 0x1635: 0x4000, - 0x1636: 0x4000, 0x1637: 0x4000, 0x1638: 0x4000, 0x1639: 0x4000, 0x163a: 0x4000, 0x163b: 0x4000, - 0x163c: 0x4000, 0x163d: 0x4000, - // Block 0x59, offset 0x1640 - 0x164b: 0x4000, - 0x164c: 0x4000, 0x164d: 0x4000, 0x164e: 0x4000, 0x1650: 0x4000, 0x1651: 0x4000, - 0x1652: 0x4000, 0x1653: 0x4000, 0x1654: 0x4000, 0x1655: 0x4000, 0x1656: 0x4000, 0x1657: 0x4000, - 0x1658: 0x4000, 0x1659: 0x4000, 0x165a: 0x4000, 0x165b: 0x4000, 0x165c: 0x4000, 0x165d: 0x4000, - 0x165e: 0x4000, 0x165f: 0x4000, 0x1660: 0x4000, 0x1661: 0x4000, 0x1662: 0x4000, 0x1663: 0x4000, - 0x1664: 0x4000, 0x1665: 0x4000, 0x1666: 0x4000, 0x1667: 0x4000, - 0x167a: 0x4000, - // Block 0x5a, offset 0x1680 - 0x1695: 0x4000, 0x1696: 0x4000, - 0x16a4: 0x4000, - // Block 0x5b, offset 0x16c0 - 0x16fb: 0x4000, - 0x16fc: 0x4000, 0x16fd: 0x4000, 0x16fe: 0x4000, 0x16ff: 0x4000, - // Block 0x5c, offset 0x1700 - 0x1700: 0x4000, 0x1701: 0x4000, 0x1702: 0x4000, 0x1703: 0x4000, 0x1704: 0x4000, 0x1705: 0x4000, - 0x1706: 0x4000, 0x1707: 0x4000, 0x1708: 0x4000, 0x1709: 0x4000, 0x170a: 0x4000, 0x170b: 0x4000, - 0x170c: 0x4000, 0x170d: 0x4000, 0x170e: 0x4000, 0x170f: 0x4000, - // Block 0x5d, offset 0x1740 - 0x1740: 0x4000, 0x1741: 0x4000, 0x1742: 0x4000, 0x1743: 0x4000, 0x1744: 0x4000, 0x1745: 0x4000, - 0x174c: 0x4000, 0x1750: 0x4000, 0x1751: 0x4000, - 0x1752: 0x4000, - 0x176b: 0x4000, 0x176c: 0x4000, - 0x1774: 0x4000, 0x1775: 0x4000, - 0x1776: 0x4000, - // Block 0x5e, offset 0x1780 - 0x1790: 0x4000, 0x1791: 0x4000, - 0x1792: 0x4000, 0x1793: 0x4000, 0x1794: 0x4000, 0x1795: 0x4000, 0x1796: 0x4000, 0x1797: 0x4000, - 0x1798: 0x4000, 0x1799: 0x4000, 0x179a: 0x4000, 0x179b: 0x4000, 0x179c: 0x4000, 0x179d: 0x4000, - 0x179e: 0x4000, 0x17a0: 0x4000, 0x17a1: 0x4000, 0x17a2: 0x4000, 0x17a3: 0x4000, - 0x17a4: 0x4000, 0x17a5: 0x4000, 0x17a6: 0x4000, 0x17a7: 0x4000, - 0x17b0: 0x4000, 0x17b3: 0x4000, 0x17b4: 0x4000, 0x17b5: 0x4000, - 0x17b6: 0x4000, 0x17b7: 0x4000, 0x17b8: 0x4000, 0x17b9: 0x4000, 0x17ba: 0x4000, 0x17bb: 0x4000, - 0x17bc: 0x4000, 0x17bd: 0x4000, 0x17be: 0x4000, - // Block 0x5f, offset 0x17c0 - 0x17c0: 0x4000, 0x17c1: 0x4000, 0x17c2: 0x4000, 0x17c3: 0x4000, 0x17c4: 0x4000, 0x17c5: 0x4000, - 0x17c6: 0x4000, 0x17c7: 0x4000, 0x17c8: 0x4000, 0x17c9: 0x4000, 0x17ca: 0x4000, 0x17cb: 0x4000, - 0x17d0: 0x4000, 0x17d1: 0x4000, - 0x17d2: 0x4000, 0x17d3: 0x4000, 0x17d4: 0x4000, 0x17d5: 0x4000, 0x17d6: 0x4000, 0x17d7: 0x4000, - 0x17d8: 0x4000, 0x17d9: 0x4000, 0x17da: 0x4000, 0x17db: 0x4000, 0x17dc: 0x4000, 0x17dd: 0x4000, - 0x17de: 0x4000, - // Block 0x60, offset 0x1800 - 0x1800: 0x4000, 0x1801: 0x4000, 0x1802: 0x4000, 0x1803: 0x4000, 0x1804: 0x4000, 0x1805: 0x4000, - 0x1806: 0x4000, 0x1807: 0x4000, 0x1808: 0x4000, 0x1809: 0x4000, 0x180a: 0x4000, 0x180b: 0x4000, - 0x180c: 0x4000, 0x180d: 0x4000, 0x180e: 0x4000, 0x180f: 0x4000, 0x1810: 0x4000, 0x1811: 0x4000, - // Block 0x61, offset 0x1840 - 0x1840: 0x4000, - // Block 0x62, offset 0x1880 - 0x1880: 0x2000, 0x1881: 0x2000, 0x1882: 0x2000, 0x1883: 0x2000, 0x1884: 0x2000, 0x1885: 0x2000, - 0x1886: 0x2000, 0x1887: 0x2000, 0x1888: 0x2000, 0x1889: 0x2000, 0x188a: 0x2000, 0x188b: 0x2000, - 0x188c: 0x2000, 0x188d: 0x2000, 0x188e: 0x2000, 0x188f: 0x2000, 0x1890: 0x2000, 0x1891: 0x2000, - 0x1892: 0x2000, 0x1893: 0x2000, 0x1894: 0x2000, 0x1895: 0x2000, 0x1896: 0x2000, 0x1897: 0x2000, - 0x1898: 0x2000, 0x1899: 0x2000, 0x189a: 0x2000, 0x189b: 0x2000, 0x189c: 0x2000, 0x189d: 0x2000, - 0x189e: 0x2000, 0x189f: 0x2000, 0x18a0: 0x2000, 0x18a1: 0x2000, 0x18a2: 0x2000, 0x18a3: 0x2000, - 0x18a4: 0x2000, 0x18a5: 0x2000, 0x18a6: 0x2000, 0x18a7: 0x2000, 0x18a8: 0x2000, 0x18a9: 0x2000, - 0x18aa: 0x2000, 0x18ab: 0x2000, 0x18ac: 0x2000, 0x18ad: 0x2000, 0x18ae: 0x2000, 0x18af: 0x2000, - 0x18b0: 0x2000, 0x18b1: 0x2000, 0x18b2: 0x2000, 0x18b3: 0x2000, 0x18b4: 0x2000, 0x18b5: 0x2000, - 0x18b6: 0x2000, 0x18b7: 0x2000, 0x18b8: 0x2000, 0x18b9: 0x2000, 0x18ba: 0x2000, 0x18bb: 0x2000, - 0x18bc: 0x2000, 0x18bd: 0x2000, -} - -// widthIndex: 22 blocks, 1408 entries, 1408 bytes -// Block 0 is the zero block. -var widthIndex = [1408]uint8{ - // Block 0x0, offset 0x0 - // Block 0x1, offset 0x40 - // Block 0x2, offset 0x80 - // Block 0x3, offset 0xc0 - 0xc2: 0x01, 0xc3: 0x02, 0xc4: 0x03, 0xc5: 0x04, 0xc7: 0x05, - 0xc9: 0x06, 0xcb: 0x07, 0xcc: 0x08, 0xcd: 0x09, 0xce: 0x0a, 0xcf: 0x0b, - 0xd0: 0x0c, 0xd1: 0x0d, - 0xe1: 0x02, 0xe2: 0x03, 0xe3: 0x04, 0xe4: 0x05, 0xe5: 0x06, 0xe6: 0x06, 0xe7: 0x06, - 0xe8: 0x06, 0xe9: 0x06, 0xea: 0x07, 0xeb: 0x06, 0xec: 0x06, 0xed: 0x08, 0xee: 0x09, 0xef: 0x0a, - 0xf0: 0x0f, 0xf3: 0x12, 0xf4: 0x13, - // Block 0x4, offset 0x100 - 0x104: 0x0e, 0x105: 0x0f, - // Block 0x5, offset 0x140 - 0x140: 0x10, 0x141: 0x11, 0x142: 0x12, 0x144: 0x13, 0x145: 0x14, 0x146: 0x15, 0x147: 0x16, - 0x148: 0x17, 0x149: 0x18, 0x14a: 0x19, 0x14c: 0x1a, 0x14f: 0x1b, - 0x151: 0x1c, 0x152: 0x08, 0x153: 0x1d, 0x154: 0x1e, 0x155: 0x1f, 0x156: 0x20, 0x157: 0x21, - 0x158: 0x22, 0x159: 0x23, 0x15a: 0x24, 0x15b: 0x25, 0x15c: 0x26, 0x15d: 0x27, 0x15e: 0x28, 0x15f: 0x29, - 0x166: 0x2a, - 0x16c: 0x2b, 0x16d: 0x2c, - 0x17a: 0x2d, 0x17b: 0x2e, 0x17c: 0x0e, 0x17d: 0x0e, 0x17e: 0x0e, 0x17f: 0x2f, - // Block 0x6, offset 0x180 - 0x180: 0x30, 0x181: 0x31, 0x182: 0x32, 0x183: 0x33, 0x184: 0x34, 0x185: 0x35, 0x186: 0x36, 0x187: 0x37, - 0x188: 0x38, 0x189: 0x39, 0x18a: 0x0e, 0x18b: 0x3a, 0x18c: 0x0e, 0x18d: 0x0e, 0x18e: 0x0e, 0x18f: 0x0e, - 0x190: 0x0e, 0x191: 0x0e, 0x192: 0x0e, 0x193: 0x0e, 0x194: 0x0e, 0x195: 0x0e, 0x196: 0x0e, 0x197: 0x0e, - 0x198: 0x0e, 0x199: 0x0e, 0x19a: 0x0e, 0x19b: 0x0e, 0x19c: 0x0e, 0x19d: 0x0e, 0x19e: 0x0e, 0x19f: 0x0e, - 0x1a0: 0x0e, 0x1a1: 0x0e, 0x1a2: 0x0e, 0x1a3: 0x0e, 0x1a4: 0x0e, 0x1a5: 0x0e, 0x1a6: 0x0e, 0x1a7: 0x0e, - 0x1a8: 0x0e, 0x1a9: 0x0e, 0x1aa: 0x0e, 0x1ab: 0x0e, 0x1ac: 0x0e, 0x1ad: 0x0e, 0x1ae: 0x0e, 0x1af: 0x0e, - 0x1b0: 0x0e, 0x1b1: 0x0e, 0x1b2: 0x0e, 0x1b3: 0x0e, 0x1b4: 0x0e, 0x1b5: 0x0e, 0x1b6: 0x0e, 0x1b7: 0x0e, - 0x1b8: 0x0e, 0x1b9: 0x0e, 0x1ba: 0x0e, 0x1bb: 0x0e, 0x1bc: 0x0e, 0x1bd: 0x0e, 0x1be: 0x0e, 0x1bf: 0x0e, - // Block 0x7, offset 0x1c0 - 0x1c0: 0x0e, 0x1c1: 0x0e, 0x1c2: 0x0e, 0x1c3: 0x0e, 0x1c4: 0x0e, 0x1c5: 0x0e, 0x1c6: 0x0e, 0x1c7: 0x0e, - 0x1c8: 0x0e, 0x1c9: 0x0e, 0x1ca: 0x0e, 0x1cb: 0x0e, 0x1cc: 0x0e, 0x1cd: 0x0e, 0x1ce: 0x0e, 0x1cf: 0x0e, - 0x1d0: 0x0e, 0x1d1: 0x0e, 0x1d2: 0x0e, 0x1d3: 0x0e, 0x1d4: 0x0e, 0x1d5: 0x0e, 0x1d6: 0x0e, 0x1d7: 0x0e, - 0x1d8: 0x0e, 0x1d9: 0x0e, 0x1da: 0x0e, 0x1db: 0x0e, 0x1dc: 0x0e, 0x1dd: 0x0e, 0x1de: 0x0e, 0x1df: 0x0e, - 0x1e0: 0x0e, 0x1e1: 0x0e, 0x1e2: 0x0e, 0x1e3: 0x0e, 0x1e4: 0x0e, 0x1e5: 0x0e, 0x1e6: 0x0e, 0x1e7: 0x0e, - 0x1e8: 0x0e, 0x1e9: 0x0e, 0x1ea: 0x0e, 0x1eb: 0x0e, 0x1ec: 0x0e, 0x1ed: 0x0e, 0x1ee: 0x0e, 0x1ef: 0x0e, - 0x1f0: 0x0e, 0x1f1: 0x0e, 0x1f2: 0x0e, 0x1f3: 0x0e, 0x1f4: 0x0e, 0x1f5: 0x0e, 0x1f6: 0x0e, - 0x1f8: 0x0e, 0x1f9: 0x0e, 0x1fa: 0x0e, 0x1fb: 0x0e, 0x1fc: 0x0e, 0x1fd: 0x0e, 0x1fe: 0x0e, 0x1ff: 0x0e, - // Block 0x8, offset 0x200 - 0x200: 0x0e, 0x201: 0x0e, 0x202: 0x0e, 0x203: 0x0e, 0x204: 0x0e, 0x205: 0x0e, 0x206: 0x0e, 0x207: 0x0e, - 0x208: 0x0e, 0x209: 0x0e, 0x20a: 0x0e, 0x20b: 0x0e, 0x20c: 0x0e, 0x20d: 0x0e, 0x20e: 0x0e, 0x20f: 0x0e, - 0x210: 0x0e, 0x211: 0x0e, 0x212: 0x0e, 0x213: 0x0e, 0x214: 0x0e, 0x215: 0x0e, 0x216: 0x0e, 0x217: 0x0e, - 0x218: 0x0e, 0x219: 0x0e, 0x21a: 0x0e, 0x21b: 0x0e, 0x21c: 0x0e, 0x21d: 0x0e, 0x21e: 0x0e, 0x21f: 0x0e, - 0x220: 0x0e, 0x221: 0x0e, 0x222: 0x0e, 0x223: 0x0e, 0x224: 0x0e, 0x225: 0x0e, 0x226: 0x0e, 0x227: 0x0e, - 0x228: 0x0e, 0x229: 0x0e, 0x22a: 0x0e, 0x22b: 0x0e, 0x22c: 0x0e, 0x22d: 0x0e, 0x22e: 0x0e, 0x22f: 0x0e, - 0x230: 0x0e, 0x231: 0x0e, 0x232: 0x0e, 0x233: 0x0e, 0x234: 0x0e, 0x235: 0x0e, 0x236: 0x0e, 0x237: 0x0e, - 0x238: 0x0e, 0x239: 0x0e, 0x23a: 0x0e, 0x23b: 0x0e, 0x23c: 0x0e, 0x23d: 0x0e, 0x23e: 0x0e, 0x23f: 0x0e, - // Block 0x9, offset 0x240 - 0x240: 0x0e, 0x241: 0x0e, 0x242: 0x0e, 0x243: 0x0e, 0x244: 0x0e, 0x245: 0x0e, 0x246: 0x0e, 0x247: 0x0e, - 0x248: 0x0e, 0x249: 0x0e, 0x24a: 0x0e, 0x24b: 0x0e, 0x24c: 0x0e, 0x24d: 0x0e, 0x24e: 0x0e, 0x24f: 0x0e, - 0x250: 0x0e, 0x251: 0x0e, 0x252: 0x3b, 0x253: 0x3c, - 0x265: 0x3d, - 0x270: 0x0e, 0x271: 0x0e, 0x272: 0x0e, 0x273: 0x0e, 0x274: 0x0e, 0x275: 0x0e, 0x276: 0x0e, 0x277: 0x0e, - 0x278: 0x0e, 0x279: 0x0e, 0x27a: 0x0e, 0x27b: 0x0e, 0x27c: 0x0e, 0x27d: 0x0e, 0x27e: 0x0e, 0x27f: 0x0e, - // Block 0xa, offset 0x280 - 0x280: 0x0e, 0x281: 0x0e, 0x282: 0x0e, 0x283: 0x0e, 0x284: 0x0e, 0x285: 0x0e, 0x286: 0x0e, 0x287: 0x0e, - 0x288: 0x0e, 0x289: 0x0e, 0x28a: 0x0e, 0x28b: 0x0e, 0x28c: 0x0e, 0x28d: 0x0e, 0x28e: 0x0e, 0x28f: 0x0e, - 0x290: 0x0e, 0x291: 0x0e, 0x292: 0x0e, 0x293: 0x0e, 0x294: 0x0e, 0x295: 0x0e, 0x296: 0x0e, 0x297: 0x0e, - 0x298: 0x0e, 0x299: 0x0e, 0x29a: 0x0e, 0x29b: 0x0e, 0x29c: 0x0e, 0x29d: 0x0e, 0x29e: 0x3e, - // Block 0xb, offset 0x2c0 - 0x2c0: 0x08, 0x2c1: 0x08, 0x2c2: 0x08, 0x2c3: 0x08, 0x2c4: 0x08, 0x2c5: 0x08, 0x2c6: 0x08, 0x2c7: 0x08, - 0x2c8: 0x08, 0x2c9: 0x08, 0x2ca: 0x08, 0x2cb: 0x08, 0x2cc: 0x08, 0x2cd: 0x08, 0x2ce: 0x08, 0x2cf: 0x08, - 0x2d0: 0x08, 0x2d1: 0x08, 0x2d2: 0x08, 0x2d3: 0x08, 0x2d4: 0x08, 0x2d5: 0x08, 0x2d6: 0x08, 0x2d7: 0x08, - 0x2d8: 0x08, 0x2d9: 0x08, 0x2da: 0x08, 0x2db: 0x08, 0x2dc: 0x08, 0x2dd: 0x08, 0x2de: 0x08, 0x2df: 0x08, - 0x2e0: 0x08, 0x2e1: 0x08, 0x2e2: 0x08, 0x2e3: 0x08, 0x2e4: 0x08, 0x2e5: 0x08, 0x2e6: 0x08, 0x2e7: 0x08, - 0x2e8: 0x08, 0x2e9: 0x08, 0x2ea: 0x08, 0x2eb: 0x08, 0x2ec: 0x08, 0x2ed: 0x08, 0x2ee: 0x08, 0x2ef: 0x08, - 0x2f0: 0x08, 0x2f1: 0x08, 0x2f2: 0x08, 0x2f3: 0x08, 0x2f4: 0x08, 0x2f5: 0x08, 0x2f6: 0x08, 0x2f7: 0x08, - 0x2f8: 0x08, 0x2f9: 0x08, 0x2fa: 0x08, 0x2fb: 0x08, 0x2fc: 0x08, 0x2fd: 0x08, 0x2fe: 0x08, 0x2ff: 0x08, - // Block 0xc, offset 0x300 - 0x300: 0x08, 0x301: 0x08, 0x302: 0x08, 0x303: 0x08, 0x304: 0x08, 0x305: 0x08, 0x306: 0x08, 0x307: 0x08, - 0x308: 0x08, 0x309: 0x08, 0x30a: 0x08, 0x30b: 0x08, 0x30c: 0x08, 0x30d: 0x08, 0x30e: 0x08, 0x30f: 0x08, - 0x310: 0x08, 0x311: 0x08, 0x312: 0x08, 0x313: 0x08, 0x314: 0x08, 0x315: 0x08, 0x316: 0x08, 0x317: 0x08, - 0x318: 0x08, 0x319: 0x08, 0x31a: 0x08, 0x31b: 0x08, 0x31c: 0x08, 0x31d: 0x08, 0x31e: 0x08, 0x31f: 0x08, - 0x320: 0x08, 0x321: 0x08, 0x322: 0x08, 0x323: 0x08, 0x324: 0x0e, 0x325: 0x0e, 0x326: 0x0e, 0x327: 0x0e, - 0x328: 0x0e, 0x329: 0x0e, 0x32a: 0x0e, 0x32b: 0x0e, - 0x338: 0x3f, 0x339: 0x40, 0x33c: 0x41, 0x33d: 0x42, 0x33e: 0x43, 0x33f: 0x44, - // Block 0xd, offset 0x340 - 0x37f: 0x45, - // Block 0xe, offset 0x380 - 0x380: 0x0e, 0x381: 0x0e, 0x382: 0x0e, 0x383: 0x0e, 0x384: 0x0e, 0x385: 0x0e, 0x386: 0x0e, 0x387: 0x0e, - 0x388: 0x0e, 0x389: 0x0e, 0x38a: 0x0e, 0x38b: 0x0e, 0x38c: 0x0e, 0x38d: 0x0e, 0x38e: 0x0e, 0x38f: 0x0e, - 0x390: 0x0e, 0x391: 0x0e, 0x392: 0x0e, 0x393: 0x0e, 0x394: 0x0e, 0x395: 0x0e, 0x396: 0x0e, 0x397: 0x0e, - 0x398: 0x0e, 0x399: 0x0e, 0x39a: 0x0e, 0x39b: 0x0e, 0x39c: 0x0e, 0x39d: 0x0e, 0x39e: 0x0e, 0x39f: 0x46, - 0x3a0: 0x0e, 0x3a1: 0x0e, 0x3a2: 0x0e, 0x3a3: 0x0e, 0x3a4: 0x0e, 0x3a5: 0x0e, 0x3a6: 0x0e, 0x3a7: 0x0e, - 0x3a8: 0x0e, 0x3a9: 0x0e, 0x3aa: 0x0e, 0x3ab: 0x47, - // Block 0xf, offset 0x3c0 - 0x3c0: 0x48, - // Block 0x10, offset 0x400 - 0x400: 0x49, 0x403: 0x4a, 0x404: 0x4b, 0x405: 0x4c, 0x406: 0x4d, - 0x408: 0x4e, 0x409: 0x4f, 0x40c: 0x50, 0x40d: 0x51, 0x40e: 0x52, 0x40f: 0x53, - 0x410: 0x3a, 0x411: 0x54, 0x412: 0x0e, 0x413: 0x55, 0x414: 0x56, 0x415: 0x57, 0x416: 0x58, 0x417: 0x59, - 0x418: 0x0e, 0x419: 0x5a, 0x41a: 0x0e, 0x41b: 0x5b, - 0x424: 0x5c, 0x425: 0x5d, 0x426: 0x5e, 0x427: 0x5f, - // Block 0x11, offset 0x440 - 0x456: 0x0b, 0x457: 0x06, - 0x458: 0x0c, 0x45b: 0x0d, 0x45f: 0x0e, - 0x460: 0x06, 0x461: 0x06, 0x462: 0x06, 0x463: 0x06, 0x464: 0x06, 0x465: 0x06, 0x466: 0x06, 0x467: 0x06, - 0x468: 0x06, 0x469: 0x06, 0x46a: 0x06, 0x46b: 0x06, 0x46c: 0x06, 0x46d: 0x06, 0x46e: 0x06, 0x46f: 0x06, - 0x470: 0x06, 0x471: 0x06, 0x472: 0x06, 0x473: 0x06, 0x474: 0x06, 0x475: 0x06, 0x476: 0x06, 0x477: 0x06, - 0x478: 0x06, 0x479: 0x06, 0x47a: 0x06, 0x47b: 0x06, 0x47c: 0x06, 0x47d: 0x06, 0x47e: 0x06, 0x47f: 0x06, - // Block 0x12, offset 0x480 - 0x484: 0x08, 0x485: 0x08, 0x486: 0x08, 0x487: 0x09, - // Block 0x13, offset 0x4c0 - 0x4c0: 0x08, 0x4c1: 0x08, 0x4c2: 0x08, 0x4c3: 0x08, 0x4c4: 0x08, 0x4c5: 0x08, 0x4c6: 0x08, 0x4c7: 0x08, - 0x4c8: 0x08, 0x4c9: 0x08, 0x4ca: 0x08, 0x4cb: 0x08, 0x4cc: 0x08, 0x4cd: 0x08, 0x4ce: 0x08, 0x4cf: 0x08, - 0x4d0: 0x08, 0x4d1: 0x08, 0x4d2: 0x08, 0x4d3: 0x08, 0x4d4: 0x08, 0x4d5: 0x08, 0x4d6: 0x08, 0x4d7: 0x08, - 0x4d8: 0x08, 0x4d9: 0x08, 0x4da: 0x08, 0x4db: 0x08, 0x4dc: 0x08, 0x4dd: 0x08, 0x4de: 0x08, 0x4df: 0x08, - 0x4e0: 0x08, 0x4e1: 0x08, 0x4e2: 0x08, 0x4e3: 0x08, 0x4e4: 0x08, 0x4e5: 0x08, 0x4e6: 0x08, 0x4e7: 0x08, - 0x4e8: 0x08, 0x4e9: 0x08, 0x4ea: 0x08, 0x4eb: 0x08, 0x4ec: 0x08, 0x4ed: 0x08, 0x4ee: 0x08, 0x4ef: 0x08, - 0x4f0: 0x08, 0x4f1: 0x08, 0x4f2: 0x08, 0x4f3: 0x08, 0x4f4: 0x08, 0x4f5: 0x08, 0x4f6: 0x08, 0x4f7: 0x08, - 0x4f8: 0x08, 0x4f9: 0x08, 0x4fa: 0x08, 0x4fb: 0x08, 0x4fc: 0x08, 0x4fd: 0x08, 0x4fe: 0x08, 0x4ff: 0x60, - // Block 0x14, offset 0x500 - 0x520: 0x10, - 0x530: 0x09, 0x531: 0x09, 0x532: 0x09, 0x533: 0x09, 0x534: 0x09, 0x535: 0x09, 0x536: 0x09, 0x537: 0x09, - 0x538: 0x09, 0x539: 0x09, 0x53a: 0x09, 0x53b: 0x09, 0x53c: 0x09, 0x53d: 0x09, 0x53e: 0x09, 0x53f: 0x11, - // Block 0x15, offset 0x540 - 0x540: 0x09, 0x541: 0x09, 0x542: 0x09, 0x543: 0x09, 0x544: 0x09, 0x545: 0x09, 0x546: 0x09, 0x547: 0x09, - 0x548: 0x09, 0x549: 0x09, 0x54a: 0x09, 0x54b: 0x09, 0x54c: 0x09, 0x54d: 0x09, 0x54e: 0x09, 0x54f: 0x11, -} - -// inverseData contains 4-byte entries of the following format: -// <0 padding> -// The last byte of the UTF-8-encoded rune is xor-ed with the last byte of the -// UTF-8 encoding of the original rune. Mappings often have the following -// pattern: -// A -> A (U+FF21 -> U+0041) -// B -> B (U+FF22 -> U+0042) -// ... -// By xor-ing the last byte the same entry can be shared by many mappings. This -// reduces the total number of distinct entries by about two thirds. -// The resulting entry for the aforementioned mappings is -// { 0x01, 0xE0, 0x00, 0x00 } -// Using this entry to map U+FF21 (UTF-8 [EF BC A1]), we get -// E0 ^ A1 = 41. -// Similarly, for U+FF22 (UTF-8 [EF BC A2]), we get -// E0 ^ A2 = 42. -// Note that because of the xor-ing, the byte sequence stored in the entry is -// not valid UTF-8. -var inverseData = [150][4]byte{ - {0x00, 0x00, 0x00, 0x00}, - {0x03, 0xe3, 0x80, 0xa0}, - {0x03, 0xef, 0xbc, 0xa0}, - {0x03, 0xef, 0xbc, 0xe0}, - {0x03, 0xef, 0xbd, 0xe0}, - {0x03, 0xef, 0xbf, 0x02}, - {0x03, 0xef, 0xbf, 0x00}, - {0x03, 0xef, 0xbf, 0x0e}, - {0x03, 0xef, 0xbf, 0x0c}, - {0x03, 0xef, 0xbf, 0x0f}, - {0x03, 0xef, 0xbf, 0x39}, - {0x03, 0xef, 0xbf, 0x3b}, - {0x03, 0xef, 0xbf, 0x3f}, - {0x03, 0xef, 0xbf, 0x2a}, - {0x03, 0xef, 0xbf, 0x0d}, - {0x03, 0xef, 0xbf, 0x25}, - {0x03, 0xef, 0xbd, 0x1a}, - {0x03, 0xef, 0xbd, 0x26}, - {0x01, 0xa0, 0x00, 0x00}, - {0x03, 0xef, 0xbd, 0x25}, - {0x03, 0xef, 0xbd, 0x23}, - {0x03, 0xef, 0xbd, 0x2e}, - {0x03, 0xef, 0xbe, 0x07}, - {0x03, 0xef, 0xbe, 0x05}, - {0x03, 0xef, 0xbd, 0x06}, - {0x03, 0xef, 0xbd, 0x13}, - {0x03, 0xef, 0xbd, 0x0b}, - {0x03, 0xef, 0xbd, 0x16}, - {0x03, 0xef, 0xbd, 0x0c}, - {0x03, 0xef, 0xbd, 0x15}, - {0x03, 0xef, 0xbd, 0x0d}, - {0x03, 0xef, 0xbd, 0x1c}, - {0x03, 0xef, 0xbd, 0x02}, - {0x03, 0xef, 0xbd, 0x1f}, - {0x03, 0xef, 0xbd, 0x1d}, - {0x03, 0xef, 0xbd, 0x17}, - {0x03, 0xef, 0xbd, 0x08}, - {0x03, 0xef, 0xbd, 0x09}, - {0x03, 0xef, 0xbd, 0x0e}, - {0x03, 0xef, 0xbd, 0x04}, - {0x03, 0xef, 0xbd, 0x05}, - {0x03, 0xef, 0xbe, 0x3f}, - {0x03, 0xef, 0xbe, 0x00}, - {0x03, 0xef, 0xbd, 0x2c}, - {0x03, 0xef, 0xbe, 0x06}, - {0x03, 0xef, 0xbe, 0x0c}, - {0x03, 0xef, 0xbe, 0x0f}, - {0x03, 0xef, 0xbe, 0x0d}, - {0x03, 0xef, 0xbe, 0x0b}, - {0x03, 0xef, 0xbe, 0x19}, - {0x03, 0xef, 0xbe, 0x15}, - {0x03, 0xef, 0xbe, 0x11}, - {0x03, 0xef, 0xbe, 0x31}, - {0x03, 0xef, 0xbe, 0x33}, - {0x03, 0xef, 0xbd, 0x0f}, - {0x03, 0xef, 0xbe, 0x30}, - {0x03, 0xef, 0xbe, 0x3e}, - {0x03, 0xef, 0xbe, 0x32}, - {0x03, 0xef, 0xbe, 0x36}, - {0x03, 0xef, 0xbd, 0x14}, - {0x03, 0xef, 0xbe, 0x2e}, - {0x03, 0xef, 0xbd, 0x1e}, - {0x03, 0xef, 0xbe, 0x10}, - {0x03, 0xef, 0xbf, 0x13}, - {0x03, 0xef, 0xbf, 0x15}, - {0x03, 0xef, 0xbf, 0x17}, - {0x03, 0xef, 0xbf, 0x1f}, - {0x03, 0xef, 0xbf, 0x1d}, - {0x03, 0xef, 0xbf, 0x1b}, - {0x03, 0xef, 0xbf, 0x09}, - {0x03, 0xef, 0xbf, 0x0b}, - {0x03, 0xef, 0xbf, 0x37}, - {0x03, 0xef, 0xbe, 0x04}, - {0x01, 0xe0, 0x00, 0x00}, - {0x03, 0xe2, 0xa6, 0x1a}, - {0x03, 0xe2, 0xa6, 0x26}, - {0x03, 0xe3, 0x80, 0x23}, - {0x03, 0xe3, 0x80, 0x2e}, - {0x03, 0xe3, 0x80, 0x25}, - {0x03, 0xe3, 0x83, 0x1e}, - {0x03, 0xe3, 0x83, 0x14}, - {0x03, 0xe3, 0x82, 0x06}, - {0x03, 0xe3, 0x82, 0x0b}, - {0x03, 0xe3, 0x82, 0x0c}, - {0x03, 0xe3, 0x82, 0x0d}, - {0x03, 0xe3, 0x82, 0x02}, - {0x03, 0xe3, 0x83, 0x0f}, - {0x03, 0xe3, 0x83, 0x08}, - {0x03, 0xe3, 0x83, 0x09}, - {0x03, 0xe3, 0x83, 0x2c}, - {0x03, 0xe3, 0x83, 0x0c}, - {0x03, 0xe3, 0x82, 0x13}, - {0x03, 0xe3, 0x82, 0x16}, - {0x03, 0xe3, 0x82, 0x15}, - {0x03, 0xe3, 0x82, 0x1c}, - {0x03, 0xe3, 0x82, 0x1f}, - {0x03, 0xe3, 0x82, 0x1d}, - {0x03, 0xe3, 0x82, 0x1a}, - {0x03, 0xe3, 0x82, 0x17}, - {0x03, 0xe3, 0x82, 0x08}, - {0x03, 0xe3, 0x82, 0x09}, - {0x03, 0xe3, 0x82, 0x0e}, - {0x03, 0xe3, 0x82, 0x04}, - {0x03, 0xe3, 0x82, 0x05}, - {0x03, 0xe3, 0x82, 0x3f}, - {0x03, 0xe3, 0x83, 0x00}, - {0x03, 0xe3, 0x83, 0x06}, - {0x03, 0xe3, 0x83, 0x05}, - {0x03, 0xe3, 0x83, 0x0d}, - {0x03, 0xe3, 0x83, 0x0b}, - {0x03, 0xe3, 0x83, 0x07}, - {0x03, 0xe3, 0x83, 0x19}, - {0x03, 0xe3, 0x83, 0x15}, - {0x03, 0xe3, 0x83, 0x11}, - {0x03, 0xe3, 0x83, 0x31}, - {0x03, 0xe3, 0x83, 0x33}, - {0x03, 0xe3, 0x83, 0x30}, - {0x03, 0xe3, 0x83, 0x3e}, - {0x03, 0xe3, 0x83, 0x32}, - {0x03, 0xe3, 0x83, 0x36}, - {0x03, 0xe3, 0x83, 0x2e}, - {0x03, 0xe3, 0x82, 0x07}, - {0x03, 0xe3, 0x85, 0x04}, - {0x03, 0xe3, 0x84, 0x10}, - {0x03, 0xe3, 0x85, 0x30}, - {0x03, 0xe3, 0x85, 0x0d}, - {0x03, 0xe3, 0x85, 0x13}, - {0x03, 0xe3, 0x85, 0x15}, - {0x03, 0xe3, 0x85, 0x17}, - {0x03, 0xe3, 0x85, 0x1f}, - {0x03, 0xe3, 0x85, 0x1d}, - {0x03, 0xe3, 0x85, 0x1b}, - {0x03, 0xe3, 0x85, 0x09}, - {0x03, 0xe3, 0x85, 0x0f}, - {0x03, 0xe3, 0x85, 0x0b}, - {0x03, 0xe3, 0x85, 0x37}, - {0x03, 0xe3, 0x85, 0x3b}, - {0x03, 0xe3, 0x85, 0x39}, - {0x03, 0xe3, 0x85, 0x3f}, - {0x02, 0xc2, 0x02, 0x00}, - {0x02, 0xc2, 0x0e, 0x00}, - {0x02, 0xc2, 0x0c, 0x00}, - {0x02, 0xc2, 0x00, 0x00}, - {0x03, 0xe2, 0x82, 0x0f}, - {0x03, 0xe2, 0x94, 0x2a}, - {0x03, 0xe2, 0x86, 0x39}, - {0x03, 0xe2, 0x86, 0x3b}, - {0x03, 0xe2, 0x86, 0x3f}, - {0x03, 0xe2, 0x96, 0x0d}, - {0x03, 0xe2, 0x97, 0x25}, -} - -// Total table size 14680 bytes (14KiB) diff --git a/vendor/golang.org/x/text/width/transform.go b/vendor/golang.org/x/text/width/transform.go deleted file mode 100644 index 0049f700a..000000000 --- a/vendor/golang.org/x/text/width/transform.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package width - -import ( - "unicode/utf8" - - "golang.org/x/text/transform" -) - -type foldTransform struct { - transform.NopResetter -} - -func (foldTransform) Span(src []byte, atEOF bool) (n int, err error) { - for n < len(src) { - if src[n] < utf8.RuneSelf { - // ASCII fast path. - for n++; n < len(src) && src[n] < utf8.RuneSelf; n++ { - } - continue - } - v, size := trie.lookup(src[n:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - err = transform.ErrShortSrc - } else { - n = len(src) - } - break - } - if elem(v)&tagNeedsFold != 0 { - err = transform.ErrEndOfSpan - break - } - n += size - } - return n, err -} - -func (foldTransform) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - for nSrc < len(src) { - if src[nSrc] < utf8.RuneSelf { - // ASCII fast path. - start, end := nSrc, len(src) - if d := len(dst) - nDst; d < end-start { - end = nSrc + d - } - for nSrc++; nSrc < end && src[nSrc] < utf8.RuneSelf; nSrc++ { - } - n := copy(dst[nDst:], src[start:nSrc]) - if nDst += n; nDst == len(dst) { - nSrc = start + n - if nSrc == len(src) { - return nDst, nSrc, nil - } - if src[nSrc] < utf8.RuneSelf { - return nDst, nSrc, transform.ErrShortDst - } - } - continue - } - v, size := trie.lookup(src[nSrc:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - return nDst, nSrc, transform.ErrShortSrc - } - size = 1 // gobble 1 byte - } - if elem(v)&tagNeedsFold == 0 { - if size != copy(dst[nDst:], src[nSrc:nSrc+size]) { - return nDst, nSrc, transform.ErrShortDst - } - nDst += size - } else { - data := inverseData[byte(v)] - if len(dst)-nDst < int(data[0]) { - return nDst, nSrc, transform.ErrShortDst - } - i := 1 - for end := int(data[0]); i < end; i++ { - dst[nDst] = data[i] - nDst++ - } - dst[nDst] = data[i] ^ src[nSrc+size-1] - nDst++ - } - nSrc += size - } - return nDst, nSrc, nil -} - -type narrowTransform struct { - transform.NopResetter -} - -func (narrowTransform) Span(src []byte, atEOF bool) (n int, err error) { - for n < len(src) { - if src[n] < utf8.RuneSelf { - // ASCII fast path. - for n++; n < len(src) && src[n] < utf8.RuneSelf; n++ { - } - continue - } - v, size := trie.lookup(src[n:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - err = transform.ErrShortSrc - } else { - n = len(src) - } - break - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianFullwidth && k != EastAsianWide && k != EastAsianAmbiguous { - } else { - err = transform.ErrEndOfSpan - break - } - n += size - } - return n, err -} - -func (narrowTransform) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - for nSrc < len(src) { - if src[nSrc] < utf8.RuneSelf { - // ASCII fast path. - start, end := nSrc, len(src) - if d := len(dst) - nDst; d < end-start { - end = nSrc + d - } - for nSrc++; nSrc < end && src[nSrc] < utf8.RuneSelf; nSrc++ { - } - n := copy(dst[nDst:], src[start:nSrc]) - if nDst += n; nDst == len(dst) { - nSrc = start + n - if nSrc == len(src) { - return nDst, nSrc, nil - } - if src[nSrc] < utf8.RuneSelf { - return nDst, nSrc, transform.ErrShortDst - } - } - continue - } - v, size := trie.lookup(src[nSrc:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - return nDst, nSrc, transform.ErrShortSrc - } - size = 1 // gobble 1 byte - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianFullwidth && k != EastAsianWide && k != EastAsianAmbiguous { - if size != copy(dst[nDst:], src[nSrc:nSrc+size]) { - return nDst, nSrc, transform.ErrShortDst - } - nDst += size - } else { - data := inverseData[byte(v)] - if len(dst)-nDst < int(data[0]) { - return nDst, nSrc, transform.ErrShortDst - } - i := 1 - for end := int(data[0]); i < end; i++ { - dst[nDst] = data[i] - nDst++ - } - dst[nDst] = data[i] ^ src[nSrc+size-1] - nDst++ - } - nSrc += size - } - return nDst, nSrc, nil -} - -type wideTransform struct { - transform.NopResetter -} - -func (wideTransform) Span(src []byte, atEOF bool) (n int, err error) { - for n < len(src) { - // TODO: Consider ASCII fast path. Special-casing ASCII handling can - // reduce the ns/op of BenchmarkWideASCII by about 30%. This is probably - // not enough to warrant the extra code and complexity. - v, size := trie.lookup(src[n:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - err = transform.ErrShortSrc - } else { - n = len(src) - } - break - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianHalfwidth && k != EastAsianNarrow { - } else { - err = transform.ErrEndOfSpan - break - } - n += size - } - return n, err -} - -func (wideTransform) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - for nSrc < len(src) { - // TODO: Consider ASCII fast path. Special-casing ASCII handling can - // reduce the ns/op of BenchmarkWideASCII by about 30%. This is probably - // not enough to warrant the extra code and complexity. - v, size := trie.lookup(src[nSrc:]) - if size == 0 { // incomplete UTF-8 encoding - if !atEOF { - return nDst, nSrc, transform.ErrShortSrc - } - size = 1 // gobble 1 byte - } - if k := elem(v).kind(); byte(v) == 0 || k != EastAsianHalfwidth && k != EastAsianNarrow { - if size != copy(dst[nDst:], src[nSrc:nSrc+size]) { - return nDst, nSrc, transform.ErrShortDst - } - nDst += size - } else { - data := inverseData[byte(v)] - if len(dst)-nDst < int(data[0]) { - return nDst, nSrc, transform.ErrShortDst - } - i := 1 - for end := int(data[0]); i < end; i++ { - dst[nDst] = data[i] - nDst++ - } - dst[nDst] = data[i] ^ src[nSrc+size-1] - nDst++ - } - nSrc += size - } - return nDst, nSrc, nil -} diff --git a/vendor/golang.org/x/text/width/trieval.go b/vendor/golang.org/x/text/width/trieval.go deleted file mode 100644 index ca8e45fd1..000000000 --- a/vendor/golang.org/x/text/width/trieval.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package width - -// elem is an entry of the width trie. The high byte is used to encode the type -// of the rune. The low byte is used to store the index to a mapping entry in -// the inverseData array. -type elem uint16 - -const ( - tagNeutral elem = iota << typeShift - tagAmbiguous - tagWide - tagNarrow - tagFullwidth - tagHalfwidth -) - -const ( - numTypeBits = 3 - typeShift = 16 - numTypeBits - - // tagNeedsFold is true for all fullwidth and halfwidth runes except for - // the Won sign U+20A9. - tagNeedsFold = 0x1000 - - // The Korean Won sign is halfwidth, but SHOULD NOT be mapped to a wide - // variant. - wonSign rune = 0x20A9 -) diff --git a/vendor/golang.org/x/text/width/width.go b/vendor/golang.org/x/text/width/width.go deleted file mode 100644 index 29c7509be..000000000 --- a/vendor/golang.org/x/text/width/width.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate stringer -type=Kind -//go:generate go run gen.go gen_common.go gen_trieval.go - -// Package width provides functionality for handling different widths in text. -// -// Wide characters behave like ideographs; they tend to allow line breaks after -// each character and remain upright in vertical text layout. Narrow characters -// are kept together in words or runs that are rotated sideways in vertical text -// layout. -// -// For more information, see https://unicode.org/reports/tr11/. -package width // import "golang.org/x/text/width" - -import ( - "unicode/utf8" - - "golang.org/x/text/transform" -) - -// TODO -// 1) Reduce table size by compressing blocks. -// 2) API proposition for computing display length -// (approximation, fixed pitch only). -// 3) Implement display length. - -// Kind indicates the type of width property as defined in https://unicode.org/reports/tr11/. -type Kind int - -const ( - // Neutral characters do not occur in legacy East Asian character sets. - Neutral Kind = iota - - // EastAsianAmbiguous characters that can be sometimes wide and sometimes - // narrow and require additional information not contained in the character - // code to further resolve their width. - EastAsianAmbiguous - - // EastAsianWide characters are wide in its usual form. They occur only in - // the context of East Asian typography. These runes may have explicit - // halfwidth counterparts. - EastAsianWide - - // EastAsianNarrow characters are narrow in its usual form. They often have - // fullwidth counterparts. - EastAsianNarrow - - // Note: there exist Narrow runes that do not have fullwidth or wide - // counterparts, despite what the definition says (e.g. U+27E6). - - // EastAsianFullwidth characters have a compatibility decompositions of type - // wide that map to a narrow counterpart. - EastAsianFullwidth - - // EastAsianHalfwidth characters have a compatibility decomposition of type - // narrow that map to a wide or ambiguous counterpart, plus U+20A9 ₩ WON - // SIGN. - EastAsianHalfwidth - - // Note: there exist runes that have a halfwidth counterparts but that are - // classified as Ambiguous, rather than wide (e.g. U+2190). -) - -// TODO: the generated tries need to return size 1 for invalid runes for the -// width to be computed correctly (each byte should render width 1) - -var trie = newWidthTrie(0) - -// Lookup reports the Properties of the first rune in b and the number of bytes -// of its UTF-8 encoding. -func Lookup(b []byte) (p Properties, size int) { - v, sz := trie.lookup(b) - return Properties{elem(v), b[sz-1]}, sz -} - -// LookupString reports the Properties of the first rune in s and the number of -// bytes of its UTF-8 encoding. -func LookupString(s string) (p Properties, size int) { - v, sz := trie.lookupString(s) - return Properties{elem(v), s[sz-1]}, sz -} - -// LookupRune reports the Properties of rune r. -func LookupRune(r rune) Properties { - var buf [4]byte - n := utf8.EncodeRune(buf[:], r) - v, _ := trie.lookup(buf[:n]) - last := byte(r) - if r >= utf8.RuneSelf { - last = 0x80 + byte(r&0x3f) - } - return Properties{elem(v), last} -} - -// Properties provides access to width properties of a rune. -type Properties struct { - elem elem - last byte -} - -func (e elem) kind() Kind { - return Kind(e >> typeShift) -} - -// Kind returns the Kind of a rune as defined in Unicode TR #11. -// See https://unicode.org/reports/tr11/ for more details. -func (p Properties) Kind() Kind { - return p.elem.kind() -} - -// Folded returns the folded variant of a rune or 0 if the rune is canonical. -func (p Properties) Folded() rune { - if p.elem&tagNeedsFold != 0 { - buf := inverseData[byte(p.elem)] - buf[buf[0]] ^= p.last - r, _ := utf8.DecodeRune(buf[1 : 1+buf[0]]) - return r - } - return 0 -} - -// Narrow returns the narrow variant of a rune or 0 if the rune is already -// narrow or doesn't have a narrow variant. -func (p Properties) Narrow() rune { - if k := p.elem.kind(); byte(p.elem) != 0 && (k == EastAsianFullwidth || k == EastAsianWide || k == EastAsianAmbiguous) { - buf := inverseData[byte(p.elem)] - buf[buf[0]] ^= p.last - r, _ := utf8.DecodeRune(buf[1 : 1+buf[0]]) - return r - } - return 0 -} - -// Wide returns the wide variant of a rune or 0 if the rune is already -// wide or doesn't have a wide variant. -func (p Properties) Wide() rune { - if k := p.elem.kind(); byte(p.elem) != 0 && (k == EastAsianHalfwidth || k == EastAsianNarrow) { - buf := inverseData[byte(p.elem)] - buf[buf[0]] ^= p.last - r, _ := utf8.DecodeRune(buf[1 : 1+buf[0]]) - return r - } - return 0 -} - -// TODO for Properties: -// - Add Fullwidth/Halfwidth or Inverted methods for computing variants -// mapping. -// - Add width information (including information on non-spacing runes). - -// Transformer implements the transform.Transformer interface. -type Transformer struct { - t transform.SpanningTransformer -} - -// Reset implements the transform.Transformer interface. -func (t Transformer) Reset() { t.t.Reset() } - -// Transform implements the transform.Transformer interface. -func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { - return t.t.Transform(dst, src, atEOF) -} - -// Span implements the transform.SpanningTransformer interface. -func (t Transformer) Span(src []byte, atEOF bool) (n int, err error) { - return t.t.Span(src, atEOF) -} - -// Bytes returns a new byte slice with the result of applying t to b. -func (t Transformer) Bytes(b []byte) []byte { - b, _, _ = transform.Bytes(t, b) - return b -} - -// String returns a string with the result of applying t to s. -func (t Transformer) String(s string) string { - s, _, _ = transform.String(t, s) - return s -} - -var ( - // Fold is a transform that maps all runes to their canonical width. - // - // Note that the NFKC and NFKD transforms in golang.org/x/text/unicode/norm - // provide a more generic folding mechanism. - Fold Transformer = Transformer{foldTransform{}} - - // Widen is a transform that maps runes to their wide variant, if - // available. - Widen Transformer = Transformer{wideTransform{}} - - // Narrow is a transform that maps runes to their narrow variant, if - // available. - Narrow Transformer = Transformer{narrowTransform{}} -) - -// TODO: Consider the following options: -// - Treat Ambiguous runes that have a halfwidth counterpart as wide, or some -// generalized variant of this. -// - Consider a wide Won character to be the default width (or some generalized -// variant of this). -// - Filter the set of characters that gets converted (the preferred approach is -// to allow applying filters to transforms). diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index bcc6f5451..f7a7697ca 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -27,6 +27,7 @@ import ( "net" "strings" + "google.golang.org/grpc/channelz" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal" @@ -192,7 +193,7 @@ type BuildOptions struct { // server can ignore this field. Authority string // ChannelzParentID is the parent ClientConn's channelz ID. - ChannelzParentID int64 + ChannelzParentID *channelz.Identifier // CustomUserAgent is the custom user agent set on the parent ClientConn. // The balancer should set the same custom user agent if it creates a // ClientConn. diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go index f4ea61746..b1c23eaae 100644 --- a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go +++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go @@ -20,130 +20,178 @@ package grpc import ( "fmt" + "strings" "sync" "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/balancer/gracefulswitch" "google.golang.org/grpc/internal/buffer" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" ) -// scStateUpdate contains the subConn and the new state it changed to. -type scStateUpdate struct { - sc balancer.SubConn - state connectivity.State - err error -} +// ccBalancerWrapper sits between the ClientConn and the Balancer. +// +// ccBalancerWrapper implements methods corresponding to the ones on the +// balancer.Balancer interface. The ClientConn is free to call these methods +// concurrently and the ccBalancerWrapper ensures that calls from the ClientConn +// to the Balancer happen synchronously and in order. +// +// ccBalancerWrapper also implements the balancer.ClientConn interface and is +// passed to the Balancer implementations. It invokes unexported methods on the +// ClientConn to handle these calls from the Balancer. +// +// It uses the gracefulswitch.Balancer internally to ensure that balancer +// switches happen in a graceful manner. +type ccBalancerWrapper struct { + cc *ClientConn -// exitIdle contains no data and is just a signal sent on the updateCh in -// ccBalancerWrapper to instruct the balancer to exit idle. -type exitIdle struct{} + // Since these fields are accessed only from handleXxx() methods which are + // synchronized by the watcher goroutine, we do not need a mutex to protect + // these fields. + balancer *gracefulswitch.Balancer + curBalancerName string -// ccBalancerWrapper is a wrapper on top of cc for balancers. -// It implements balancer.ClientConn interface. -type ccBalancerWrapper struct { - cc *ClientConn - balancerMu sync.Mutex // synchronizes calls to the balancer - balancer balancer.Balancer - hasExitIdle bool - updateCh *buffer.Unbounded - closed *grpcsync.Event - done *grpcsync.Event - - mu sync.Mutex - subConns map[*acBalancerWrapper]struct{} + updateCh *buffer.Unbounded // Updates written on this channel are processed by watcher(). + resultCh *buffer.Unbounded // Results of calls to UpdateClientConnState() are pushed here. + closed *grpcsync.Event // Indicates if close has been called. + done *grpcsync.Event // Indicates if close has completed its work. } -func newCCBalancerWrapper(cc *ClientConn, b balancer.Builder, bopts balancer.BuildOptions) *ccBalancerWrapper { +// newCCBalancerWrapper creates a new balancer wrapper. The underlying balancer +// is not created until the switchTo() method is invoked. +func newCCBalancerWrapper(cc *ClientConn, bopts balancer.BuildOptions) *ccBalancerWrapper { ccb := &ccBalancerWrapper{ cc: cc, updateCh: buffer.NewUnbounded(), + resultCh: buffer.NewUnbounded(), closed: grpcsync.NewEvent(), done: grpcsync.NewEvent(), - subConns: make(map[*acBalancerWrapper]struct{}), } go ccb.watcher() - ccb.balancer = b.Build(ccb, bopts) - _, ccb.hasExitIdle = ccb.balancer.(balancer.ExitIdler) + ccb.balancer = gracefulswitch.NewBalancer(ccb, bopts) return ccb } -// watcher balancer functions sequentially, so the balancer can be implemented -// lock-free. +// The following xxxUpdate structs wrap the arguments received as part of the +// corresponding update. The watcher goroutine uses the 'type' of the update to +// invoke the appropriate handler routine to handle the update. + +type ccStateUpdate struct { + ccs *balancer.ClientConnState +} + +type scStateUpdate struct { + sc balancer.SubConn + state connectivity.State + err error +} + +type exitIdleUpdate struct{} + +type resolverErrorUpdate struct { + err error +} + +type switchToUpdate struct { + name string +} + +type subConnUpdate struct { + acbw *acBalancerWrapper +} + +// watcher is a long-running goroutine which reads updates from a channel and +// invokes corresponding methods on the underlying balancer. It ensures that +// these methods are invoked in a synchronous fashion. It also ensures that +// these methods are invoked in the order in which the updates were received. func (ccb *ccBalancerWrapper) watcher() { for { select { - case t := <-ccb.updateCh.Get(): + case u := <-ccb.updateCh.Get(): ccb.updateCh.Load() if ccb.closed.HasFired() { break } - switch u := t.(type) { + switch update := u.(type) { + case *ccStateUpdate: + ccb.handleClientConnStateChange(update.ccs) case *scStateUpdate: - ccb.balancerMu.Lock() - ccb.balancer.UpdateSubConnState(u.sc, balancer.SubConnState{ConnectivityState: u.state, ConnectionError: u.err}) - ccb.balancerMu.Unlock() - case *acBalancerWrapper: - ccb.mu.Lock() - if ccb.subConns != nil { - delete(ccb.subConns, u) - ccb.cc.removeAddrConn(u.getAddrConn(), errConnDrain) - } - ccb.mu.Unlock() - case exitIdle: - if ccb.cc.GetState() == connectivity.Idle { - if ei, ok := ccb.balancer.(balancer.ExitIdler); ok { - // We already checked that the balancer implements - // ExitIdle before pushing the event to updateCh, but - // check conditionally again as defensive programming. - ccb.balancerMu.Lock() - ei.ExitIdle() - ccb.balancerMu.Unlock() - } - } + ccb.handleSubConnStateChange(update) + case *exitIdleUpdate: + ccb.handleExitIdle() + case *resolverErrorUpdate: + ccb.handleResolverError(update.err) + case *switchToUpdate: + ccb.handleSwitchTo(update.name) + case *subConnUpdate: + ccb.handleRemoveSubConn(update.acbw) default: - logger.Errorf("ccBalancerWrapper.watcher: unknown update %+v, type %T", t, t) + logger.Errorf("ccBalancerWrapper.watcher: unknown update %+v, type %T", update, update) } case <-ccb.closed.Done(): } if ccb.closed.HasFired() { - ccb.balancerMu.Lock() - ccb.balancer.Close() - ccb.balancerMu.Unlock() - ccb.mu.Lock() - scs := ccb.subConns - ccb.subConns = nil - ccb.mu.Unlock() - ccb.UpdateState(balancer.State{ConnectivityState: connectivity.Connecting, Picker: nil}) - ccb.done.Fire() - // Fire done before removing the addr conns. We can safely unblock - // ccb.close and allow the removeAddrConns to happen - // asynchronously. - for acbw := range scs { - ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) - } + ccb.handleClose() return } } } -func (ccb *ccBalancerWrapper) close() { - ccb.closed.Fire() - <-ccb.done.Done() +// updateClientConnState is invoked by grpc to push a ClientConnState update to +// the underlying balancer. +// +// Unlike other methods invoked by grpc to push updates to the underlying +// balancer, this method cannot simply push the update onto the update channel +// and return. It needs to return the error returned by the underlying balancer +// back to grpc which propagates that to the resolver. +func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { + ccb.updateCh.Put(&ccStateUpdate{ccs: ccs}) + + var res interface{} + select { + case res = <-ccb.resultCh.Get(): + ccb.resultCh.Load() + case <-ccb.closed.Done(): + // Return early if the balancer wrapper is closed while we are waiting for + // the underlying balancer to process a ClientConnState update. + return nil + } + // If the returned error is nil, attempting to type assert to error leads to + // panic. So, this needs to handled separately. + if res == nil { + return nil + } + return res.(error) } -func (ccb *ccBalancerWrapper) exitIdle() bool { - if !ccb.hasExitIdle { - return false +// handleClientConnStateChange handles a ClientConnState update from the update +// channel and invokes the appropriate method on the underlying balancer. +// +// If the addresses specified in the update contain addresses of type "grpclb" +// and the selected LB policy is not "grpclb", these addresses will be filtered +// out and ccs will be modified with the updated address list. +func (ccb *ccBalancerWrapper) handleClientConnStateChange(ccs *balancer.ClientConnState) { + if ccb.curBalancerName != grpclbName { + // Filter any grpclb addresses since we don't have the grpclb balancer. + var addrs []resolver.Address + for _, addr := range ccs.ResolverState.Addresses { + if addr.Type == resolver.GRPCLB { + continue + } + addrs = append(addrs, addr) + } + ccs.ResolverState.Addresses = addrs } - ccb.updateCh.Put(exitIdle{}) - return true + ccb.resultCh.Put(ccb.balancer.UpdateClientConnState(*ccs)) } -func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State, err error) { +// updateSubConnState is invoked by grpc to push a subConn state update to the +// underlying balancer. +func (ccb *ccBalancerWrapper) updateSubConnState(sc balancer.SubConn, s connectivity.State, err error) { // When updating addresses for a SubConn, if the address in use is not in // the new addresses, the old ac will be tearDown() and a new ac will be // created. tearDown() generates a state change with Shutdown state, we @@ -161,44 +209,125 @@ func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s co }) } -func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { - ccb.balancerMu.Lock() - defer ccb.balancerMu.Unlock() - return ccb.balancer.UpdateClientConnState(*ccs) +// handleSubConnStateChange handles a SubConnState update from the update +// channel and invokes the appropriate method on the underlying balancer. +func (ccb *ccBalancerWrapper) handleSubConnStateChange(update *scStateUpdate) { + ccb.balancer.UpdateSubConnState(update.sc, balancer.SubConnState{ConnectivityState: update.state, ConnectionError: update.err}) +} + +func (ccb *ccBalancerWrapper) exitIdle() { + ccb.updateCh.Put(&exitIdleUpdate{}) +} + +func (ccb *ccBalancerWrapper) handleExitIdle() { + if ccb.cc.GetState() != connectivity.Idle { + return + } + ccb.balancer.ExitIdle() } func (ccb *ccBalancerWrapper) resolverError(err error) { - ccb.balancerMu.Lock() - defer ccb.balancerMu.Unlock() + ccb.updateCh.Put(&resolverErrorUpdate{err: err}) +} + +func (ccb *ccBalancerWrapper) handleResolverError(err error) { ccb.balancer.ResolverError(err) } +// switchTo is invoked by grpc to instruct the balancer wrapper to switch to the +// LB policy identified by name. +// +// ClientConn calls newCCBalancerWrapper() at creation time. Upon receipt of the +// first good update from the name resolver, it determines the LB policy to use +// and invokes the switchTo() method. Upon receipt of every subsequent update +// from the name resolver, it invokes this method. +// +// the ccBalancerWrapper keeps track of the current LB policy name, and skips +// the graceful balancer switching process if the name does not change. +func (ccb *ccBalancerWrapper) switchTo(name string) { + ccb.updateCh.Put(&switchToUpdate{name: name}) +} + +// handleSwitchTo handles a balancer switch update from the update channel. It +// calls the SwitchTo() method on the gracefulswitch.Balancer with a +// balancer.Builder corresponding to name. If no balancer.Builder is registered +// for the given name, it uses the default LB policy which is "pick_first". +func (ccb *ccBalancerWrapper) handleSwitchTo(name string) { + // TODO: Other languages use case-insensitive balancer registries. We should + // switch as well. See: https://github.com/grpc/grpc-go/issues/5288. + if strings.EqualFold(ccb.curBalancerName, name) { + return + } + + // TODO: Ensure that name is a registered LB policy when we get here. + // We currently only validate the `loadBalancingConfig` field. We need to do + // the same for the `loadBalancingPolicy` field and reject the service config + // if the specified policy is not registered. + builder := balancer.Get(name) + if builder == nil { + channelz.Warningf(logger, ccb.cc.channelzID, "Channel switches to new LB policy %q, since the specified LB policy %q was not registered", PickFirstBalancerName, name) + builder = newPickfirstBuilder() + } else { + channelz.Infof(logger, ccb.cc.channelzID, "Channel switches to new LB policy %q", name) + } + + if err := ccb.balancer.SwitchTo(builder); err != nil { + channelz.Errorf(logger, ccb.cc.channelzID, "Channel failed to build new LB policy %q: %v", name, err) + return + } + ccb.curBalancerName = builder.Name() +} + +// handleRemoveSucConn handles a request from the underlying balancer to remove +// a subConn. +// +// See comments in RemoveSubConn() for more details. +func (ccb *ccBalancerWrapper) handleRemoveSubConn(acbw *acBalancerWrapper) { + ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) +} + +func (ccb *ccBalancerWrapper) close() { + ccb.closed.Fire() + <-ccb.done.Done() +} + +func (ccb *ccBalancerWrapper) handleClose() { + ccb.balancer.Close() + ccb.done.Fire() +} + func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { if len(addrs) <= 0 { return nil, fmt.Errorf("grpc: cannot create SubConn with empty address list") } - ccb.mu.Lock() - defer ccb.mu.Unlock() - if ccb.subConns == nil { - return nil, fmt.Errorf("grpc: ClientConn balancer wrapper was closed") - } ac, err := ccb.cc.newAddrConn(addrs, opts) if err != nil { + channelz.Warningf(logger, ccb.cc.channelzID, "acBalancerWrapper: NewSubConn: failed to newAddrConn: %v", err) return nil, err } acbw := &acBalancerWrapper{ac: ac} acbw.ac.mu.Lock() ac.acbw = acbw acbw.ac.mu.Unlock() - ccb.subConns[acbw] = struct{}{} return acbw, nil } func (ccb *ccBalancerWrapper) RemoveSubConn(sc balancer.SubConn) { - // The RemoveSubConn() is handled in the run() goroutine, to avoid deadlock - // during switchBalancer() if the old balancer calls RemoveSubConn() in its - // Close(). - ccb.updateCh.Put(sc) + // Before we switched the ccBalancerWrapper to use gracefulswitch.Balancer, it + // was required to handle the RemoveSubConn() method asynchronously by pushing + // the update onto the update channel. This was done to avoid a deadlock as + // switchBalancer() was holding cc.mu when calling Close() on the old + // balancer, which would in turn call RemoveSubConn(). + // + // With the use of gracefulswitch.Balancer in ccBalancerWrapper, handling this + // asynchronously is probably not required anymore since the switchTo() method + // handles the balancer switch by pushing the update onto the channel. + // TODO(easwars): Handle this inline. + acbw, ok := sc.(*acBalancerWrapper) + if !ok { + return + } + ccb.updateCh.Put(&subConnUpdate{acbw: acbw}) } func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resolver.Address) { @@ -210,11 +339,6 @@ func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resol } func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { - ccb.mu.Lock() - defer ccb.mu.Unlock() - if ccb.subConns == nil { - return - } // Update picker before updating state. Even though the ordering here does // not matter, it can lead to multiple calls of Pick in the common start-up // case where we wait for ready and then perform an RPC. If the picker is diff --git a/vendor/google.golang.org/grpc/channelz/channelz.go b/vendor/google.golang.org/grpc/channelz/channelz.go new file mode 100644 index 000000000..a220c47c5 --- /dev/null +++ b/vendor/google.golang.org/grpc/channelz/channelz.go @@ -0,0 +1,36 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package channelz exports internals of the channelz implementation as required +// by other gRPC packages. +// +// The implementation of the channelz spec as defined in +// https://github.com/grpc/proposal/blob/master/A14-channelz.md, is provided by +// the `internal/channelz` package. +// +// Experimental +// +// Notice: All APIs in this package are experimental and may be removed in a +// later release. +package channelz + +import "google.golang.org/grpc/internal/channelz" + +// Identifier is an opaque identifier which uniquely identifies an entity in the +// channelz database. +type Identifier = channelz.Identifier diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index f9af78913..ea9836d28 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -159,23 +159,20 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } }() - if channelz.IsOn() { - if cc.dopts.channelzParentID != 0 { - cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, cc.dopts.channelzParentID, target) - channelz.AddTraceEvent(logger, cc.channelzID, 0, &channelz.TraceEventDesc{ - Desc: "Channel Created", - Severity: channelz.CtInfo, - Parent: &channelz.TraceEventDesc{ - Desc: fmt.Sprintf("Nested Channel(id:%d) created", cc.channelzID), - Severity: channelz.CtInfo, - }, - }) - } else { - cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, 0, target) - channelz.Info(logger, cc.channelzID, "Channel Created") + pid := cc.dopts.channelzParentID + cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, pid, target) + ted := &channelz.TraceEventDesc{ + Desc: "Channel created", + Severity: channelz.CtInfo, + } + if cc.dopts.channelzParentID != nil { + ted.Parent = &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Nested Channel(id:%d) created", cc.channelzID.Int()), + Severity: channelz.CtInfo, } - cc.csMgr.channelzID = cc.channelzID } + channelz.AddTraceEvent(logger, cc.channelzID, 1, ted) + cc.csMgr.channelzID = cc.channelzID if cc.dopts.copts.TransportCredentials == nil && cc.dopts.copts.CredsBundle == nil { return nil, errNoTransportSecurity @@ -281,7 +278,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * if creds := cc.dopts.copts.TransportCredentials; creds != nil { credsClone = creds.Clone() } - cc.balancerBuildOpts = balancer.BuildOptions{ + cc.balancerWrapper = newCCBalancerWrapper(cc, balancer.BuildOptions{ DialCreds: credsClone, CredsBundle: cc.dopts.copts.CredsBundle, Dialer: cc.dopts.copts.Dialer, @@ -289,7 +286,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * CustomUserAgent: cc.dopts.copts.UserAgent, ChannelzParentID: cc.channelzID, Target: cc.parsedTarget, - } + }) // Build the resolver. rWrapper, err := newCCResolverWrapper(cc, resolverBuilder) @@ -398,7 +395,7 @@ type connectivityStateManager struct { mu sync.Mutex state connectivity.State notifyChan chan struct{} - channelzID int64 + channelzID *channelz.Identifier } // updateState updates the connectivity.State of ClientConn. @@ -464,34 +461,36 @@ var _ ClientConnInterface = (*ClientConn)(nil) // handshakes. It also handles errors on established connections by // re-resolving the name and reconnecting. type ClientConn struct { - ctx context.Context - cancel context.CancelFunc - - target string - parsedTarget resolver.Target - authority string - dopts dialOptions - csMgr *connectivityStateManager - - balancerBuildOpts balancer.BuildOptions - blockingpicker *pickerWrapper - + ctx context.Context // Initialized using the background context at dial time. + cancel context.CancelFunc // Cancelled on close. + + // The following are initialized at dial time, and are read-only after that. + target string // User's dial target. + parsedTarget resolver.Target // See parseTargetAndFindResolver(). + authority string // See determineAuthority(). + dopts dialOptions // Default and user specified dial options. + channelzID *channelz.Identifier // Channelz identifier for the channel. + balancerWrapper *ccBalancerWrapper // Uses gracefulswitch.balancer underneath. + + // The following provide their own synchronization, and therefore don't + // require cc.mu to be held to access them. + csMgr *connectivityStateManager + blockingpicker *pickerWrapper safeConfigSelector iresolver.SafeConfigSelector + czData *channelzData + retryThrottler atomic.Value // Updated from service config. - mu sync.RWMutex - resolverWrapper *ccResolverWrapper - sc *ServiceConfig - conns map[*addrConn]struct{} - // Keepalive parameter can be updated if a GoAway is received. - mkp keepalive.ClientParameters - curBalancerName string - balancerWrapper *ccBalancerWrapper - retryThrottler atomic.Value - + // firstResolveEvent is used to track whether the name resolver sent us at + // least one update. RPCs block on this event. firstResolveEvent *grpcsync.Event - channelzID int64 // channelz unique identification number - czData *channelzData + // mu protects the following fields. + // TODO: split mu so the same mutex isn't used for everything. + mu sync.RWMutex + resolverWrapper *ccResolverWrapper // Initialized in Dial; cleared in Close. + sc *ServiceConfig // Latest service config received from the resolver. + conns map[*addrConn]struct{} // Set to nil on close. + mkp keepalive.ClientParameters // May be updated upon receipt of a GoAway. lceMu sync.Mutex // protects lastConnectionError lastConnectionError error @@ -536,14 +535,7 @@ func (cc *ClientConn) GetState() connectivity.State { // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. func (cc *ClientConn) Connect() { - cc.mu.Lock() - defer cc.mu.Unlock() - if cc.balancerWrapper != nil && cc.balancerWrapper.exitIdle() { - return - } - for ac := range cc.conns { - go ac.connect() - } + cc.balancerWrapper.exitIdle() } func (cc *ClientConn) scWatcher() { @@ -623,9 +615,7 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { // with the new addresses. cc.maybeApplyDefaultServiceConfig(nil) - if cc.balancerWrapper != nil { - cc.balancerWrapper.resolverError(err) - } + cc.balancerWrapper.resolverError(err) // No addresses are valid with err set; return early. cc.mu.Unlock() @@ -653,16 +643,10 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { cc.applyServiceConfigAndBalancer(sc, configSelector, s.Addresses) } else { ret = balancer.ErrBadResolverState - if cc.balancerWrapper == nil { - var err error - if s.ServiceConfig.Err != nil { - err = status.Errorf(codes.Unavailable, "error parsing service config: %v", s.ServiceConfig.Err) - } else { - err = status.Errorf(codes.Unavailable, "illegal service config type: %T", s.ServiceConfig.Config) - } - cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{cc.sc}) - cc.blockingpicker.updatePicker(base.NewErrPicker(err)) - cc.csMgr.updateState(connectivity.TransientFailure) + if cc.sc == nil { + // Apply the failing LB only if we haven't received valid service config + // from the name resolver in the past. + cc.applyFailingLB(s.ServiceConfig) cc.mu.Unlock() return ret } @@ -670,24 +654,12 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { } var balCfg serviceconfig.LoadBalancingConfig - if cc.dopts.balancerBuilder == nil && cc.sc != nil && cc.sc.lbConfig != nil { + if cc.sc != nil && cc.sc.lbConfig != nil { balCfg = cc.sc.lbConfig.cfg } - - cbn := cc.curBalancerName bw := cc.balancerWrapper cc.mu.Unlock() - if cbn != grpclbName { - // Filter any grpclb addresses since we don't have the grpclb balancer. - for i := 0; i < len(s.Addresses); { - if s.Addresses[i].Type == resolver.GRPCLB { - copy(s.Addresses[i:], s.Addresses[i+1:]) - s.Addresses = s.Addresses[:len(s.Addresses)-1] - continue - } - i++ - } - } + uccsErr := bw.updateClientConnState(&balancer.ClientConnState{ResolverState: s, BalancerConfig: balCfg}) if ret == nil { ret = uccsErr // prefer ErrBadResolver state since any other error is @@ -696,56 +668,28 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { return ret } -// switchBalancer starts the switching from current balancer to the balancer -// with the given name. -// -// It will NOT send the current address list to the new balancer. If needed, -// caller of this function should send address list to the new balancer after -// this function returns. +// applyFailingLB is akin to configuring an LB policy on the channel which +// always fails RPCs. Here, an actual LB policy is not configured, but an always +// erroring picker is configured, which returns errors with information about +// what was invalid in the received service config. A config selector with no +// service config is configured, and the connectivity state of the channel is +// set to TransientFailure. // // Caller must hold cc.mu. -func (cc *ClientConn) switchBalancer(name string) { - if strings.EqualFold(cc.curBalancerName, name) { - return - } - - channelz.Infof(logger, cc.channelzID, "ClientConn switching balancer to %q", name) - if cc.dopts.balancerBuilder != nil { - channelz.Info(logger, cc.channelzID, "ignoring balancer switching: Balancer DialOption used instead") - return - } - if cc.balancerWrapper != nil { - // Don't hold cc.mu while closing the balancers. The balancers may call - // methods that require cc.mu (e.g. cc.NewSubConn()). Holding the mutex - // would cause a deadlock in that case. - cc.mu.Unlock() - cc.balancerWrapper.close() - cc.mu.Lock() - } - - builder := balancer.Get(name) - if builder == nil { - channelz.Warningf(logger, cc.channelzID, "Channel switches to new LB policy %q due to fallback from invalid balancer name", PickFirstBalancerName) - channelz.Infof(logger, cc.channelzID, "failed to get balancer builder for: %v, using pick_first instead", name) - builder = newPickfirstBuilder() +func (cc *ClientConn) applyFailingLB(sc *serviceconfig.ParseResult) { + var err error + if sc.Err != nil { + err = status.Errorf(codes.Unavailable, "error parsing service config: %v", sc.Err) } else { - channelz.Infof(logger, cc.channelzID, "Channel switches to new LB policy %q", name) + err = status.Errorf(codes.Unavailable, "illegal service config type: %T", sc.Config) } - - cc.curBalancerName = builder.Name() - cc.balancerWrapper = newCCBalancerWrapper(cc, builder, cc.balancerBuildOpts) + cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil}) + cc.blockingpicker.updatePicker(base.NewErrPicker(err)) + cc.csMgr.updateState(connectivity.TransientFailure) } func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State, err error) { - cc.mu.Lock() - if cc.conns == nil { - cc.mu.Unlock() - return - } - // TODO(bar switching) send updates to all balancer wrappers when balancer - // gracefully switching is supported. - cc.balancerWrapper.handleSubConnStateChange(sc, s, err) - cc.mu.Unlock() + cc.balancerWrapper.updateSubConnState(sc, s, err) } // newAddrConn creates an addrConn for addrs and adds it to cc.conns. @@ -768,17 +712,21 @@ func (cc *ClientConn) newAddrConn(addrs []resolver.Address, opts balancer.NewSub cc.mu.Unlock() return nil, ErrClientConnClosing } - if channelz.IsOn() { - ac.channelzID = channelz.RegisterSubChannel(ac, cc.channelzID, "") - channelz.AddTraceEvent(logger, ac.channelzID, 0, &channelz.TraceEventDesc{ - Desc: "Subchannel Created", - Severity: channelz.CtInfo, - Parent: &channelz.TraceEventDesc{ - Desc: fmt.Sprintf("Subchannel(id:%d) created", ac.channelzID), - Severity: channelz.CtInfo, - }, - }) + + var err error + ac.channelzID, err = channelz.RegisterSubChannel(ac, cc.channelzID, "") + if err != nil { + return nil, err } + channelz.AddTraceEvent(logger, ac.channelzID, 0, &channelz.TraceEventDesc{ + Desc: "Subchannel created", + Severity: channelz.CtInfo, + Parent: &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Subchannel(id:%d) created", ac.channelzID.Int()), + Severity: channelz.CtInfo, + }, + }) + cc.conns[ac] = struct{}{} cc.mu.Unlock() return ac, nil @@ -959,14 +907,10 @@ func (cc *ClientConn) healthCheckConfig() *healthCheckConfig { } func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method string) (transport.ClientTransport, func(balancer.DoneInfo), error) { - t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickInfo{ + return cc.blockingpicker.pick(ctx, failfast, balancer.PickInfo{ Ctx: ctx, FullMethodName: method, }) - if err != nil { - return nil, nil, toRPCErr(err) - } - return t, done, nil } func (cc *ClientConn) applyServiceConfigAndBalancer(sc *ServiceConfig, configSelector iresolver.ConfigSelector, addrs []resolver.Address) { @@ -991,35 +935,26 @@ func (cc *ClientConn) applyServiceConfigAndBalancer(sc *ServiceConfig, configSel cc.retryThrottler.Store((*retryThrottler)(nil)) } - if cc.dopts.balancerBuilder == nil { - // Only look at balancer types and switch balancer if balancer dial - // option is not set. - var newBalancerName string - if cc.sc != nil && cc.sc.lbConfig != nil { - newBalancerName = cc.sc.lbConfig.name - } else { - var isGRPCLB bool - for _, a := range addrs { - if a.Type == resolver.GRPCLB { - isGRPCLB = true - break - } - } - if isGRPCLB { - newBalancerName = grpclbName - } else if cc.sc != nil && cc.sc.LB != nil { - newBalancerName = *cc.sc.LB - } else { - newBalancerName = PickFirstBalancerName + var newBalancerName string + if cc.sc != nil && cc.sc.lbConfig != nil { + newBalancerName = cc.sc.lbConfig.name + } else { + var isGRPCLB bool + for _, a := range addrs { + if a.Type == resolver.GRPCLB { + isGRPCLB = true + break } } - cc.switchBalancer(newBalancerName) - } else if cc.balancerWrapper == nil { - // Balancer dial option was set, and this is the first time handling - // resolved addresses. Build a balancer with dopts.balancerBuilder. - cc.curBalancerName = cc.dopts.balancerBuilder.Name() - cc.balancerWrapper = newCCBalancerWrapper(cc, cc.dopts.balancerBuilder, cc.balancerBuildOpts) + if isGRPCLB { + newBalancerName = grpclbName + } else if cc.sc != nil && cc.sc.LB != nil { + newBalancerName = *cc.sc.LB + } else { + newBalancerName = PickFirstBalancerName + } } + cc.balancerWrapper.switchTo(newBalancerName) } func (cc *ClientConn) resolveNow(o resolver.ResolveNowOptions) { @@ -1070,11 +1005,11 @@ func (cc *ClientConn) Close() error { rWrapper := cc.resolverWrapper cc.resolverWrapper = nil bWrapper := cc.balancerWrapper - cc.balancerWrapper = nil cc.mu.Unlock() + // The order of closing matters here since the balancer wrapper assumes the + // picker is closed before it is closed. cc.blockingpicker.close() - if bWrapper != nil { bWrapper.close() } @@ -1085,22 +1020,22 @@ func (cc *ClientConn) Close() error { for ac := range conns { ac.tearDown(ErrClientConnClosing) } - if channelz.IsOn() { - ted := &channelz.TraceEventDesc{ - Desc: "Channel Deleted", + ted := &channelz.TraceEventDesc{ + Desc: "Channel deleted", + Severity: channelz.CtInfo, + } + if cc.dopts.channelzParentID != nil { + ted.Parent = &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Nested channel(id:%d) deleted", cc.channelzID.Int()), Severity: channelz.CtInfo, } - if cc.dopts.channelzParentID != 0 { - ted.Parent = &channelz.TraceEventDesc{ - Desc: fmt.Sprintf("Nested channel(id:%d) deleted", cc.channelzID), - Severity: channelz.CtInfo, - } - } - channelz.AddTraceEvent(logger, cc.channelzID, 0, ted) - // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add trace reference to - // the entity being deleted, and thus prevent it from being deleted right away. - channelz.RemoveEntry(cc.channelzID) } + channelz.AddTraceEvent(logger, cc.channelzID, 0, ted) + // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add + // trace reference to the entity being deleted, and thus prevent it from being + // deleted right away. + channelz.RemoveEntry(cc.channelzID) + return nil } @@ -1130,7 +1065,7 @@ type addrConn struct { backoffIdx int // Needs to be stateful for resetConnectBackoff. resetBackoff chan struct{} - channelzID int64 // channelz unique identification number. + channelzID *channelz.Identifier czData *channelzData } @@ -1312,14 +1247,12 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne connectCtx, cancel := context.WithDeadline(ac.ctx, connectDeadline) defer cancel() - if channelz.IsOn() { - copts.ChannelzParentID = ac.channelzID - } + copts.ChannelzParentID = ac.channelzID newTr, err := transport.NewClientTransport(connectCtx, ac.cc.ctx, addr, copts, func() { prefaceReceived.Fire() }, onGoAway, onClose) if err != nil { // newTr is either nil, or closed. - channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %v. Err: %v", addr, err) + channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %s. Err: %v", addr, err) return err } @@ -1332,7 +1265,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne newTr.Close(transport.ErrConnClosing) if connectCtx.Err() == context.DeadlineExceeded { err := errors.New("failed to receive server preface within timeout") - channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %v: %v", addr, err) + channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %s: %v", addr, err) return err } return nil @@ -1497,19 +1430,18 @@ func (ac *addrConn) tearDown(err error) { curTr.GracefulClose() ac.mu.Lock() } - if channelz.IsOn() { - channelz.AddTraceEvent(logger, ac.channelzID, 0, &channelz.TraceEventDesc{ - Desc: "Subchannel Deleted", + channelz.AddTraceEvent(logger, ac.channelzID, 0, &channelz.TraceEventDesc{ + Desc: "Subchannel deleted", + Severity: channelz.CtInfo, + Parent: &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Subchannel(id:%d) deleted", ac.channelzID.Int()), Severity: channelz.CtInfo, - Parent: &channelz.TraceEventDesc{ - Desc: fmt.Sprintf("Subchanel(id:%d) deleted", ac.channelzID), - Severity: channelz.CtInfo, - }, - }) - // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add trace reference to - // the entity being deleted, and thus prevent it from being deleted right away. - channelz.RemoveEntry(ac.channelzID) - } + }, + }) + // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add + // trace reference to the entity being deleted, and thus prevent it from + // being deleted right away. + channelz.RemoveEntry(ac.channelzID) ac.mu.Unlock() } diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index c4bf09f9e..f2f605a17 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -20,12 +20,11 @@ package grpc import ( "context" - "fmt" "net" "time" "google.golang.org/grpc/backoff" - "google.golang.org/grpc/balancer" + "google.golang.org/grpc/channelz" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/internal" @@ -45,19 +44,17 @@ type dialOptions struct { chainUnaryInts []UnaryClientInterceptor chainStreamInts []StreamClientInterceptor - cp Compressor - dc Decompressor - bs internalbackoff.Strategy - block bool - returnLastError bool - timeout time.Duration - scChan <-chan ServiceConfig - authority string - copts transport.ConnectOptions - callOptions []CallOption - // This is used by WithBalancerName dial option. - balancerBuilder balancer.Builder - channelzParentID int64 + cp Compressor + dc Decompressor + bs internalbackoff.Strategy + block bool + returnLastError bool + timeout time.Duration + scChan <-chan ServiceConfig + authority string + copts transport.ConnectOptions + callOptions []CallOption + channelzParentID *channelz.Identifier disableServiceConfig bool disableRetry bool disableHealthCheck bool @@ -195,25 +192,6 @@ func WithDecompressor(dc Decompressor) DialOption { }) } -// WithBalancerName sets the balancer that the ClientConn will be initialized -// with. Balancer registered with balancerName will be used. This function -// panics if no balancer was registered by balancerName. -// -// The balancer cannot be overridden by balancer option specified by service -// config. -// -// Deprecated: use WithDefaultServiceConfig and WithDisableServiceConfig -// instead. Will be removed in a future 1.x release. -func WithBalancerName(balancerName string) DialOption { - builder := balancer.Get(balancerName) - if builder == nil { - panic(fmt.Sprintf("grpc.WithBalancerName: no balancer is registered for name %v", balancerName)) - } - return newFuncDialOption(func(o *dialOptions) { - o.balancerBuilder = builder - }) -} - // WithServiceConfig returns a DialOption which has a channel to read the // service configuration. // @@ -304,8 +282,8 @@ func WithReturnConnectionError() DialOption { // WithCredentialsBundle or WithPerRPCCredentials) which require transport // security is incompatible and will cause grpc.Dial() to fail. // -// Deprecated: use WithTransportCredentials and insecure.NewCredentials() instead. -// Will be supported throughout 1.x. +// Deprecated: use WithTransportCredentials and insecure.NewCredentials() +// instead. Will be supported throughout 1.x. func WithInsecure() DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.TransportCredentials = insecure.NewCredentials() @@ -498,7 +476,7 @@ func WithAuthority(a string) DialOption { // // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. -func WithChannelzParentID(id int64) DialOption { +func WithChannelzParentID(id *channelz.Identifier) DialOption { return newFuncDialOption(func(o *dialOptions) { o.channelzParentID = id }) diff --git a/vendor/google.golang.org/grpc/go.mod b/vendor/google.golang.org/grpc/go.mod index 0e7dc351a..6a760ed74 100644 --- a/vendor/google.golang.org/grpc/go.mod +++ b/vendor/google.golang.org/grpc/go.mod @@ -6,14 +6,14 @@ require ( github.com/cespare/xxhash/v2 v2.1.1 github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 - github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021 + github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/protobuf v1.5.2 - github.com/google/go-cmp v0.5.5 + github.com/google/go-cmp v0.5.6 github.com/google/uuid v1.1.2 - golang.org/x/net v0.0.0-20200822124328-c89045814202 + golang.org/x/net v0.0.0-20201021035429-f5854403a974 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd + golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 ) diff --git a/vendor/google.golang.org/grpc/go.sum b/vendor/google.golang.org/grpc/go.sum index 03be9ef71..5f418dba1 100644 --- a/vendor/google.golang.org/grpc/go.sum +++ b/vendor/google.golang.org/grpc/go.sum @@ -12,8 +12,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 h1:hzAQntlaYRkVSFEfj9OTWlVV1H155FMD8BTKktLv0QI= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 h1:zH8ljVhhq7yC0MIeUL/IviMtY8hx2mK8cN9wEYb8ggw= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= @@ -22,8 +22,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021 h1:fP+fF0up6oPY49OrjPrhIJ8yQfdIM85NXMLkMg1EXVs= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 h1:xvqufLtNVwAhN8NMyWklVgxnWohi+wtMGQMhtxexlm0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -49,8 +49,9 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -75,8 +76,9 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -87,10 +89,14 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -122,8 +128,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go b/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go new file mode 100644 index 000000000..7ba8f4d18 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/balancer/gracefulswitch/gracefulswitch.go @@ -0,0 +1,382 @@ +/* + * + * Copyright 2022 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package gracefulswitch implements a graceful switch load balancer. +package gracefulswitch + +import ( + "errors" + "fmt" + "sync" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/base" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/resolver" +) + +var errBalancerClosed = errors.New("gracefulSwitchBalancer is closed") +var _ balancer.Balancer = (*Balancer)(nil) + +// NewBalancer returns a graceful switch Balancer. +func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions) *Balancer { + return &Balancer{ + cc: cc, + bOpts: opts, + } +} + +// Balancer is a utility to gracefully switch from one balancer to +// a new balancer. It implements the balancer.Balancer interface. +type Balancer struct { + bOpts balancer.BuildOptions + cc balancer.ClientConn + + // mu protects the following fields and all fields within balancerCurrent + // and balancerPending. mu does not need to be held when calling into the + // child balancers, as all calls into these children happen only as a direct + // result of a call into the gracefulSwitchBalancer, which are also + // guaranteed to be synchronous. There is one exception: an UpdateState call + // from a child balancer when current and pending are populated can lead to + // calling Close() on the current. To prevent that racing with an + // UpdateSubConnState from the channel, we hold currentMu during Close and + // UpdateSubConnState calls. + mu sync.Mutex + balancerCurrent *balancerWrapper + balancerPending *balancerWrapper + closed bool // set to true when this balancer is closed + + // currentMu must be locked before mu. This mutex guards against this + // sequence of events: UpdateSubConnState() called, finds the + // balancerCurrent, gives up lock, updateState comes in, causes Close() on + // balancerCurrent before the UpdateSubConnState is called on the + // balancerCurrent. + currentMu sync.Mutex +} + +// swap swaps out the current lb with the pending lb and updates the ClientConn. +// The caller must hold gsb.mu. +func (gsb *Balancer) swap() { + gsb.cc.UpdateState(gsb.balancerPending.lastState) + cur := gsb.balancerCurrent + gsb.balancerCurrent = gsb.balancerPending + gsb.balancerPending = nil + go func() { + gsb.currentMu.Lock() + defer gsb.currentMu.Unlock() + cur.Close() + }() +} + +// Helper function that checks if the balancer passed in is current or pending. +// The caller must hold gsb.mu. +func (gsb *Balancer) balancerCurrentOrPending(bw *balancerWrapper) bool { + return bw == gsb.balancerCurrent || bw == gsb.balancerPending +} + +// SwitchTo initializes the graceful switch process, which completes based on +// connectivity state changes on the current/pending balancer. Thus, the switch +// process is not complete when this method returns. This method must be called +// synchronously alongside the rest of the balancer.Balancer methods this +// Graceful Switch Balancer implements. +func (gsb *Balancer) SwitchTo(builder balancer.Builder) error { + gsb.mu.Lock() + if gsb.closed { + gsb.mu.Unlock() + return errBalancerClosed + } + bw := &balancerWrapper{ + gsb: gsb, + lastState: balancer.State{ + ConnectivityState: connectivity.Connecting, + Picker: base.NewErrPicker(balancer.ErrNoSubConnAvailable), + }, + subconns: make(map[balancer.SubConn]bool), + } + balToClose := gsb.balancerPending // nil if there is no pending balancer + if gsb.balancerCurrent == nil { + gsb.balancerCurrent = bw + } else { + gsb.balancerPending = bw + } + gsb.mu.Unlock() + balToClose.Close() + // This function takes a builder instead of a balancer because builder.Build + // can call back inline, and this utility needs to handle the callbacks. + newBalancer := builder.Build(bw, gsb.bOpts) + if newBalancer == nil { + // This is illegal and should never happen; we clear the balancerWrapper + // we were constructing if it happens to avoid a potential panic. + gsb.mu.Lock() + if gsb.balancerPending != nil { + gsb.balancerPending = nil + } else { + gsb.balancerCurrent = nil + } + gsb.mu.Unlock() + return balancer.ErrBadResolverState + } + + // This write doesn't need to take gsb.mu because this field never gets read + // or written to on any calls from the current or pending. Calls from grpc + // to this balancer are guaranteed to be called synchronously, so this + // bw.Balancer field will never be forwarded to until this SwitchTo() + // function returns. + bw.Balancer = newBalancer + return nil +} + +// Returns nil if the graceful switch balancer is closed. +func (gsb *Balancer) latestBalancer() *balancerWrapper { + gsb.mu.Lock() + defer gsb.mu.Unlock() + if gsb.balancerPending != nil { + return gsb.balancerPending + } + return gsb.balancerCurrent +} + +// UpdateClientConnState forwards the update to the latest balancer created. +func (gsb *Balancer) UpdateClientConnState(state balancer.ClientConnState) error { + // The resolver data is only relevant to the most recent LB Policy. + balToUpdate := gsb.latestBalancer() + if balToUpdate == nil { + return errBalancerClosed + } + // Perform this call without gsb.mu to prevent deadlocks if the child calls + // back into the channel. The latest balancer can never be closed during a + // call from the channel, even without gsb.mu held. + return balToUpdate.UpdateClientConnState(state) +} + +// ResolverError forwards the error to the latest balancer created. +func (gsb *Balancer) ResolverError(err error) { + // The resolver data is only relevant to the most recent LB Policy. + balToUpdate := gsb.latestBalancer() + if balToUpdate == nil { + return + } + // Perform this call without gsb.mu to prevent deadlocks if the child calls + // back into the channel. The latest balancer can never be closed during a + // call from the channel, even without gsb.mu held. + balToUpdate.ResolverError(err) +} + +// ExitIdle forwards the call to the latest balancer created. +// +// If the latest balancer does not support ExitIdle, the subConns are +// re-connected to manually. +func (gsb *Balancer) ExitIdle() { + balToUpdate := gsb.latestBalancer() + if balToUpdate == nil { + return + } + // There is no need to protect this read with a mutex, as the write to the + // Balancer field happens in SwitchTo, which completes before this can be + // called. + if ei, ok := balToUpdate.Balancer.(balancer.ExitIdler); ok { + ei.ExitIdle() + return + } + for sc := range balToUpdate.subconns { + sc.Connect() + } +} + +// UpdateSubConnState forwards the update to the appropriate child. +func (gsb *Balancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { + gsb.currentMu.Lock() + defer gsb.currentMu.Unlock() + gsb.mu.Lock() + // Forward update to the appropriate child. Even if there is a pending + // balancer, the current balancer should continue to get SubConn updates to + // maintain the proper state while the pending is still connecting. + var balToUpdate *balancerWrapper + if gsb.balancerCurrent != nil && gsb.balancerCurrent.subconns[sc] { + balToUpdate = gsb.balancerCurrent + } else if gsb.balancerPending != nil && gsb.balancerPending.subconns[sc] { + balToUpdate = gsb.balancerPending + } + gsb.mu.Unlock() + if balToUpdate == nil { + // SubConn belonged to a stale lb policy that has not yet fully closed, + // or the balancer was already closed. + return + } + balToUpdate.UpdateSubConnState(sc, state) +} + +// Close closes any active child balancers. +func (gsb *Balancer) Close() { + gsb.mu.Lock() + gsb.closed = true + currentBalancerToClose := gsb.balancerCurrent + gsb.balancerCurrent = nil + pendingBalancerToClose := gsb.balancerPending + gsb.balancerPending = nil + gsb.mu.Unlock() + + currentBalancerToClose.Close() + pendingBalancerToClose.Close() +} + +// balancerWrapper wraps a balancer.Balancer, and overrides some Balancer +// methods to help cleanup SubConns created by the wrapped balancer. +// +// It implements the balancer.ClientConn interface and is passed down in that +// capacity to the wrapped balancer. It maintains a set of subConns created by +// the wrapped balancer and calls from the latter to create/update/remove +// SubConns update this set before being forwarded to the parent ClientConn. +// State updates from the wrapped balancer can result in invocation of the +// graceful switch logic. +type balancerWrapper struct { + balancer.Balancer + gsb *Balancer + + lastState balancer.State + subconns map[balancer.SubConn]bool // subconns created by this balancer +} + +func (bw *balancerWrapper) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { + if state.ConnectivityState == connectivity.Shutdown { + bw.gsb.mu.Lock() + delete(bw.subconns, sc) + bw.gsb.mu.Unlock() + } + // There is no need to protect this read with a mutex, as the write to the + // Balancer field happens in SwitchTo, which completes before this can be + // called. + bw.Balancer.UpdateSubConnState(sc, state) +} + +// Close closes the underlying LB policy and removes the subconns it created. bw +// must not be referenced via balancerCurrent or balancerPending in gsb when +// called. gsb.mu must not be held. Does not panic with a nil receiver. +func (bw *balancerWrapper) Close() { + // before Close is called. + if bw == nil { + return + } + // There is no need to protect this read with a mutex, as Close() is + // impossible to be called concurrently with the write in SwitchTo(). The + // callsites of Close() for this balancer in Graceful Switch Balancer will + // never be called until SwitchTo() returns. + bw.Balancer.Close() + bw.gsb.mu.Lock() + for sc := range bw.subconns { + bw.gsb.cc.RemoveSubConn(sc) + } + bw.gsb.mu.Unlock() +} + +func (bw *balancerWrapper) UpdateState(state balancer.State) { + // Hold the mutex for this entire call to ensure it cannot occur + // concurrently with other updateState() calls. This causes updates to + // lastState and calls to cc.UpdateState to happen atomically. + bw.gsb.mu.Lock() + defer bw.gsb.mu.Unlock() + bw.lastState = state + + if !bw.gsb.balancerCurrentOrPending(bw) { + return + } + + if bw == bw.gsb.balancerCurrent { + // In the case that the current balancer exits READY, and there is a pending + // balancer, you can forward the pending balancer's cached State up to + // ClientConn and swap the pending into the current. This is because there + // is no reason to gracefully switch from and keep using the old policy as + // the ClientConn is not connected to any backends. + if state.ConnectivityState != connectivity.Ready && bw.gsb.balancerPending != nil { + bw.gsb.swap() + return + } + // Even if there is a pending balancer waiting to be gracefully switched to, + // continue to forward current balancer updates to the Client Conn. Ignoring + // state + picker from the current would cause undefined behavior/cause the + // system to behave incorrectly from the current LB policies perspective. + // Also, the current LB is still being used by grpc to choose SubConns per + // RPC, and thus should use the most updated form of the current balancer. + bw.gsb.cc.UpdateState(state) + return + } + // This method is now dealing with a state update from the pending balancer. + // If the current balancer is currently in a state other than READY, the new + // policy can be swapped into place immediately. This is because there is no + // reason to gracefully switch from and keep using the old policy as the + // ClientConn is not connected to any backends. + if state.ConnectivityState != connectivity.Connecting || bw.gsb.balancerCurrent.lastState.ConnectivityState != connectivity.Ready { + bw.gsb.swap() + } +} + +func (bw *balancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { + bw.gsb.mu.Lock() + if !bw.gsb.balancerCurrentOrPending(bw) { + bw.gsb.mu.Unlock() + return nil, fmt.Errorf("%T at address %p that called NewSubConn is deleted", bw, bw) + } + bw.gsb.mu.Unlock() + + sc, err := bw.gsb.cc.NewSubConn(addrs, opts) + if err != nil { + return nil, err + } + bw.gsb.mu.Lock() + if !bw.gsb.balancerCurrentOrPending(bw) { // balancer was closed during this call + bw.gsb.cc.RemoveSubConn(sc) + bw.gsb.mu.Unlock() + return nil, fmt.Errorf("%T at address %p that called NewSubConn is deleted", bw, bw) + } + bw.subconns[sc] = true + bw.gsb.mu.Unlock() + return sc, nil +} + +func (bw *balancerWrapper) ResolveNow(opts resolver.ResolveNowOptions) { + // Ignore ResolveNow requests from anything other than the most recent + // balancer, because older balancers were already removed from the config. + if bw != bw.gsb.latestBalancer() { + return + } + bw.gsb.cc.ResolveNow(opts) +} + +func (bw *balancerWrapper) RemoveSubConn(sc balancer.SubConn) { + bw.gsb.mu.Lock() + if !bw.gsb.balancerCurrentOrPending(bw) { + bw.gsb.mu.Unlock() + return + } + bw.gsb.mu.Unlock() + bw.gsb.cc.RemoveSubConn(sc) +} + +func (bw *balancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resolver.Address) { + bw.gsb.mu.Lock() + if !bw.gsb.balancerCurrentOrPending(bw) { + bw.gsb.mu.Unlock() + return + } + bw.gsb.mu.Unlock() + bw.gsb.cc.UpdateAddresses(sc, addrs) +} + +func (bw *balancerWrapper) Target() string { + return bw.gsb.cc.Target() +} diff --git a/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go index 5cc3aeddb..0a25ce43f 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go @@ -31,7 +31,7 @@ import ( // Logger is the global binary logger. It can be used to get binary logger for // each method. type Logger interface { - getMethodLogger(methodName string) *MethodLogger + GetMethodLogger(methodName string) MethodLogger } // binLogger is the global binary logger for the binary. One of this should be @@ -49,17 +49,24 @@ func SetLogger(l Logger) { binLogger = l } +// GetLogger gets the binarg logger. +// +// Only call this at init time. +func GetLogger() Logger { + return binLogger +} + // GetMethodLogger returns the methodLogger for the given methodName. // // methodName should be in the format of "/service/method". // // Each methodLogger returned by this method is a new instance. This is to // generate sequence id within the call. -func GetMethodLogger(methodName string) *MethodLogger { +func GetMethodLogger(methodName string) MethodLogger { if binLogger == nil { return nil } - return binLogger.getMethodLogger(methodName) + return binLogger.GetMethodLogger(methodName) } func init() { @@ -68,17 +75,29 @@ func init() { binLogger = NewLoggerFromConfigString(configStr) } -type methodLoggerConfig struct { +// MethodLoggerConfig contains the setting for logging behavior of a method +// logger. Currently, it contains the max length of header and message. +type MethodLoggerConfig struct { // Max length of header and message. - hdr, msg uint64 + Header, Message uint64 +} + +// LoggerConfig contains the config for loggers to create method loggers. +type LoggerConfig struct { + All *MethodLoggerConfig + Services map[string]*MethodLoggerConfig + Methods map[string]*MethodLoggerConfig + + Blacklist map[string]struct{} } type logger struct { - all *methodLoggerConfig - services map[string]*methodLoggerConfig - methods map[string]*methodLoggerConfig + config LoggerConfig +} - blacklist map[string]struct{} +// NewLoggerFromConfig builds a logger with the given LoggerConfig. +func NewLoggerFromConfig(config LoggerConfig) Logger { + return &logger{config: config} } // newEmptyLogger creates an empty logger. The map fields need to be filled in @@ -88,57 +107,57 @@ func newEmptyLogger() *logger { } // Set method logger for "*". -func (l *logger) setDefaultMethodLogger(ml *methodLoggerConfig) error { - if l.all != nil { +func (l *logger) setDefaultMethodLogger(ml *MethodLoggerConfig) error { + if l.config.All != nil { return fmt.Errorf("conflicting global rules found") } - l.all = ml + l.config.All = ml return nil } // Set method logger for "service/*". // // New methodLogger with same service overrides the old one. -func (l *logger) setServiceMethodLogger(service string, ml *methodLoggerConfig) error { - if _, ok := l.services[service]; ok { +func (l *logger) setServiceMethodLogger(service string, ml *MethodLoggerConfig) error { + if _, ok := l.config.Services[service]; ok { return fmt.Errorf("conflicting service rules for service %v found", service) } - if l.services == nil { - l.services = make(map[string]*methodLoggerConfig) + if l.config.Services == nil { + l.config.Services = make(map[string]*MethodLoggerConfig) } - l.services[service] = ml + l.config.Services[service] = ml return nil } // Set method logger for "service/method". // // New methodLogger with same method overrides the old one. -func (l *logger) setMethodMethodLogger(method string, ml *methodLoggerConfig) error { - if _, ok := l.blacklist[method]; ok { +func (l *logger) setMethodMethodLogger(method string, ml *MethodLoggerConfig) error { + if _, ok := l.config.Blacklist[method]; ok { return fmt.Errorf("conflicting blacklist rules for method %v found", method) } - if _, ok := l.methods[method]; ok { + if _, ok := l.config.Methods[method]; ok { return fmt.Errorf("conflicting method rules for method %v found", method) } - if l.methods == nil { - l.methods = make(map[string]*methodLoggerConfig) + if l.config.Methods == nil { + l.config.Methods = make(map[string]*MethodLoggerConfig) } - l.methods[method] = ml + l.config.Methods[method] = ml return nil } // Set blacklist method for "-service/method". func (l *logger) setBlacklist(method string) error { - if _, ok := l.blacklist[method]; ok { + if _, ok := l.config.Blacklist[method]; ok { return fmt.Errorf("conflicting blacklist rules for method %v found", method) } - if _, ok := l.methods[method]; ok { + if _, ok := l.config.Methods[method]; ok { return fmt.Errorf("conflicting method rules for method %v found", method) } - if l.blacklist == nil { - l.blacklist = make(map[string]struct{}) + if l.config.Blacklist == nil { + l.config.Blacklist = make(map[string]struct{}) } - l.blacklist[method] = struct{}{} + l.config.Blacklist[method] = struct{}{} return nil } @@ -148,23 +167,23 @@ func (l *logger) setBlacklist(method string) error { // // Each methodLogger returned by this method is a new instance. This is to // generate sequence id within the call. -func (l *logger) getMethodLogger(methodName string) *MethodLogger { +func (l *logger) GetMethodLogger(methodName string) MethodLogger { s, m, err := grpcutil.ParseMethod(methodName) if err != nil { grpclogLogger.Infof("binarylogging: failed to parse %q: %v", methodName, err) return nil } - if ml, ok := l.methods[s+"/"+m]; ok { - return newMethodLogger(ml.hdr, ml.msg) + if ml, ok := l.config.Methods[s+"/"+m]; ok { + return newMethodLogger(ml.Header, ml.Message) } - if _, ok := l.blacklist[s+"/"+m]; ok { + if _, ok := l.config.Blacklist[s+"/"+m]; ok { return nil } - if ml, ok := l.services[s]; ok { - return newMethodLogger(ml.hdr, ml.msg) + if ml, ok := l.config.Services[s]; ok { + return newMethodLogger(ml.Header, ml.Message) } - if l.all == nil { + if l.config.All == nil { return nil } - return newMethodLogger(l.all.hdr, l.all.msg) + return newMethodLogger(l.config.All.Header, l.config.All.Message) } diff --git a/vendor/google.golang.org/grpc/internal/binarylog/env_config.go b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go index d8f4e7602..ab589a76b 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/env_config.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go @@ -89,7 +89,7 @@ func (l *logger) fillMethodLoggerWithConfigString(config string) error { if err != nil { return fmt.Errorf("invalid config: %q, %v", config, err) } - if err := l.setDefaultMethodLogger(&methodLoggerConfig{hdr: hdr, msg: msg}); err != nil { + if err := l.setDefaultMethodLogger(&MethodLoggerConfig{Header: hdr, Message: msg}); err != nil { return fmt.Errorf("invalid config: %v", err) } return nil @@ -104,11 +104,11 @@ func (l *logger) fillMethodLoggerWithConfigString(config string) error { return fmt.Errorf("invalid header/message length config: %q, %v", suffix, err) } if m == "*" { - if err := l.setServiceMethodLogger(s, &methodLoggerConfig{hdr: hdr, msg: msg}); err != nil { + if err := l.setServiceMethodLogger(s, &MethodLoggerConfig{Header: hdr, Message: msg}); err != nil { return fmt.Errorf("invalid config: %v", err) } } else { - if err := l.setMethodMethodLogger(s+"/"+m, &methodLoggerConfig{hdr: hdr, msg: msg}); err != nil { + if err := l.setMethodMethodLogger(s+"/"+m, &MethodLoggerConfig{Header: hdr, Message: msg}); err != nil { return fmt.Errorf("invalid config: %v", err) } } diff --git a/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go index 0cdb41831..24df0a1a0 100644 --- a/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go +++ b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go @@ -48,7 +48,11 @@ func (g *callIDGenerator) reset() { var idGen callIDGenerator // MethodLogger is the sub-logger for each method. -type MethodLogger struct { +type MethodLogger interface { + Log(LogEntryConfig) +} + +type methodLogger struct { headerMaxLen, messageMaxLen uint64 callID uint64 @@ -57,8 +61,8 @@ type MethodLogger struct { sink Sink // TODO(blog): make this plugable. } -func newMethodLogger(h, m uint64) *MethodLogger { - return &MethodLogger{ +func newMethodLogger(h, m uint64) *methodLogger { + return &methodLogger{ headerMaxLen: h, messageMaxLen: m, @@ -69,8 +73,10 @@ func newMethodLogger(h, m uint64) *MethodLogger { } } -// Log creates a proto binary log entry, and logs it to the sink. -func (ml *MethodLogger) Log(c LogEntryConfig) { +// Build is an internal only method for building the proto message out of the +// input event. It's made public to enable other library to reuse as much logic +// in methodLogger as possible. +func (ml *methodLogger) Build(c LogEntryConfig) *pb.GrpcLogEntry { m := c.toProto() timestamp, _ := ptypes.TimestampProto(time.Now()) m.Timestamp = timestamp @@ -85,11 +91,15 @@ func (ml *MethodLogger) Log(c LogEntryConfig) { case *pb.GrpcLogEntry_Message: m.PayloadTruncated = ml.truncateMessage(pay.Message) } + return m +} - ml.sink.Write(m) +// Log creates a proto binary log entry, and logs it to the sink. +func (ml *methodLogger) Log(c LogEntryConfig) { + ml.sink.Write(ml.Build(c)) } -func (ml *MethodLogger) truncateMetadata(mdPb *pb.Metadata) (truncated bool) { +func (ml *methodLogger) truncateMetadata(mdPb *pb.Metadata) (truncated bool) { if ml.headerMaxLen == maxUInt { return false } @@ -119,7 +129,7 @@ func (ml *MethodLogger) truncateMetadata(mdPb *pb.Metadata) (truncated bool) { return truncated } -func (ml *MethodLogger) truncateMessage(msgPb *pb.Message) (truncated bool) { +func (ml *methodLogger) truncateMessage(msgPb *pb.Message) (truncated bool) { if ml.messageMaxLen == maxUInt { return false } diff --git a/vendor/google.golang.org/grpc/internal/channelz/funcs.go b/vendor/google.golang.org/grpc/internal/channelz/funcs.go index ea660a147..777cbcd79 100644 --- a/vendor/google.golang.org/grpc/internal/channelz/funcs.go +++ b/vendor/google.golang.org/grpc/internal/channelz/funcs.go @@ -25,6 +25,7 @@ package channelz import ( "context" + "errors" "fmt" "sort" "sync" @@ -184,54 +185,77 @@ func GetServer(id int64) *ServerMetric { return db.get().GetServer(id) } -// RegisterChannel registers the given channel c in channelz database with ref -// as its reference name, and add it to the child list of its parent (identified -// by pid). pid = 0 means no parent. It returns the unique channelz tracking id -// assigned to this channel. -func RegisterChannel(c Channel, pid int64, ref string) int64 { +// RegisterChannel registers the given channel c in the channelz database with +// ref as its reference name, and adds it to the child list of its parent +// (identified by pid). pid == nil means no parent. +// +// Returns a unique channelz identifier assigned to this channel. +// +// If channelz is not turned ON, the channelz database is not mutated. +func RegisterChannel(c Channel, pid *Identifier, ref string) *Identifier { id := idGen.genID() + var parent int64 + isTopChannel := true + if pid != nil { + isTopChannel = false + parent = pid.Int() + } + + if !IsOn() { + return newIdentifer(RefChannel, id, pid) + } + cn := &channel{ refName: ref, c: c, subChans: make(map[int64]string), nestedChans: make(map[int64]string), id: id, - pid: pid, + pid: parent, trace: &channelTrace{createdTime: time.Now(), events: make([]*TraceEvent, 0, getMaxTraceEntry())}, } - if pid == 0 { - db.get().addChannel(id, cn, true, pid) - } else { - db.get().addChannel(id, cn, false, pid) - } - return id + db.get().addChannel(id, cn, isTopChannel, parent) + return newIdentifer(RefChannel, id, pid) } -// RegisterSubChannel registers the given channel c in channelz database with ref -// as its reference name, and add it to the child list of its parent (identified -// by pid). It returns the unique channelz tracking id assigned to this subchannel. -func RegisterSubChannel(c Channel, pid int64, ref string) int64 { - if pid == 0 { - logger.Error("a SubChannel's parent id cannot be 0") - return 0 +// RegisterSubChannel registers the given subChannel c in the channelz database +// with ref as its reference name, and adds it to the child list of its parent +// (identified by pid). +// +// Returns a unique channelz identifier assigned to this subChannel. +// +// If channelz is not turned ON, the channelz database is not mutated. +func RegisterSubChannel(c Channel, pid *Identifier, ref string) (*Identifier, error) { + if pid == nil { + return nil, errors.New("a SubChannel's parent id cannot be nil") } id := idGen.genID() + if !IsOn() { + return newIdentifer(RefSubChannel, id, pid), nil + } + sc := &subChannel{ refName: ref, c: c, sockets: make(map[int64]string), id: id, - pid: pid, + pid: pid.Int(), trace: &channelTrace{createdTime: time.Now(), events: make([]*TraceEvent, 0, getMaxTraceEntry())}, } - db.get().addSubChannel(id, sc, pid) - return id + db.get().addSubChannel(id, sc, pid.Int()) + return newIdentifer(RefSubChannel, id, pid), nil } // RegisterServer registers the given server s in channelz database. It returns // the unique channelz tracking id assigned to this server. -func RegisterServer(s Server, ref string) int64 { +// +// If channelz is not turned ON, the channelz database is not mutated. +func RegisterServer(s Server, ref string) *Identifier { id := idGen.genID() + if !IsOn() { + return newIdentifer(RefServer, id, nil) + } + svr := &server{ refName: ref, s: s, @@ -240,71 +264,92 @@ func RegisterServer(s Server, ref string) int64 { id: id, } db.get().addServer(id, svr) - return id + return newIdentifer(RefServer, id, nil) } // RegisterListenSocket registers the given listen socket s in channelz database // with ref as its reference name, and add it to the child list of its parent // (identified by pid). It returns the unique channelz tracking id assigned to // this listen socket. -func RegisterListenSocket(s Socket, pid int64, ref string) int64 { - if pid == 0 { - logger.Error("a ListenSocket's parent id cannot be 0") - return 0 +// +// If channelz is not turned ON, the channelz database is not mutated. +func RegisterListenSocket(s Socket, pid *Identifier, ref string) (*Identifier, error) { + if pid == nil { + return nil, errors.New("a ListenSocket's parent id cannot be 0") } id := idGen.genID() - ls := &listenSocket{refName: ref, s: s, id: id, pid: pid} - db.get().addListenSocket(id, ls, pid) - return id + if !IsOn() { + return newIdentifer(RefListenSocket, id, pid), nil + } + + ls := &listenSocket{refName: ref, s: s, id: id, pid: pid.Int()} + db.get().addListenSocket(id, ls, pid.Int()) + return newIdentifer(RefListenSocket, id, pid), nil } // RegisterNormalSocket registers the given normal socket s in channelz database -// with ref as its reference name, and add it to the child list of its parent +// with ref as its reference name, and adds it to the child list of its parent // (identified by pid). It returns the unique channelz tracking id assigned to // this normal socket. -func RegisterNormalSocket(s Socket, pid int64, ref string) int64 { - if pid == 0 { - logger.Error("a NormalSocket's parent id cannot be 0") - return 0 +// +// If channelz is not turned ON, the channelz database is not mutated. +func RegisterNormalSocket(s Socket, pid *Identifier, ref string) (*Identifier, error) { + if pid == nil { + return nil, errors.New("a NormalSocket's parent id cannot be 0") } id := idGen.genID() - ns := &normalSocket{refName: ref, s: s, id: id, pid: pid} - db.get().addNormalSocket(id, ns, pid) - return id + if !IsOn() { + return newIdentifer(RefNormalSocket, id, pid), nil + } + + ns := &normalSocket{refName: ref, s: s, id: id, pid: pid.Int()} + db.get().addNormalSocket(id, ns, pid.Int()) + return newIdentifer(RefNormalSocket, id, pid), nil } // RemoveEntry removes an entry with unique channelz tracking id to be id from // channelz database. -func RemoveEntry(id int64) { - db.get().removeEntry(id) +// +// If channelz is not turned ON, this function is a no-op. +func RemoveEntry(id *Identifier) { + if !IsOn() { + return + } + db.get().removeEntry(id.Int()) } -// TraceEventDesc is what the caller of AddTraceEvent should provide to describe the event to be added -// to the channel trace. -// The Parent field is optional. It is used for event that will be recorded in the entity's parent -// trace also. +// TraceEventDesc is what the caller of AddTraceEvent should provide to describe +// the event to be added to the channel trace. +// +// The Parent field is optional. It is used for an event that will be recorded +// in the entity's parent trace. type TraceEventDesc struct { Desc string Severity Severity Parent *TraceEventDesc } -// AddTraceEvent adds trace related to the entity with specified id, using the provided TraceEventDesc. -func AddTraceEvent(l grpclog.DepthLoggerV2, id int64, depth int, desc *TraceEventDesc) { - for d := desc; d != nil; d = d.Parent { - switch d.Severity { - case CtUnknown, CtInfo: - l.InfoDepth(depth+1, d.Desc) - case CtWarning: - l.WarningDepth(depth+1, d.Desc) - case CtError: - l.ErrorDepth(depth+1, d.Desc) - } +// AddTraceEvent adds trace related to the entity with specified id, using the +// provided TraceEventDesc. +// +// If channelz is not turned ON, this will simply log the event descriptions. +func AddTraceEvent(l grpclog.DepthLoggerV2, id *Identifier, depth int, desc *TraceEventDesc) { + // Log only the trace description associated with the bottom most entity. + switch desc.Severity { + case CtUnknown, CtInfo: + l.InfoDepth(depth+1, withParens(id)+desc.Desc) + case CtWarning: + l.WarningDepth(depth+1, withParens(id)+desc.Desc) + case CtError: + l.ErrorDepth(depth+1, withParens(id)+desc.Desc) } + if getMaxTraceEntry() == 0 { return } - db.get().traceEvent(id, desc) + if IsOn() { + db.get().traceEvent(id.Int(), desc) + } } // channelMap is the storage data structure for channelz. diff --git a/vendor/google.golang.org/grpc/internal/channelz/id.go b/vendor/google.golang.org/grpc/internal/channelz/id.go new file mode 100644 index 000000000..c9a27acd3 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/id.go @@ -0,0 +1,75 @@ +/* + * + * Copyright 2022 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package channelz + +import "fmt" + +// Identifier is an opaque identifier which uniquely identifies an entity in the +// channelz database. +type Identifier struct { + typ RefChannelType + id int64 + str string + pid *Identifier +} + +// Type returns the entity type corresponding to id. +func (id *Identifier) Type() RefChannelType { + return id.typ +} + +// Int returns the integer identifier corresponding to id. +func (id *Identifier) Int() int64 { + return id.id +} + +// String returns a string representation of the entity corresponding to id. +// +// This includes some information about the parent as well. Examples: +// Top-level channel: [Channel #channel-number] +// Nested channel: [Channel #parent-channel-number Channel #channel-number] +// Sub channel: [Channel #parent-channel SubChannel #subchannel-number] +func (id *Identifier) String() string { + return id.str +} + +// Equal returns true if other is the same as id. +func (id *Identifier) Equal(other *Identifier) bool { + if (id != nil) != (other != nil) { + return false + } + if id == nil && other == nil { + return true + } + return id.typ == other.typ && id.id == other.id && id.pid == other.pid +} + +// NewIdentifierForTesting returns a new opaque identifier to be used only for +// testing purposes. +func NewIdentifierForTesting(typ RefChannelType, id int64, pid *Identifier) *Identifier { + return newIdentifer(typ, id, pid) +} + +func newIdentifer(typ RefChannelType, id int64, pid *Identifier) *Identifier { + str := fmt.Sprintf("%s #%d", typ, id) + if pid != nil { + str = fmt.Sprintf("%s %s", pid, str) + } + return &Identifier{typ: typ, id: id, str: str, pid: pid} +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/logging.go b/vendor/google.golang.org/grpc/internal/channelz/logging.go index b0013f9c8..8e13a3d2c 100644 --- a/vendor/google.golang.org/grpc/internal/channelz/logging.go +++ b/vendor/google.golang.org/grpc/internal/channelz/logging.go @@ -26,77 +26,54 @@ import ( var logger = grpclog.Component("channelz") +func withParens(id *Identifier) string { + return "[" + id.String() + "] " +} + // Info logs and adds a trace event if channelz is on. -func Info(l grpclog.DepthLoggerV2, id int64, args ...interface{}) { - if IsOn() { - AddTraceEvent(l, id, 1, &TraceEventDesc{ - Desc: fmt.Sprint(args...), - Severity: CtInfo, - }) - } else { - l.InfoDepth(1, args...) - } +func Info(l grpclog.DepthLoggerV2, id *Identifier, args ...interface{}) { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprint(args...), + Severity: CtInfo, + }) } // Infof logs and adds a trace event if channelz is on. -func Infof(l grpclog.DepthLoggerV2, id int64, format string, args ...interface{}) { - msg := fmt.Sprintf(format, args...) - if IsOn() { - AddTraceEvent(l, id, 1, &TraceEventDesc{ - Desc: msg, - Severity: CtInfo, - }) - } else { - l.InfoDepth(1, msg) - } +func Infof(l grpclog.DepthLoggerV2, id *Identifier, format string, args ...interface{}) { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprintf(format, args...), + Severity: CtInfo, + }) } // Warning logs and adds a trace event if channelz is on. -func Warning(l grpclog.DepthLoggerV2, id int64, args ...interface{}) { - if IsOn() { - AddTraceEvent(l, id, 1, &TraceEventDesc{ - Desc: fmt.Sprint(args...), - Severity: CtWarning, - }) - } else { - l.WarningDepth(1, args...) - } +func Warning(l grpclog.DepthLoggerV2, id *Identifier, args ...interface{}) { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprint(args...), + Severity: CtWarning, + }) } // Warningf logs and adds a trace event if channelz is on. -func Warningf(l grpclog.DepthLoggerV2, id int64, format string, args ...interface{}) { - msg := fmt.Sprintf(format, args...) - if IsOn() { - AddTraceEvent(l, id, 1, &TraceEventDesc{ - Desc: msg, - Severity: CtWarning, - }) - } else { - l.WarningDepth(1, msg) - } +func Warningf(l grpclog.DepthLoggerV2, id *Identifier, format string, args ...interface{}) { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprintf(format, args...), + Severity: CtWarning, + }) } // Error logs and adds a trace event if channelz is on. -func Error(l grpclog.DepthLoggerV2, id int64, args ...interface{}) { - if IsOn() { - AddTraceEvent(l, id, 1, &TraceEventDesc{ - Desc: fmt.Sprint(args...), - Severity: CtError, - }) - } else { - l.ErrorDepth(1, args...) - } +func Error(l grpclog.DepthLoggerV2, id *Identifier, args ...interface{}) { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprint(args...), + Severity: CtError, + }) } // Errorf logs and adds a trace event if channelz is on. -func Errorf(l grpclog.DepthLoggerV2, id int64, format string, args ...interface{}) { - msg := fmt.Sprintf(format, args...) - if IsOn() { - AddTraceEvent(l, id, 1, &TraceEventDesc{ - Desc: msg, - Severity: CtError, - }) - } else { - l.ErrorDepth(1, msg) - } +func Errorf(l grpclog.DepthLoggerV2, id *Identifier, format string, args ...interface{}) { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprintf(format, args...), + Severity: CtError, + }) } diff --git a/vendor/google.golang.org/grpc/internal/channelz/types.go b/vendor/google.golang.org/grpc/internal/channelz/types.go index 3c595d154..ad0ce4dab 100644 --- a/vendor/google.golang.org/grpc/internal/channelz/types.go +++ b/vendor/google.golang.org/grpc/internal/channelz/types.go @@ -686,12 +686,33 @@ const ( type RefChannelType int const ( + // RefUnknown indicates an unknown entity type, the zero value for this type. + RefUnknown RefChannelType = iota // RefChannel indicates the referenced entity is a Channel. - RefChannel RefChannelType = iota + RefChannel // RefSubChannel indicates the referenced entity is a SubChannel. RefSubChannel + // RefServer indicates the referenced entity is a Server. + RefServer + // RefListenSocket indicates the referenced entity is a ListenSocket. + RefListenSocket + // RefNormalSocket indicates the referenced entity is a NormalSocket. + RefNormalSocket ) +var refChannelTypeToString = map[RefChannelType]string{ + RefUnknown: "Unknown", + RefChannel: "Channel", + RefSubChannel: "SubChannel", + RefServer: "Server", + RefListenSocket: "ListenSocket", + RefNormalSocket: "NormalSocket", +} + +func (r RefChannelType) String() string { + return refChannelTypeToString[r] +} + func (c *channelTrace) dumpData() *ChannelTrace { c.mu.Lock() ct := &ChannelTrace{EventNum: c.eventCount, CreationTime: c.createdTime} diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 20fb880f3..6d355b0b0 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -85,3 +85,9 @@ const ( // that supports backend returned by grpclb balancer. CredsBundleModeBackendFromBalancer = "backend-from-balancer" ) + +// RLSLoadBalancingPolicyName is the name of the RLS LB policy. +// +// It currently has an experimental suffix which would be removed once +// end-to-end testing of the policy is completed. +const RLSLoadBalancingPolicyName = "rls_experimental" diff --git a/vendor/google.golang.org/grpc/internal/metadata/metadata.go b/vendor/google.golang.org/grpc/internal/metadata/metadata.go index b8733dbf3..b2980f8ac 100644 --- a/vendor/google.golang.org/grpc/internal/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/internal/metadata/metadata.go @@ -22,6 +22,9 @@ package metadata import ( + "fmt" + "strings" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" ) @@ -72,3 +75,46 @@ func Set(addr resolver.Address, md metadata.MD) resolver.Address { addr.Attributes = addr.Attributes.WithValue(mdKey, mdValue(md)) return addr } + +// Validate returns an error if the input md contains invalid keys or values. +// +// If the header is not a pseudo-header, the following items are checked: +// - header names must contain one or more characters from this set [0-9 a-z _ - .]. +// - if the header-name ends with a "-bin" suffix, no validation of the header value is performed. +// - otherwise, the header value must contain one or more characters from the set [%x20-%x7E]. +func Validate(md metadata.MD) error { + for k, vals := range md { + // pseudo-header will be ignored + if k[0] == ':' { + continue + } + // check key, for i that saving a conversion if not using for range + for i := 0; i < len(k); i++ { + r := k[i] + if !(r >= 'a' && r <= 'z') && !(r >= '0' && r <= '9') && r != '.' && r != '-' && r != '_' { + return fmt.Errorf("header key %q contains illegal characters not in [0-9a-z-_.]", k) + } + } + if strings.HasSuffix(k, "-bin") { + continue + } + // check value + for _, val := range vals { + if hasNotPrintable(val) { + return fmt.Errorf("header key %q contains value with non-printable ASCII characters", k) + } + } + } + return nil +} + +// hasNotPrintable return true if msg contains any characters which are not in %x20-%x7E +func hasNotPrintable(msg string) bool { + // for i that saving a conversion if not using for range + for i := 0; i < len(msg); i++ { + if msg[i] < 0x20 || msg[i] > 0x7E { + return true + } + } + return false +} diff --git a/vendor/google.golang.org/grpc/internal/pretty/pretty.go b/vendor/google.golang.org/grpc/internal/pretty/pretty.go new file mode 100644 index 000000000..0177af4b5 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/pretty/pretty.go @@ -0,0 +1,82 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package pretty defines helper functions to pretty-print structs for logging. +package pretty + +import ( + "bytes" + "encoding/json" + "fmt" + + "github.com/golang/protobuf/jsonpb" + protov1 "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/encoding/protojson" + protov2 "google.golang.org/protobuf/proto" +) + +const jsonIndent = " " + +// ToJSON marshals the input into a json string. +// +// If marshal fails, it falls back to fmt.Sprintf("%+v"). +func ToJSON(e interface{}) string { + switch ee := e.(type) { + case protov1.Message: + mm := jsonpb.Marshaler{Indent: jsonIndent} + ret, err := mm.MarshalToString(ee) + if err != nil { + // This may fail for proto.Anys, e.g. for xDS v2, LDS, the v2 + // messages are not imported, and this will fail because the message + // is not found. + return fmt.Sprintf("%+v", ee) + } + return ret + case protov2.Message: + mm := protojson.MarshalOptions{ + Multiline: true, + Indent: jsonIndent, + } + ret, err := mm.Marshal(ee) + if err != nil { + // This may fail for proto.Anys, e.g. for xDS v2, LDS, the v2 + // messages are not imported, and this will fail because the message + // is not found. + return fmt.Sprintf("%+v", ee) + } + return string(ret) + default: + ret, err := json.MarshalIndent(ee, "", jsonIndent) + if err != nil { + return fmt.Sprintf("%+v", ee) + } + return string(ret) + } +} + +// FormatJSON formats the input json bytes with indentation. +// +// If Indent fails, it returns the unchanged input as string. +func FormatJSON(b []byte) string { + var out bytes.Buffer + err := json.Indent(&out, b, "", jsonIndent) + if err != nil { + return string(b) + } + return out.String() +} diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index f0c72d337..24ca59084 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -132,7 +132,7 @@ type http2Client struct { kpDormant bool // Fields below are for channelz metric collection. - channelzID int64 // channelz unique identification number + channelzID *channelz.Identifier czData *channelzData onGoAway func(GoAwayReason) @@ -351,8 +351,9 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts } t.statsHandler.HandleConn(t.ctx, connBegin) } - if channelz.IsOn() { - t.channelzID = channelz.RegisterNormalSocket(t, opts.ChannelzParentID, fmt.Sprintf("%s -> %s", t.localAddr, t.remoteAddr)) + t.channelzID, err = channelz.RegisterNormalSocket(t, opts.ChannelzParentID, fmt.Sprintf("%s -> %s", t.localAddr, t.remoteAddr)) + if err != nil { + return nil, err } if t.keepaliveEnabled { t.kpDormancyCond = sync.NewCond(&t.mu) @@ -630,8 +631,8 @@ func (t *http2Client) getCallAuthData(ctx context.Context, audience string, call // the wire. However, there are two notable exceptions: // // 1. If the stream headers violate the max header list size allowed by the -// server. In this case there is no reason to retry at all, as it is -// assumed the RPC would continue to fail on subsequent attempts. +// server. It's possible this could succeed on another transport, even if +// it's unlikely, but do not transparently retry. // 2. If the credentials errored when requesting their headers. In this case, // it's possible a retry can fix the problem, but indefinitely transparently // retrying is not appropriate as it is likely the credentials, if they can @@ -639,8 +640,7 @@ func (t *http2Client) getCallAuthData(ctx context.Context, audience string, call type NewStreamError struct { Err error - DoNotRetry bool - DoNotTransparentRetry bool + AllowTransparentRetry bool } func (e NewStreamError) Error() string { @@ -649,11 +649,11 @@ func (e NewStreamError) Error() string { // NewStream creates a stream and registers it into the transport as "active" // streams. All non-nil errors returned will be *NewStreamError. -func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Stream, err error) { +func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, error) { ctx = peer.NewContext(ctx, t.getPeer()) headerFields, err := t.createHeaderFields(ctx, callHdr) if err != nil { - return nil, &NewStreamError{Err: err, DoNotTransparentRetry: true} + return nil, &NewStreamError{Err: err, AllowTransparentRetry: false} } s := t.newStream(ctx, callHdr) cleanup := func(err error) { @@ -753,13 +753,14 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea return true }, hdr) if err != nil { - return nil, &NewStreamError{Err: err} + // Connection closed. + return nil, &NewStreamError{Err: err, AllowTransparentRetry: true} } if success { break } if hdrListSizeErr != nil { - return nil, &NewStreamError{Err: hdrListSizeErr, DoNotRetry: true} + return nil, &NewStreamError{Err: hdrListSizeErr} } firstTry = false select { @@ -767,9 +768,9 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea case <-ctx.Done(): return nil, &NewStreamError{Err: ContextErr(ctx.Err())} case <-t.goAway: - return nil, &NewStreamError{Err: errStreamDrain} + return nil, &NewStreamError{Err: errStreamDrain, AllowTransparentRetry: true} case <-t.ctx.Done(): - return nil, &NewStreamError{Err: ErrConnClosing} + return nil, &NewStreamError{Err: ErrConnClosing, AllowTransparentRetry: true} } } if t.statsHandler != nil { @@ -898,9 +899,7 @@ func (t *http2Client) Close(err error) { t.controlBuf.finish() t.cancel() t.conn.Close() - if channelz.IsOn() { - channelz.RemoveEntry(t.channelzID) - } + channelz.RemoveEntry(t.channelzID) // Append info about previous goaways if there were any, since this may be important // for understanding the root cause for this connection to be closed. _, goAwayDebugMessage := t.GetGoAwayReason() diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 2c6eaf0e5..0956b500c 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -36,6 +36,7 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "google.golang.org/grpc/internal/grpcutil" + "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" @@ -117,7 +118,7 @@ type http2Server struct { idle time.Time // Fields below are for channelz metric collection. - channelzID int64 // channelz unique identification number + channelzID *channelz.Identifier czData *channelzData bufferPool *bufferPool @@ -231,6 +232,11 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, if kp.Timeout == 0 { kp.Timeout = defaultServerKeepaliveTimeout } + if kp.Time != infinity { + if err = syscall.SetTCPUserTimeout(conn, kp.Timeout); err != nil { + return nil, connectionErrorf(false, err, "transport: failed to set TCP_USER_TIMEOUT: %v", err) + } + } kep := config.KeepalivePolicy if kep.MinTime == 0 { kep.MinTime = defaultKeepalivePolicyMinTime @@ -275,12 +281,12 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, connBegin := &stats.ConnBegin{} t.stats.HandleConn(t.ctx, connBegin) } - if channelz.IsOn() { - t.channelzID = channelz.RegisterNormalSocket(t, config.ChannelzParentID, fmt.Sprintf("%s -> %s", t.remoteAddr, t.localAddr)) + t.channelzID, err = channelz.RegisterNormalSocket(t, config.ChannelzParentID, fmt.Sprintf("%s -> %s", t.remoteAddr, t.localAddr)) + if err != nil { + return nil, err } t.connectionID = atomic.AddUint64(&serverConnectionCounter, 1) - t.framer.writer.Flush() defer func() { @@ -1210,9 +1216,7 @@ func (t *http2Server) Close() { if err := t.conn.Close(); err != nil && logger.V(logLevel) { logger.Infof("transport: error closing conn during Close: %v", err) } - if channelz.IsOn() { - channelz.RemoveEntry(t.channelzID) - } + channelz.RemoveEntry(t.channelzID) // Cancel all active streams. for _, s := range streams { s.cancel() diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 0c43efaa6..a9ce717f1 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -34,6 +34,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" @@ -529,7 +530,7 @@ type ServerConfig struct { InitialConnWindowSize int32 WriteBufferSize int ReadBufferSize int - ChannelzParentID int64 + ChannelzParentID *channelz.Identifier MaxHeaderListSize *uint32 HeaderTableSize *uint32 } @@ -563,7 +564,7 @@ type ConnectOptions struct { // ReadBufferSize sets the size of read buffer, which in turn determines how much data can be read at most for one read syscall. ReadBufferSize int // ChannelzParentID sets the addrConn id which initiate the creation of this client transport. - ChannelzParentID int64 + ChannelzParentID *channelz.Identifier // MaxHeaderListSize sets the max (uncompressed) size of header list that is prepared to be received. MaxHeaderListSize *uint32 // UseProxy specifies if a proxy should be used. diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index 3604c7819..8e0f6abe8 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -188,7 +188,9 @@ func FromIncomingContext(ctx context.Context) (MD, bool) { // map, and there's no guarantee that the MD attached to the context is // created using our helper functions. key := strings.ToLower(k) - out[key] = v + s := make([]string, len(v)) + copy(s, v) + out[key] = s } return out, true } @@ -226,7 +228,9 @@ func FromOutgoingContext(ctx context.Context) (MD, bool) { // map, and there's no guarantee that the MD attached to the context is // created using our helper functions. key := strings.ToLower(k) - out[key] = v + s := make([]string, len(v)) + copy(s, v) + out[key] = s } for _, added := range raw.added { if len(added)%2 == 1 { diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go index e8367cb89..843633c91 100644 --- a/vendor/google.golang.org/grpc/picker_wrapper.go +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -131,7 +131,7 @@ func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer. } if _, ok := status.FromError(err); ok { // Status error: end the RPC unconditionally with this status. - return nil, nil, err + return nil, nil, dropError{error: err} } // For all other errors, wait for ready RPCs should block and other // RPCs should fail with unavailable. @@ -175,3 +175,9 @@ func (pw *pickerWrapper) close() { pw.done = true close(pw.blockingCh) } + +// dropError is a wrapper error that indicates the LB policy wishes to drop the +// RPC and not retry it. +type dropError struct { + error +} diff --git a/vendor/google.golang.org/grpc/pickfirst.go b/vendor/google.golang.org/grpc/pickfirst.go index 5168b62b0..fb7a99e0a 100644 --- a/vendor/google.golang.org/grpc/pickfirst.go +++ b/vendor/google.golang.org/grpc/pickfirst.go @@ -44,79 +44,107 @@ func (*pickfirstBuilder) Name() string { } type pickfirstBalancer struct { - state connectivity.State - cc balancer.ClientConn - sc balancer.SubConn + state connectivity.State + cc balancer.ClientConn + subConn balancer.SubConn } func (b *pickfirstBalancer) ResolverError(err error) { - switch b.state { - case connectivity.TransientFailure, connectivity.Idle, connectivity.Connecting: - // Set a failing picker if we don't have a good picker. - b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.TransientFailure, - Picker: &picker{err: fmt.Errorf("name resolver error: %v", err)}, - }) - } if logger.V(2) { logger.Infof("pickfirstBalancer: ResolverError called with error %v", err) } + if b.subConn == nil { + b.state = connectivity.TransientFailure + } + + if b.state != connectivity.TransientFailure { + // The picker will not change since the balancer does not currently + // report an error. + return + } + b.cc.UpdateState(balancer.State{ + ConnectivityState: connectivity.TransientFailure, + Picker: &picker{err: fmt.Errorf("name resolver error: %v", err)}, + }) } -func (b *pickfirstBalancer) UpdateClientConnState(cs balancer.ClientConnState) error { - if len(cs.ResolverState.Addresses) == 0 { +func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState) error { + if len(state.ResolverState.Addresses) == 0 { + // The resolver reported an empty address list. Treat it like an error by + // calling b.ResolverError. + if b.subConn != nil { + // Remove the old subConn. All addresses were removed, so it is no longer + // valid. + b.cc.RemoveSubConn(b.subConn) + b.subConn = nil + } b.ResolverError(errors.New("produced zero addresses")) return balancer.ErrBadResolverState } - if b.sc == nil { - var err error - b.sc, err = b.cc.NewSubConn(cs.ResolverState.Addresses, balancer.NewSubConnOptions{}) - if err != nil { - if logger.V(2) { - logger.Errorf("pickfirstBalancer: failed to NewSubConn: %v", err) - } - b.state = connectivity.TransientFailure - b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.TransientFailure, - Picker: &picker{err: fmt.Errorf("error creating connection: %v", err)}, - }) - return balancer.ErrBadResolverState + + if b.subConn != nil { + b.cc.UpdateAddresses(b.subConn, state.ResolverState.Addresses) + return nil + } + + subConn, err := b.cc.NewSubConn(state.ResolverState.Addresses, balancer.NewSubConnOptions{}) + if err != nil { + if logger.V(2) { + logger.Errorf("pickfirstBalancer: failed to NewSubConn: %v", err) } - b.state = connectivity.Idle - b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.Idle, Picker: &picker{result: balancer.PickResult{SubConn: b.sc}}}) - b.sc.Connect() - } else { - b.cc.UpdateAddresses(b.sc, cs.ResolverState.Addresses) - b.sc.Connect() + b.state = connectivity.TransientFailure + b.cc.UpdateState(balancer.State{ + ConnectivityState: connectivity.TransientFailure, + Picker: &picker{err: fmt.Errorf("error creating connection: %v", err)}, + }) + return balancer.ErrBadResolverState } + b.subConn = subConn + b.state = connectivity.Idle + b.cc.UpdateState(balancer.State{ + ConnectivityState: connectivity.Idle, + Picker: &picker{result: balancer.PickResult{SubConn: b.subConn}}, + }) + b.subConn.Connect() return nil } -func (b *pickfirstBalancer) UpdateSubConnState(sc balancer.SubConn, s balancer.SubConnState) { +func (b *pickfirstBalancer) UpdateSubConnState(subConn balancer.SubConn, state balancer.SubConnState) { if logger.V(2) { - logger.Infof("pickfirstBalancer: UpdateSubConnState: %p, %v", sc, s) + logger.Infof("pickfirstBalancer: UpdateSubConnState: %p, %v", subConn, state) } - if b.sc != sc { + if b.subConn != subConn { if logger.V(2) { - logger.Infof("pickfirstBalancer: ignored state change because sc is not recognized") + logger.Infof("pickfirstBalancer: ignored state change because subConn is not recognized") } return } - b.state = s.ConnectivityState - if s.ConnectivityState == connectivity.Shutdown { - b.sc = nil + b.state = state.ConnectivityState + if state.ConnectivityState == connectivity.Shutdown { + b.subConn = nil return } - switch s.ConnectivityState { + switch state.ConnectivityState { case connectivity.Ready: - b.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: &picker{result: balancer.PickResult{SubConn: sc}}}) + b.cc.UpdateState(balancer.State{ + ConnectivityState: state.ConnectivityState, + Picker: &picker{result: balancer.PickResult{SubConn: subConn}}, + }) case connectivity.Connecting: - b.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: &picker{err: balancer.ErrNoSubConnAvailable}}) + b.cc.UpdateState(balancer.State{ + ConnectivityState: state.ConnectivityState, + Picker: &picker{err: balancer.ErrNoSubConnAvailable}, + }) case connectivity.Idle: - b.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: &idlePicker{sc: sc}}) + b.cc.UpdateState(balancer.State{ + ConnectivityState: state.ConnectivityState, + Picker: &idlePicker{subConn: subConn}, + }) case connectivity.TransientFailure: b.cc.UpdateState(balancer.State{ - ConnectivityState: s.ConnectivityState, - Picker: &picker{err: s.ConnectionError}, + ConnectivityState: state.ConnectivityState, + Picker: &picker{err: state.ConnectionError}, }) } } @@ -125,8 +153,8 @@ func (b *pickfirstBalancer) Close() { } func (b *pickfirstBalancer) ExitIdle() { - if b.sc != nil && b.state == connectivity.Idle { - b.sc.Connect() + if b.subConn != nil && b.state == connectivity.Idle { + b.subConn.Connect() } } @@ -135,18 +163,18 @@ type picker struct { err error } -func (p *picker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { +func (p *picker) Pick(balancer.PickInfo) (balancer.PickResult, error) { return p.result, p.err } // idlePicker is used when the SubConn is IDLE and kicks the SubConn into // CONNECTING when Pick is called. type idlePicker struct { - sc balancer.SubConn + subConn balancer.SubConn } -func (i *idlePicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { - i.sc.Connect() +func (i *idlePicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { + i.subConn.Connect() return balancer.PickResult{}, balancer.ErrNoSubConnAvailable } diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index e28b68026..ca2e35a35 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -27,6 +27,7 @@ import ( "google.golang.org/grpc/attributes" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/serviceconfig" ) @@ -139,13 +140,18 @@ type Address struct { // Equal returns whether a and o are identical. Metadata is compared directly, // not with any recursive introspection. -func (a *Address) Equal(o Address) bool { +func (a Address) Equal(o Address) bool { return a.Addr == o.Addr && a.ServerName == o.ServerName && a.Attributes.Equal(o.Attributes) && a.BalancerAttributes.Equal(o.BalancerAttributes) && a.Type == o.Type && a.Metadata == o.Metadata } +// String returns JSON formatted string representation of the address. +func (a Address) String() string { + return pretty.ToJSON(a) +} + // BuildOptions includes additional information for the builder to create // the resolver. type BuildOptions struct { diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go index 2c47cd54f..05a9d4e0b 100644 --- a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go +++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go @@ -19,7 +19,6 @@ package grpc import ( - "fmt" "strings" "sync" @@ -27,6 +26,7 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) @@ -97,10 +97,7 @@ func (ccr *ccResolverWrapper) UpdateState(s resolver.State) error { if ccr.done.HasFired() { return nil } - channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: sending update to cc: %v", s) - if channelz.IsOn() { - ccr.addChannelzTraceEvent(s) - } + ccr.addChannelzTraceEvent(s) ccr.curState = s if err := ccr.cc.updateResolverState(ccr.curState, nil); err == balancer.ErrBadResolverState { return balancer.ErrBadResolverState @@ -125,10 +122,7 @@ func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { if ccr.done.HasFired() { return } - channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: sending new addresses to cc: %v", addrs) - if channelz.IsOn() { - ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig}) - } + ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig}) ccr.curState.Addresses = addrs ccr.cc.updateResolverState(ccr.curState, nil) } @@ -141,7 +135,7 @@ func (ccr *ccResolverWrapper) NewServiceConfig(sc string) { if ccr.done.HasFired() { return } - channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: got new service config: %v", sc) + channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: got new service config: %s", sc) if ccr.cc.dopts.disableServiceConfig { channelz.Info(logger, ccr.cc.channelzID, "Service config lookups disabled; ignoring config") return @@ -151,9 +145,7 @@ func (ccr *ccResolverWrapper) NewServiceConfig(sc string) { channelz.Warningf(logger, ccr.cc.channelzID, "ccResolverWrapper: error parsing service config: %v", scpr.Err) return } - if channelz.IsOn() { - ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr}) - } + ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr}) ccr.curState.ServiceConfig = scpr ccr.cc.updateResolverState(ccr.curState, nil) } @@ -180,8 +172,5 @@ func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { } else if len(ccr.curState.Addresses) == 0 && len(s.Addresses) > 0 { updates = append(updates, "resolver returned new addresses") } - channelz.AddTraceEvent(logger, ccr.cc.channelzID, 0, &channelz.TraceEventDesc{ - Desc: fmt.Sprintf("Resolver state updated: %+v (%v)", s, strings.Join(updates, "; ")), - Severity: channelz.CtInfo, - }) + channelz.Infof(logger, ccr.cc.channelzID, "Resolver state updated: %s (%v)", pretty.ToJSON(s), strings.Join(updates, "; ")) } diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index b24b6d539..96431a058 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -134,7 +134,7 @@ type Server struct { channelzRemoveOnce sync.Once serveWG sync.WaitGroup // counts active Serve goroutines for GracefulStop - channelzID int64 // channelz unique identification number + channelzID *channelz.Identifier czData *channelzData serverWorkerChannels []chan *serverWorkerData @@ -584,9 +584,8 @@ func NewServer(opt ...ServerOption) *Server { s.initServerWorkers() } - if channelz.IsOn() { - s.channelzID = channelz.RegisterServer(&channelzServer{s}, "") - } + s.channelzID = channelz.RegisterServer(&channelzServer{s}, "") + channelz.Info(logger, s.channelzID, "Server created") return s } @@ -712,7 +711,7 @@ var ErrServerStopped = errors.New("grpc: the server has been stopped") type listenSocket struct { net.Listener - channelzID int64 + channelzID *channelz.Identifier } func (l *listenSocket) ChannelzMetric() *channelz.SocketInternalMetric { @@ -724,9 +723,8 @@ func (l *listenSocket) ChannelzMetric() *channelz.SocketInternalMetric { func (l *listenSocket) Close() error { err := l.Listener.Close() - if channelz.IsOn() { - channelz.RemoveEntry(l.channelzID) - } + channelz.RemoveEntry(l.channelzID) + channelz.Info(logger, l.channelzID, "ListenSocket deleted") return err } @@ -759,11 +757,6 @@ func (s *Server) Serve(lis net.Listener) error { ls := &listenSocket{Listener: lis} s.lis[ls] = true - if channelz.IsOn() { - ls.channelzID = channelz.RegisterListenSocket(ls, s.channelzID, lis.Addr().String()) - } - s.mu.Unlock() - defer func() { s.mu.Lock() if s.lis != nil && s.lis[ls] { @@ -773,8 +766,16 @@ func (s *Server) Serve(lis net.Listener) error { s.mu.Unlock() }() - var tempDelay time.Duration // how long to sleep on accept failure + var err error + ls.channelzID, err = channelz.RegisterListenSocket(ls, s.channelzID, lis.Addr().String()) + if err != nil { + s.mu.Unlock() + return err + } + s.mu.Unlock() + channelz.Info(logger, ls.channelzID, "ListenSocket created") + var tempDelay time.Duration // how long to sleep on accept failure for { rawConn, err := lis.Accept() if err != nil { @@ -1709,11 +1710,7 @@ func (s *Server) Stop() { s.done.Fire() }() - s.channelzRemoveOnce.Do(func() { - if channelz.IsOn() { - channelz.RemoveEntry(s.channelzID) - } - }) + s.channelzRemoveOnce.Do(func() { channelz.RemoveEntry(s.channelzID) }) s.mu.Lock() listeners := s.lis @@ -1751,11 +1748,7 @@ func (s *Server) GracefulStop() { s.quit.Fire() defer s.done.Fire() - s.channelzRemoveOnce.Do(func() { - if channelz.IsOn() { - channelz.RemoveEntry(s.channelzID) - } - }) + s.channelzRemoveOnce.Do(func() { channelz.RemoveEntry(s.channelzID) }) s.mu.Lock() if s.conns == nil { s.mu.Unlock() diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go index 6926a06dc..b01c548bb 100644 --- a/vendor/google.golang.org/grpc/service_config.go +++ b/vendor/google.golang.org/grpc/service_config.go @@ -381,6 +381,9 @@ func init() { // // If any of them is NOT *ServiceConfig, return false. func equalServiceConfig(a, b serviceconfig.Config) bool { + if a == nil && b == nil { + return true + } aa, ok := a.(*ServiceConfig) if !ok { return false diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 8cdd652e0..be5140535 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -36,6 +36,7 @@ import ( "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/internal/grpcutil" + imetadata "google.golang.org/grpc/internal/metadata" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/serviceconfig" "google.golang.org/grpc/internal/transport" @@ -166,6 +167,11 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth } func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { + if md, _, ok := metadata.FromOutgoingContextRaw(ctx); ok { + if err := imetadata.Validate(md); err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + } if channelz.IsOn() { cc.incrCallsStarted() defer func() { @@ -297,14 +303,28 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client } cs.binlog = binarylog.GetMethodLogger(method) - if err := cs.newAttemptLocked(false /* isTransparent */); err != nil { + cs.attempt, err = cs.newAttemptLocked(false /* isTransparent */) + if err != nil { cs.finish(err) return nil, err } - op := func(a *csAttempt) error { return a.newStream() } + // Pick the transport to use and create a new stream on the transport. + // Assign cs.attempt upon success. + op := func(a *csAttempt) error { + if err := a.getTransport(); err != nil { + return err + } + if err := a.newStream(); err != nil { + return err + } + // Because this operation is always called either here (while creating + // the clientStream) or by the retry code while locked when replaying + // the operation, it is safe to access cs.attempt directly. + cs.attempt = a + return nil + } if err := cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op) }); err != nil { - cs.finish(err) return nil, err } @@ -343,9 +363,15 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client return cs, nil } -// newAttemptLocked creates a new attempt with a transport. -// If it succeeds, then it replaces clientStream's attempt with this new attempt. -func (cs *clientStream) newAttemptLocked(isTransparent bool) (retErr error) { +// newAttemptLocked creates a new csAttempt without a transport or stream. +func (cs *clientStream) newAttemptLocked(isTransparent bool) (*csAttempt, error) { + if err := cs.ctx.Err(); err != nil { + return nil, toRPCErr(err) + } + if err := cs.cc.ctx.Err(); err != nil { + return nil, ErrClientConnClosing + } + ctx := newContextWithRPCInfo(cs.ctx, cs.callInfo.failFast, cs.callInfo.codec, cs.cp, cs.comp) method := cs.callHdr.Method sh := cs.cc.dopts.copts.StatsHandler @@ -379,44 +405,39 @@ func (cs *clientStream) newAttemptLocked(isTransparent bool) (retErr error) { ctx = trace.NewContext(ctx, trInfo.tr) } - newAttempt := &csAttempt{ + if cs.cc.parsedTarget.Scheme == "xds" { + // Add extra metadata (metadata that will be added by transport) to context + // so the balancer can see them. + ctx = grpcutil.WithExtraMetadata(ctx, metadata.Pairs( + "content-type", grpcutil.ContentType(cs.callHdr.ContentSubtype), + )) + } + + return &csAttempt{ ctx: ctx, beginTime: beginTime, cs: cs, dc: cs.cc.dopts.dc, statsHandler: sh, trInfo: trInfo, - } - defer func() { - if retErr != nil { - // This attempt is not set in the clientStream, so it's finish won't - // be called. Call it here for stats and trace in case they are not - // nil. - newAttempt.finish(retErr) - } - }() + }, nil +} - if err := ctx.Err(); err != nil { - return toRPCErr(err) - } +func (a *csAttempt) getTransport() error { + cs := a.cs - if cs.cc.parsedTarget.Scheme == "xds" { - // Add extra metadata (metadata that will be added by transport) to context - // so the balancer can see them. - ctx = grpcutil.WithExtraMetadata(ctx, metadata.Pairs( - "content-type", grpcutil.ContentType(cs.callHdr.ContentSubtype), - )) - } - t, done, err := cs.cc.getTransport(ctx, cs.callInfo.failFast, cs.callHdr.Method) + var err error + a.t, a.done, err = cs.cc.getTransport(a.ctx, cs.callInfo.failFast, cs.callHdr.Method) if err != nil { + if de, ok := err.(dropError); ok { + err = de.error + a.drop = true + } return err } - if trInfo != nil { - trInfo.firstLine.SetRemoteAddr(t.RemoteAddr()) + if a.trInfo != nil { + a.trInfo.firstLine.SetRemoteAddr(a.t.RemoteAddr()) } - newAttempt.t = t - newAttempt.done = done - cs.attempt = newAttempt return nil } @@ -425,12 +446,21 @@ func (a *csAttempt) newStream() error { cs.callHdr.PreviousAttempts = cs.numRetries s, err := a.t.NewStream(a.ctx, cs.callHdr) if err != nil { - // Return without converting to an RPC error so retry code can - // inspect. - return err + nse, ok := err.(*transport.NewStreamError) + if !ok { + // Unexpected. + return err + } + + if nse.AllowTransparentRetry { + a.allowTransparentRetry = true + } + + // Unwrap and convert error. + return toRPCErr(nse.Err) } - cs.attempt.s = s - cs.attempt.p = &parser{r: s} + a.s = s + a.p = &parser{r: s} return nil } @@ -456,7 +486,7 @@ type clientStream struct { retryThrottler *retryThrottler // The throttler active when the RPC began. - binlog *binarylog.MethodLogger // Binary logger, can be nil. + binlog binarylog.MethodLogger // Binary logger, can be nil. // serverHeaderBinlogged is a boolean for whether server header has been // logged. Server header will be logged when the first time one of those // happens: stream.Header(), stream.Recv(). @@ -508,6 +538,11 @@ type csAttempt struct { statsHandler stats.Handler beginTime time.Time + + // set for newStream errors that may be transparently retried + allowTransparentRetry bool + // set for pick errors that are returned as a status + drop bool } func (cs *clientStream) commitAttemptLocked() { @@ -527,41 +562,21 @@ func (cs *clientStream) commitAttempt() { // shouldRetry returns nil if the RPC should be retried; otherwise it returns // the error that should be returned by the operation. If the RPC should be // retried, the bool indicates whether it is being retried transparently. -func (cs *clientStream) shouldRetry(err error) (bool, error) { - if cs.attempt.s == nil { - // Error from NewClientStream. - nse, ok := err.(*transport.NewStreamError) - if !ok { - // Unexpected, but assume no I/O was performed and the RPC is not - // fatal, so retry indefinitely. - return true, nil - } - - // Unwrap and convert error. - err = toRPCErr(nse.Err) - - // Never retry DoNotRetry errors, which indicate the RPC should not be - // retried due to max header list size violation, etc. - if nse.DoNotRetry { - return false, err - } +func (a *csAttempt) shouldRetry(err error) (bool, error) { + cs := a.cs - // In the event of a non-IO operation error from NewStream, we never - // attempted to write anything to the wire, so we can retry - // indefinitely. - if !nse.DoNotTransparentRetry { - return true, nil - } - } - if cs.finished || cs.committed { - // RPC is finished or committed; cannot retry. + if cs.finished || cs.committed || a.drop { + // RPC is finished or committed or was dropped by the picker; cannot retry. return false, err } + if a.s == nil && a.allowTransparentRetry { + return true, nil + } // Wait for the trailers. unprocessed := false - if cs.attempt.s != nil { - <-cs.attempt.s.Done() - unprocessed = cs.attempt.s.Unprocessed() + if a.s != nil { + <-a.s.Done() + unprocessed = a.s.Unprocessed() } if cs.firstAttempt && unprocessed { // First attempt, stream unprocessed: transparently retry. @@ -573,14 +588,14 @@ func (cs *clientStream) shouldRetry(err error) (bool, error) { pushback := 0 hasPushback := false - if cs.attempt.s != nil { - if !cs.attempt.s.TrailersOnly() { + if a.s != nil { + if !a.s.TrailersOnly() { return false, err } // TODO(retry): Move down if the spec changes to not check server pushback // before considering this a failure for throttling. - sps := cs.attempt.s.Trailer()["grpc-retry-pushback-ms"] + sps := a.s.Trailer()["grpc-retry-pushback-ms"] if len(sps) == 1 { var e error if pushback, e = strconv.Atoi(sps[0]); e != nil || pushback < 0 { @@ -597,10 +612,10 @@ func (cs *clientStream) shouldRetry(err error) (bool, error) { } var code codes.Code - if cs.attempt.s != nil { - code = cs.attempt.s.Status().Code() + if a.s != nil { + code = a.s.Status().Code() } else { - code = status.Convert(err).Code() + code = status.Code(err) } rp := cs.methodConfig.RetryPolicy @@ -645,19 +660,24 @@ func (cs *clientStream) shouldRetry(err error) (bool, error) { } // Returns nil if a retry was performed and succeeded; error otherwise. -func (cs *clientStream) retryLocked(lastErr error) error { +func (cs *clientStream) retryLocked(attempt *csAttempt, lastErr error) error { for { - cs.attempt.finish(toRPCErr(lastErr)) - isTransparent, err := cs.shouldRetry(lastErr) + attempt.finish(toRPCErr(lastErr)) + isTransparent, err := attempt.shouldRetry(lastErr) if err != nil { cs.commitAttemptLocked() return err } cs.firstAttempt = false - if err := cs.newAttemptLocked(isTransparent); err != nil { + attempt, err = cs.newAttemptLocked(isTransparent) + if err != nil { + // Only returns error if the clientconn is closed or the context of + // the stream is canceled. return err } - if lastErr = cs.replayBufferLocked(); lastErr == nil { + // Note that the first op in the replay buffer always sets cs.attempt + // if it is able to pick a transport and create a stream. + if lastErr = cs.replayBufferLocked(attempt); lastErr == nil { return nil } } @@ -667,7 +687,10 @@ func (cs *clientStream) Context() context.Context { cs.commitAttempt() // No need to lock before using attempt, since we know it is committed and // cannot change. - return cs.attempt.s.Context() + if cs.attempt.s != nil { + return cs.attempt.s.Context() + } + return cs.ctx } func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) error { @@ -697,7 +720,7 @@ func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) cs.mu.Unlock() return err } - if err := cs.retryLocked(err); err != nil { + if err := cs.retryLocked(a, err); err != nil { cs.mu.Unlock() return err } @@ -728,7 +751,7 @@ func (cs *clientStream) Header() (metadata.MD, error) { cs.binlog.Log(logEntry) cs.serverHeaderBinlogged = true } - return m, err + return m, nil } func (cs *clientStream) Trailer() metadata.MD { @@ -746,10 +769,9 @@ func (cs *clientStream) Trailer() metadata.MD { return cs.attempt.s.Trailer() } -func (cs *clientStream) replayBufferLocked() error { - a := cs.attempt +func (cs *clientStream) replayBufferLocked(attempt *csAttempt) error { for _, f := range cs.buffer { - if err := f(a); err != nil { + if err := f(attempt); err != nil { return err } } @@ -797,22 +819,17 @@ func (cs *clientStream) SendMsg(m interface{}) (err error) { if len(payload) > *cs.callInfo.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), *cs.callInfo.maxSendMessageSize) } - msgBytes := data // Store the pointer before setting to nil. For binary logging. op := func(a *csAttempt) error { - err := a.sendMsg(m, hdr, payload, data) - // nil out the message and uncomp when replaying; they are only needed for - // stats which is disabled for subsequent attempts. - m, data = nil, nil - return err + return a.sendMsg(m, hdr, payload, data) } err = cs.withRetry(op, func() { cs.bufferForRetryLocked(len(hdr)+len(payload), op) }) if cs.binlog != nil && err == nil { cs.binlog.Log(&binarylog.ClientMessage{ OnClientSide: true, - Message: msgBytes, + Message: data, }) } - return + return err } func (cs *clientStream) RecvMsg(m interface{}) error { @@ -1428,7 +1445,7 @@ type serverStream struct { statsHandler stats.Handler - binlog *binarylog.MethodLogger + binlog binarylog.MethodLogger // serverHeaderBinlogged indicates whether server header has been logged. It // will happen when one of the following two happens: stream.SendHeader(), // stream.Send(). @@ -1448,11 +1465,20 @@ func (ss *serverStream) SetHeader(md metadata.MD) error { if md.Len() == 0 { return nil } + err := imetadata.Validate(md) + if err != nil { + return status.Error(codes.Internal, err.Error()) + } return ss.s.SetHeader(md) } func (ss *serverStream) SendHeader(md metadata.MD) error { - err := ss.t.WriteHeader(ss.s, md) + err := imetadata.Validate(md) + if err != nil { + return status.Error(codes.Internal, err.Error()) + } + + err = ss.t.WriteHeader(ss.s, md) if ss.binlog != nil && !ss.serverHeaderBinlogged { h, _ := ss.s.Header() ss.binlog.Log(&binarylog.ServerHeader{ @@ -1467,6 +1493,9 @@ func (ss *serverStream) SetTrailer(md metadata.MD) { if md.Len() == 0 { return } + if err := imetadata.Validate(md); err != nil { + logger.Errorf("stream: failed to validate md when setting trailer, err: %v", err) + } ss.s.SetTrailer(md) } diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 5bd4f534c..f17192e6a 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.45.0" +const Version = "1.46.2" diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go new file mode 100644 index 000000000..07da5db34 --- /dev/null +++ b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -0,0 +1,665 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package protojson + +import ( + "encoding/base64" + "fmt" + "math" + "strconv" + "strings" + + "google.golang.org/protobuf/internal/encoding/json" + "google.golang.org/protobuf/internal/encoding/messageset" + "google.golang.org/protobuf/internal/errors" + "google.golang.org/protobuf/internal/flags" + "google.golang.org/protobuf/internal/genid" + "google.golang.org/protobuf/internal/pragma" + "google.golang.org/protobuf/internal/set" + "google.golang.org/protobuf/proto" + pref "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" +) + +// Unmarshal reads the given []byte into the given proto.Message. +// The provided message must be mutable (e.g., a non-nil pointer to a message). +func Unmarshal(b []byte, m proto.Message) error { + return UnmarshalOptions{}.Unmarshal(b, m) +} + +// UnmarshalOptions is a configurable JSON format parser. +type UnmarshalOptions struct { + pragma.NoUnkeyedLiterals + + // If AllowPartial is set, input for messages that will result in missing + // required fields will not return an error. + AllowPartial bool + + // If DiscardUnknown is set, unknown fields are ignored. + DiscardUnknown bool + + // Resolver is used for looking up types when unmarshaling + // google.protobuf.Any messages or extension fields. + // If nil, this defaults to using protoregistry.GlobalTypes. + Resolver interface { + protoregistry.MessageTypeResolver + protoregistry.ExtensionTypeResolver + } +} + +// Unmarshal reads the given []byte and populates the given proto.Message +// using options in the UnmarshalOptions object. +// It will clear the message first before setting the fields. +// If it returns an error, the given message may be partially set. +// The provided message must be mutable (e.g., a non-nil pointer to a message). +func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { + return o.unmarshal(b, m) +} + +// unmarshal is a centralized function that all unmarshal operations go through. +// For profiling purposes, avoid changing the name of this function or +// introducing other code paths for unmarshal that do not go through this. +func (o UnmarshalOptions) unmarshal(b []byte, m proto.Message) error { + proto.Reset(m) + + if o.Resolver == nil { + o.Resolver = protoregistry.GlobalTypes + } + + dec := decoder{json.NewDecoder(b), o} + if err := dec.unmarshalMessage(m.ProtoReflect(), false); err != nil { + return err + } + + // Check for EOF. + tok, err := dec.Read() + if err != nil { + return err + } + if tok.Kind() != json.EOF { + return dec.unexpectedTokenError(tok) + } + + if o.AllowPartial { + return nil + } + return proto.CheckInitialized(m) +} + +type decoder struct { + *json.Decoder + opts UnmarshalOptions +} + +// newError returns an error object with position info. +func (d decoder) newError(pos int, f string, x ...interface{}) error { + line, column := d.Position(pos) + head := fmt.Sprintf("(line %d:%d): ", line, column) + return errors.New(head+f, x...) +} + +// unexpectedTokenError returns a syntax error for the given unexpected token. +func (d decoder) unexpectedTokenError(tok json.Token) error { + return d.syntaxError(tok.Pos(), "unexpected token %s", tok.RawString()) +} + +// syntaxError returns a syntax error for given position. +func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { + line, column := d.Position(pos) + head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) + return errors.New(head+f, x...) +} + +// unmarshalMessage unmarshals a message into the given protoreflect.Message. +func (d decoder) unmarshalMessage(m pref.Message, skipTypeURL bool) error { + if unmarshal := wellKnownTypeUnmarshaler(m.Descriptor().FullName()); unmarshal != nil { + return unmarshal(d, m) + } + + tok, err := d.Read() + if err != nil { + return err + } + if tok.Kind() != json.ObjectOpen { + return d.unexpectedTokenError(tok) + } + + messageDesc := m.Descriptor() + if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) { + return errors.New("no support for proto1 MessageSets") + } + + var seenNums set.Ints + var seenOneofs set.Ints + fieldDescs := messageDesc.Fields() + for { + // Read field name. + tok, err := d.Read() + if err != nil { + return err + } + switch tok.Kind() { + default: + return d.unexpectedTokenError(tok) + case json.ObjectClose: + return nil + case json.Name: + // Continue below. + } + + name := tok.Name() + // Unmarshaling a non-custom embedded message in Any will contain the + // JSON field "@type" which should be skipped because it is not a field + // of the embedded message, but simply an artifact of the Any format. + if skipTypeURL && name == "@type" { + d.Read() + continue + } + + // Get the FieldDescriptor. + var fd pref.FieldDescriptor + if strings.HasPrefix(name, "[") && strings.HasSuffix(name, "]") { + // Only extension names are in [name] format. + extName := pref.FullName(name[1 : len(name)-1]) + extType, err := d.opts.Resolver.FindExtensionByName(extName) + if err != nil && err != protoregistry.NotFound { + return d.newError(tok.Pos(), "unable to resolve %s: %v", tok.RawString(), err) + } + if extType != nil { + fd = extType.TypeDescriptor() + if !messageDesc.ExtensionRanges().Has(fd.Number()) || fd.ContainingMessage().FullName() != messageDesc.FullName() { + return d.newError(tok.Pos(), "message %v cannot be extended by %v", messageDesc.FullName(), fd.FullName()) + } + } + } else { + // The name can either be the JSON name or the proto field name. + fd = fieldDescs.ByJSONName(name) + if fd == nil { + fd = fieldDescs.ByTextName(name) + } + } + if flags.ProtoLegacy { + if fd != nil && fd.IsWeak() && fd.Message().IsPlaceholder() { + fd = nil // reset since the weak reference is not linked in + } + } + + if fd == nil { + // Field is unknown. + if d.opts.DiscardUnknown { + if err := d.skipJSONValue(); err != nil { + return err + } + continue + } + return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) + } + + // Do not allow duplicate fields. + num := uint64(fd.Number()) + if seenNums.Has(num) { + return d.newError(tok.Pos(), "duplicate field %v", tok.RawString()) + } + seenNums.Set(num) + + // No need to set values for JSON null unless the field type is + // google.protobuf.Value or google.protobuf.NullValue. + if tok, _ := d.Peek(); tok.Kind() == json.Null && !isKnownValue(fd) && !isNullValue(fd) { + d.Read() + continue + } + + switch { + case fd.IsList(): + list := m.Mutable(fd).List() + if err := d.unmarshalList(list, fd); err != nil { + return err + } + case fd.IsMap(): + mmap := m.Mutable(fd).Map() + if err := d.unmarshalMap(mmap, fd); err != nil { + return err + } + default: + // If field is a oneof, check if it has already been set. + if od := fd.ContainingOneof(); od != nil { + idx := uint64(od.Index()) + if seenOneofs.Has(idx) { + return d.newError(tok.Pos(), "error parsing %s, oneof %v is already set", tok.RawString(), od.FullName()) + } + seenOneofs.Set(idx) + } + + // Required or optional fields. + if err := d.unmarshalSingular(m, fd); err != nil { + return err + } + } + } +} + +func isKnownValue(fd pref.FieldDescriptor) bool { + md := fd.Message() + return md != nil && md.FullName() == genid.Value_message_fullname +} + +func isNullValue(fd pref.FieldDescriptor) bool { + ed := fd.Enum() + return ed != nil && ed.FullName() == genid.NullValue_enum_fullname +} + +// unmarshalSingular unmarshals to the non-repeated field specified +// by the given FieldDescriptor. +func (d decoder) unmarshalSingular(m pref.Message, fd pref.FieldDescriptor) error { + var val pref.Value + var err error + switch fd.Kind() { + case pref.MessageKind, pref.GroupKind: + val = m.NewField(fd) + err = d.unmarshalMessage(val.Message(), false) + default: + val, err = d.unmarshalScalar(fd) + } + + if err != nil { + return err + } + m.Set(fd, val) + return nil +} + +// unmarshalScalar unmarshals to a scalar/enum protoreflect.Value specified by +// the given FieldDescriptor. +func (d decoder) unmarshalScalar(fd pref.FieldDescriptor) (pref.Value, error) { + const b32 int = 32 + const b64 int = 64 + + tok, err := d.Read() + if err != nil { + return pref.Value{}, err + } + + kind := fd.Kind() + switch kind { + case pref.BoolKind: + if tok.Kind() == json.Bool { + return pref.ValueOfBool(tok.Bool()), nil + } + + case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind: + if v, ok := unmarshalInt(tok, b32); ok { + return v, nil + } + + case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind: + if v, ok := unmarshalInt(tok, b64); ok { + return v, nil + } + + case pref.Uint32Kind, pref.Fixed32Kind: + if v, ok := unmarshalUint(tok, b32); ok { + return v, nil + } + + case pref.Uint64Kind, pref.Fixed64Kind: + if v, ok := unmarshalUint(tok, b64); ok { + return v, nil + } + + case pref.FloatKind: + if v, ok := unmarshalFloat(tok, b32); ok { + return v, nil + } + + case pref.DoubleKind: + if v, ok := unmarshalFloat(tok, b64); ok { + return v, nil + } + + case pref.StringKind: + if tok.Kind() == json.String { + return pref.ValueOfString(tok.ParsedString()), nil + } + + case pref.BytesKind: + if v, ok := unmarshalBytes(tok); ok { + return v, nil + } + + case pref.EnumKind: + if v, ok := unmarshalEnum(tok, fd); ok { + return v, nil + } + + default: + panic(fmt.Sprintf("unmarshalScalar: invalid scalar kind %v", kind)) + } + + return pref.Value{}, d.newError(tok.Pos(), "invalid value for %v type: %v", kind, tok.RawString()) +} + +func unmarshalInt(tok json.Token, bitSize int) (pref.Value, bool) { + switch tok.Kind() { + case json.Number: + return getInt(tok, bitSize) + + case json.String: + // Decode number from string. + s := strings.TrimSpace(tok.ParsedString()) + if len(s) != len(tok.ParsedString()) { + return pref.Value{}, false + } + dec := json.NewDecoder([]byte(s)) + tok, err := dec.Read() + if err != nil { + return pref.Value{}, false + } + return getInt(tok, bitSize) + } + return pref.Value{}, false +} + +func getInt(tok json.Token, bitSize int) (pref.Value, bool) { + n, ok := tok.Int(bitSize) + if !ok { + return pref.Value{}, false + } + if bitSize == 32 { + return pref.ValueOfInt32(int32(n)), true + } + return pref.ValueOfInt64(n), true +} + +func unmarshalUint(tok json.Token, bitSize int) (pref.Value, bool) { + switch tok.Kind() { + case json.Number: + return getUint(tok, bitSize) + + case json.String: + // Decode number from string. + s := strings.TrimSpace(tok.ParsedString()) + if len(s) != len(tok.ParsedString()) { + return pref.Value{}, false + } + dec := json.NewDecoder([]byte(s)) + tok, err := dec.Read() + if err != nil { + return pref.Value{}, false + } + return getUint(tok, bitSize) + } + return pref.Value{}, false +} + +func getUint(tok json.Token, bitSize int) (pref.Value, bool) { + n, ok := tok.Uint(bitSize) + if !ok { + return pref.Value{}, false + } + if bitSize == 32 { + return pref.ValueOfUint32(uint32(n)), true + } + return pref.ValueOfUint64(n), true +} + +func unmarshalFloat(tok json.Token, bitSize int) (pref.Value, bool) { + switch tok.Kind() { + case json.Number: + return getFloat(tok, bitSize) + + case json.String: + s := tok.ParsedString() + switch s { + case "NaN": + if bitSize == 32 { + return pref.ValueOfFloat32(float32(math.NaN())), true + } + return pref.ValueOfFloat64(math.NaN()), true + case "Infinity": + if bitSize == 32 { + return pref.ValueOfFloat32(float32(math.Inf(+1))), true + } + return pref.ValueOfFloat64(math.Inf(+1)), true + case "-Infinity": + if bitSize == 32 { + return pref.ValueOfFloat32(float32(math.Inf(-1))), true + } + return pref.ValueOfFloat64(math.Inf(-1)), true + } + + // Decode number from string. + if len(s) != len(strings.TrimSpace(s)) { + return pref.Value{}, false + } + dec := json.NewDecoder([]byte(s)) + tok, err := dec.Read() + if err != nil { + return pref.Value{}, false + } + return getFloat(tok, bitSize) + } + return pref.Value{}, false +} + +func getFloat(tok json.Token, bitSize int) (pref.Value, bool) { + n, ok := tok.Float(bitSize) + if !ok { + return pref.Value{}, false + } + if bitSize == 32 { + return pref.ValueOfFloat32(float32(n)), true + } + return pref.ValueOfFloat64(n), true +} + +func unmarshalBytes(tok json.Token) (pref.Value, bool) { + if tok.Kind() != json.String { + return pref.Value{}, false + } + + s := tok.ParsedString() + enc := base64.StdEncoding + if strings.ContainsAny(s, "-_") { + enc = base64.URLEncoding + } + if len(s)%4 != 0 { + enc = enc.WithPadding(base64.NoPadding) + } + b, err := enc.DecodeString(s) + if err != nil { + return pref.Value{}, false + } + return pref.ValueOfBytes(b), true +} + +func unmarshalEnum(tok json.Token, fd pref.FieldDescriptor) (pref.Value, bool) { + switch tok.Kind() { + case json.String: + // Lookup EnumNumber based on name. + s := tok.ParsedString() + if enumVal := fd.Enum().Values().ByName(pref.Name(s)); enumVal != nil { + return pref.ValueOfEnum(enumVal.Number()), true + } + + case json.Number: + if n, ok := tok.Int(32); ok { + return pref.ValueOfEnum(pref.EnumNumber(n)), true + } + + case json.Null: + // This is only valid for google.protobuf.NullValue. + if isNullValue(fd) { + return pref.ValueOfEnum(0), true + } + } + + return pref.Value{}, false +} + +func (d decoder) unmarshalList(list pref.List, fd pref.FieldDescriptor) error { + tok, err := d.Read() + if err != nil { + return err + } + if tok.Kind() != json.ArrayOpen { + return d.unexpectedTokenError(tok) + } + + switch fd.Kind() { + case pref.MessageKind, pref.GroupKind: + for { + tok, err := d.Peek() + if err != nil { + return err + } + + if tok.Kind() == json.ArrayClose { + d.Read() + return nil + } + + val := list.NewElement() + if err := d.unmarshalMessage(val.Message(), false); err != nil { + return err + } + list.Append(val) + } + default: + for { + tok, err := d.Peek() + if err != nil { + return err + } + + if tok.Kind() == json.ArrayClose { + d.Read() + return nil + } + + val, err := d.unmarshalScalar(fd) + if err != nil { + return err + } + list.Append(val) + } + } + + return nil +} + +func (d decoder) unmarshalMap(mmap pref.Map, fd pref.FieldDescriptor) error { + tok, err := d.Read() + if err != nil { + return err + } + if tok.Kind() != json.ObjectOpen { + return d.unexpectedTokenError(tok) + } + + // Determine ahead whether map entry is a scalar type or a message type in + // order to call the appropriate unmarshalMapValue func inside the for loop + // below. + var unmarshalMapValue func() (pref.Value, error) + switch fd.MapValue().Kind() { + case pref.MessageKind, pref.GroupKind: + unmarshalMapValue = func() (pref.Value, error) { + val := mmap.NewValue() + if err := d.unmarshalMessage(val.Message(), false); err != nil { + return pref.Value{}, err + } + return val, nil + } + default: + unmarshalMapValue = func() (pref.Value, error) { + return d.unmarshalScalar(fd.MapValue()) + } + } + +Loop: + for { + // Read field name. + tok, err := d.Read() + if err != nil { + return err + } + switch tok.Kind() { + default: + return d.unexpectedTokenError(tok) + case json.ObjectClose: + break Loop + case json.Name: + // Continue. + } + + // Unmarshal field name. + pkey, err := d.unmarshalMapKey(tok, fd.MapKey()) + if err != nil { + return err + } + + // Check for duplicate field name. + if mmap.Has(pkey) { + return d.newError(tok.Pos(), "duplicate map key %v", tok.RawString()) + } + + // Read and unmarshal field value. + pval, err := unmarshalMapValue() + if err != nil { + return err + } + + mmap.Set(pkey, pval) + } + + return nil +} + +// unmarshalMapKey converts given token of Name kind into a protoreflect.MapKey. +// A map key type is any integral or string type. +func (d decoder) unmarshalMapKey(tok json.Token, fd pref.FieldDescriptor) (pref.MapKey, error) { + const b32 = 32 + const b64 = 64 + const base10 = 10 + + name := tok.Name() + kind := fd.Kind() + switch kind { + case pref.StringKind: + return pref.ValueOfString(name).MapKey(), nil + + case pref.BoolKind: + switch name { + case "true": + return pref.ValueOfBool(true).MapKey(), nil + case "false": + return pref.ValueOfBool(false).MapKey(), nil + } + + case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind: + if n, err := strconv.ParseInt(name, base10, b32); err == nil { + return pref.ValueOfInt32(int32(n)).MapKey(), nil + } + + case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind: + if n, err := strconv.ParseInt(name, base10, b64); err == nil { + return pref.ValueOfInt64(int64(n)).MapKey(), nil + } + + case pref.Uint32Kind, pref.Fixed32Kind: + if n, err := strconv.ParseUint(name, base10, b32); err == nil { + return pref.ValueOfUint32(uint32(n)).MapKey(), nil + } + + case pref.Uint64Kind, pref.Fixed64Kind: + if n, err := strconv.ParseUint(name, base10, b64); err == nil { + return pref.ValueOfUint64(uint64(n)).MapKey(), nil + } + + default: + panic(fmt.Sprintf("invalid kind for map key: %v", kind)) + } + + return pref.MapKey{}, d.newError(tok.Pos(), "invalid value for %v key: %s", kind, tok.RawString()) +} diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/doc.go b/vendor/google.golang.org/protobuf/encoding/protojson/doc.go new file mode 100644 index 000000000..00ea2fecf --- /dev/null +++ b/vendor/google.golang.org/protobuf/encoding/protojson/doc.go @@ -0,0 +1,11 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package protojson marshals and unmarshals protocol buffer messages as JSON +// format. It follows the guide at +// https://developers.google.com/protocol-buffers/docs/proto3#json. +// +// This package produces a different output than the standard "encoding/json" +// package, which does not operate correctly on protocol buffer messages. +package protojson diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go new file mode 100644 index 000000000..ba971f078 --- /dev/null +++ b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go @@ -0,0 +1,344 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package protojson + +import ( + "encoding/base64" + "fmt" + + "google.golang.org/protobuf/internal/encoding/json" + "google.golang.org/protobuf/internal/encoding/messageset" + "google.golang.org/protobuf/internal/errors" + "google.golang.org/protobuf/internal/filedesc" + "google.golang.org/protobuf/internal/flags" + "google.golang.org/protobuf/internal/genid" + "google.golang.org/protobuf/internal/order" + "google.golang.org/protobuf/internal/pragma" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + pref "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" +) + +const defaultIndent = " " + +// Format formats the message as a multiline string. +// This function is only intended for human consumption and ignores errors. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. +func Format(m proto.Message) string { + return MarshalOptions{Multiline: true}.Format(m) +} + +// Marshal writes the given proto.Message in JSON format using default options. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. +func Marshal(m proto.Message) ([]byte, error) { + return MarshalOptions{}.Marshal(m) +} + +// MarshalOptions is a configurable JSON format marshaler. +type MarshalOptions struct { + pragma.NoUnkeyedLiterals + + // Multiline specifies whether the marshaler should format the output in + // indented-form with every textual element on a new line. + // If Indent is an empty string, then an arbitrary indent is chosen. + Multiline bool + + // Indent specifies the set of indentation characters to use in a multiline + // formatted output such that every entry is preceded by Indent and + // terminated by a newline. If non-empty, then Multiline is treated as true. + // Indent can only be composed of space or tab characters. + Indent string + + // AllowPartial allows messages that have missing required fields to marshal + // without returning an error. If AllowPartial is false (the default), + // Marshal will return error if there are any missing required fields. + AllowPartial bool + + // UseProtoNames uses proto field name instead of lowerCamelCase name in JSON + // field names. + UseProtoNames bool + + // UseEnumNumbers emits enum values as numbers. + UseEnumNumbers bool + + // EmitUnpopulated specifies whether to emit unpopulated fields. It does not + // emit unpopulated oneof fields or unpopulated extension fields. + // The JSON value emitted for unpopulated fields are as follows: + // ╔═══════╤════════════════════════════╗ + // ║ JSON │ Protobuf field ║ + // ╠═══════╪════════════════════════════╣ + // ║ false │ proto3 boolean fields ║ + // ║ 0 │ proto3 numeric fields ║ + // ║ "" │ proto3 string/bytes fields ║ + // ║ null │ proto2 scalar fields ║ + // ║ null │ message fields ║ + // ║ [] │ list fields ║ + // ║ {} │ map fields ║ + // ╚═══════╧════════════════════════════╝ + EmitUnpopulated bool + + // Resolver is used for looking up types when expanding google.protobuf.Any + // messages. If nil, this defaults to using protoregistry.GlobalTypes. + Resolver interface { + protoregistry.ExtensionTypeResolver + protoregistry.MessageTypeResolver + } +} + +// Format formats the message as a string. +// This method is only intended for human consumption and ignores errors. +// Do not depend on the output being stable. It may change over time across +// different versions of the program. +func (o MarshalOptions) Format(m proto.Message) string { + if m == nil || !m.ProtoReflect().IsValid() { + return "" // invalid syntax, but okay since this is for debugging + } + o.AllowPartial = true + b, _ := o.Marshal(m) + return string(b) +} + +// Marshal marshals the given proto.Message in the JSON format using options in +// MarshalOptions. Do not depend on the output being stable. It may change over +// time across different versions of the program. +func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { + return o.marshal(m) +} + +// marshal is a centralized function that all marshal operations go through. +// For profiling purposes, avoid changing the name of this function or +// introducing other code paths for marshal that do not go through this. +func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) { + if o.Multiline && o.Indent == "" { + o.Indent = defaultIndent + } + if o.Resolver == nil { + o.Resolver = protoregistry.GlobalTypes + } + + internalEnc, err := json.NewEncoder(o.Indent) + if err != nil { + return nil, err + } + + // Treat nil message interface as an empty message, + // in which case the output in an empty JSON object. + if m == nil { + return []byte("{}"), nil + } + + enc := encoder{internalEnc, o} + if err := enc.marshalMessage(m.ProtoReflect(), ""); err != nil { + return nil, err + } + if o.AllowPartial { + return enc.Bytes(), nil + } + return enc.Bytes(), proto.CheckInitialized(m) +} + +type encoder struct { + *json.Encoder + opts MarshalOptions +} + +// typeFieldDesc is a synthetic field descriptor used for the "@type" field. +var typeFieldDesc = func() protoreflect.FieldDescriptor { + var fd filedesc.Field + fd.L0.FullName = "@type" + fd.L0.Index = -1 + fd.L1.Cardinality = protoreflect.Optional + fd.L1.Kind = protoreflect.StringKind + return &fd +}() + +// typeURLFieldRanger wraps a protoreflect.Message and modifies its Range method +// to additionally iterate over a synthetic field for the type URL. +type typeURLFieldRanger struct { + order.FieldRanger + typeURL string +} + +func (m typeURLFieldRanger) Range(f func(pref.FieldDescriptor, pref.Value) bool) { + if !f(typeFieldDesc, pref.ValueOfString(m.typeURL)) { + return + } + m.FieldRanger.Range(f) +} + +// unpopulatedFieldRanger wraps a protoreflect.Message and modifies its Range +// method to additionally iterate over unpopulated fields. +type unpopulatedFieldRanger struct{ pref.Message } + +func (m unpopulatedFieldRanger) Range(f func(pref.FieldDescriptor, pref.Value) bool) { + fds := m.Descriptor().Fields() + for i := 0; i < fds.Len(); i++ { + fd := fds.Get(i) + if m.Has(fd) || fd.ContainingOneof() != nil { + continue // ignore populated fields and fields within a oneofs + } + + v := m.Get(fd) + isProto2Scalar := fd.Syntax() == pref.Proto2 && fd.Default().IsValid() + isSingularMessage := fd.Cardinality() != pref.Repeated && fd.Message() != nil + if isProto2Scalar || isSingularMessage { + v = pref.Value{} // use invalid value to emit null + } + if !f(fd, v) { + return + } + } + m.Message.Range(f) +} + +// marshalMessage marshals the fields in the given protoreflect.Message. +// If the typeURL is non-empty, then a synthetic "@type" field is injected +// containing the URL as the value. +func (e encoder) marshalMessage(m pref.Message, typeURL string) error { + if !flags.ProtoLegacy && messageset.IsMessageSet(m.Descriptor()) { + return errors.New("no support for proto1 MessageSets") + } + + if marshal := wellKnownTypeMarshaler(m.Descriptor().FullName()); marshal != nil { + return marshal(e, m) + } + + e.StartObject() + defer e.EndObject() + + var fields order.FieldRanger = m + if e.opts.EmitUnpopulated { + fields = unpopulatedFieldRanger{m} + } + if typeURL != "" { + fields = typeURLFieldRanger{fields, typeURL} + } + + var err error + order.RangeFields(fields, order.IndexNameFieldOrder, func(fd pref.FieldDescriptor, v pref.Value) bool { + name := fd.JSONName() + if e.opts.UseProtoNames { + name = fd.TextName() + } + + if err = e.WriteName(name); err != nil { + return false + } + if err = e.marshalValue(v, fd); err != nil { + return false + } + return true + }) + return err +} + +// marshalValue marshals the given protoreflect.Value. +func (e encoder) marshalValue(val pref.Value, fd pref.FieldDescriptor) error { + switch { + case fd.IsList(): + return e.marshalList(val.List(), fd) + case fd.IsMap(): + return e.marshalMap(val.Map(), fd) + default: + return e.marshalSingular(val, fd) + } +} + +// marshalSingular marshals the given non-repeated field value. This includes +// all scalar types, enums, messages, and groups. +func (e encoder) marshalSingular(val pref.Value, fd pref.FieldDescriptor) error { + if !val.IsValid() { + e.WriteNull() + return nil + } + + switch kind := fd.Kind(); kind { + case pref.BoolKind: + e.WriteBool(val.Bool()) + + case pref.StringKind: + if e.WriteString(val.String()) != nil { + return errors.InvalidUTF8(string(fd.FullName())) + } + + case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind: + e.WriteInt(val.Int()) + + case pref.Uint32Kind, pref.Fixed32Kind: + e.WriteUint(val.Uint()) + + case pref.Int64Kind, pref.Sint64Kind, pref.Uint64Kind, + pref.Sfixed64Kind, pref.Fixed64Kind: + // 64-bit integers are written out as JSON string. + e.WriteString(val.String()) + + case pref.FloatKind: + // Encoder.WriteFloat handles the special numbers NaN and infinites. + e.WriteFloat(val.Float(), 32) + + case pref.DoubleKind: + // Encoder.WriteFloat handles the special numbers NaN and infinites. + e.WriteFloat(val.Float(), 64) + + case pref.BytesKind: + e.WriteString(base64.StdEncoding.EncodeToString(val.Bytes())) + + case pref.EnumKind: + if fd.Enum().FullName() == genid.NullValue_enum_fullname { + e.WriteNull() + } else { + desc := fd.Enum().Values().ByNumber(val.Enum()) + if e.opts.UseEnumNumbers || desc == nil { + e.WriteInt(int64(val.Enum())) + } else { + e.WriteString(string(desc.Name())) + } + } + + case pref.MessageKind, pref.GroupKind: + if err := e.marshalMessage(val.Message(), ""); err != nil { + return err + } + + default: + panic(fmt.Sprintf("%v has unknown kind: %v", fd.FullName(), kind)) + } + return nil +} + +// marshalList marshals the given protoreflect.List. +func (e encoder) marshalList(list pref.List, fd pref.FieldDescriptor) error { + e.StartArray() + defer e.EndArray() + + for i := 0; i < list.Len(); i++ { + item := list.Get(i) + if err := e.marshalSingular(item, fd); err != nil { + return err + } + } + return nil +} + +// marshalMap marshals given protoreflect.Map. +func (e encoder) marshalMap(mmap pref.Map, fd pref.FieldDescriptor) error { + e.StartObject() + defer e.EndObject() + + var err error + order.RangeEntries(mmap, order.GenericKeyOrder, func(k pref.MapKey, v pref.Value) bool { + if err = e.WriteName(k.String()); err != nil { + return false + } + if err = e.marshalSingular(v, fd.MapValue()); err != nil { + return false + } + return true + }) + return err +} diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go new file mode 100644 index 000000000..72924a905 --- /dev/null +++ b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go @@ -0,0 +1,889 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package protojson + +import ( + "bytes" + "fmt" + "math" + "strconv" + "strings" + "time" + + "google.golang.org/protobuf/internal/encoding/json" + "google.golang.org/protobuf/internal/errors" + "google.golang.org/protobuf/internal/genid" + "google.golang.org/protobuf/internal/strs" + "google.golang.org/protobuf/proto" + pref "google.golang.org/protobuf/reflect/protoreflect" +) + +type marshalFunc func(encoder, pref.Message) error + +// wellKnownTypeMarshaler returns a marshal function if the message type +// has specialized serialization behavior. It returns nil otherwise. +func wellKnownTypeMarshaler(name pref.FullName) marshalFunc { + if name.Parent() == genid.GoogleProtobuf_package { + switch name.Name() { + case genid.Any_message_name: + return encoder.marshalAny + case genid.Timestamp_message_name: + return encoder.marshalTimestamp + case genid.Duration_message_name: + return encoder.marshalDuration + case genid.BoolValue_message_name, + genid.Int32Value_message_name, + genid.Int64Value_message_name, + genid.UInt32Value_message_name, + genid.UInt64Value_message_name, + genid.FloatValue_message_name, + genid.DoubleValue_message_name, + genid.StringValue_message_name, + genid.BytesValue_message_name: + return encoder.marshalWrapperType + case genid.Struct_message_name: + return encoder.marshalStruct + case genid.ListValue_message_name: + return encoder.marshalListValue + case genid.Value_message_name: + return encoder.marshalKnownValue + case genid.FieldMask_message_name: + return encoder.marshalFieldMask + case genid.Empty_message_name: + return encoder.marshalEmpty + } + } + return nil +} + +type unmarshalFunc func(decoder, pref.Message) error + +// wellKnownTypeUnmarshaler returns a unmarshal function if the message type +// has specialized serialization behavior. It returns nil otherwise. +func wellKnownTypeUnmarshaler(name pref.FullName) unmarshalFunc { + if name.Parent() == genid.GoogleProtobuf_package { + switch name.Name() { + case genid.Any_message_name: + return decoder.unmarshalAny + case genid.Timestamp_message_name: + return decoder.unmarshalTimestamp + case genid.Duration_message_name: + return decoder.unmarshalDuration + case genid.BoolValue_message_name, + genid.Int32Value_message_name, + genid.Int64Value_message_name, + genid.UInt32Value_message_name, + genid.UInt64Value_message_name, + genid.FloatValue_message_name, + genid.DoubleValue_message_name, + genid.StringValue_message_name, + genid.BytesValue_message_name: + return decoder.unmarshalWrapperType + case genid.Struct_message_name: + return decoder.unmarshalStruct + case genid.ListValue_message_name: + return decoder.unmarshalListValue + case genid.Value_message_name: + return decoder.unmarshalKnownValue + case genid.FieldMask_message_name: + return decoder.unmarshalFieldMask + case genid.Empty_message_name: + return decoder.unmarshalEmpty + } + } + return nil +} + +// The JSON representation of an Any message uses the regular representation of +// the deserialized, embedded message, with an additional field `@type` which +// contains the type URL. If the embedded message type is well-known and has a +// custom JSON representation, that representation will be embedded adding a +// field `value` which holds the custom JSON in addition to the `@type` field. + +func (e encoder) marshalAny(m pref.Message) error { + fds := m.Descriptor().Fields() + fdType := fds.ByNumber(genid.Any_TypeUrl_field_number) + fdValue := fds.ByNumber(genid.Any_Value_field_number) + + if !m.Has(fdType) { + if !m.Has(fdValue) { + // If message is empty, marshal out empty JSON object. + e.StartObject() + e.EndObject() + return nil + } else { + // Return error if type_url field is not set, but value is set. + return errors.New("%s: %v is not set", genid.Any_message_fullname, genid.Any_TypeUrl_field_name) + } + } + + typeVal := m.Get(fdType) + valueVal := m.Get(fdValue) + + // Resolve the type in order to unmarshal value field. + typeURL := typeVal.String() + emt, err := e.opts.Resolver.FindMessageByURL(typeURL) + if err != nil { + return errors.New("%s: unable to resolve %q: %v", genid.Any_message_fullname, typeURL, err) + } + + em := emt.New() + err = proto.UnmarshalOptions{ + AllowPartial: true, // never check required fields inside an Any + Resolver: e.opts.Resolver, + }.Unmarshal(valueVal.Bytes(), em.Interface()) + if err != nil { + return errors.New("%s: unable to unmarshal %q: %v", genid.Any_message_fullname, typeURL, err) + } + + // If type of value has custom JSON encoding, marshal out a field "value" + // with corresponding custom JSON encoding of the embedded message as a + // field. + if marshal := wellKnownTypeMarshaler(emt.Descriptor().FullName()); marshal != nil { + e.StartObject() + defer e.EndObject() + + // Marshal out @type field. + e.WriteName("@type") + if err := e.WriteString(typeURL); err != nil { + return err + } + + e.WriteName("value") + return marshal(e, em) + } + + // Else, marshal out the embedded message's fields in this Any object. + if err := e.marshalMessage(em, typeURL); err != nil { + return err + } + + return nil +} + +func (d decoder) unmarshalAny(m pref.Message) error { + // Peek to check for json.ObjectOpen to avoid advancing a read. + start, err := d.Peek() + if err != nil { + return err + } + if start.Kind() != json.ObjectOpen { + return d.unexpectedTokenError(start) + } + + // Use another decoder to parse the unread bytes for @type field. This + // avoids advancing a read from current decoder because the current JSON + // object may contain the fields of the embedded type. + dec := decoder{d.Clone(), UnmarshalOptions{}} + tok, err := findTypeURL(dec) + switch err { + case errEmptyObject: + // An empty JSON object translates to an empty Any message. + d.Read() // Read json.ObjectOpen. + d.Read() // Read json.ObjectClose. + return nil + + case errMissingType: + if d.opts.DiscardUnknown { + // Treat all fields as unknowns, similar to an empty object. + return d.skipJSONValue() + } + // Use start.Pos() for line position. + return d.newError(start.Pos(), err.Error()) + + default: + if err != nil { + return err + } + } + + typeURL := tok.ParsedString() + emt, err := d.opts.Resolver.FindMessageByURL(typeURL) + if err != nil { + return d.newError(tok.Pos(), "unable to resolve %v: %q", tok.RawString(), err) + } + + // Create new message for the embedded message type and unmarshal into it. + em := emt.New() + if unmarshal := wellKnownTypeUnmarshaler(emt.Descriptor().FullName()); unmarshal != nil { + // If embedded message is a custom type, + // unmarshal the JSON "value" field into it. + if err := d.unmarshalAnyValue(unmarshal, em); err != nil { + return err + } + } else { + // Else unmarshal the current JSON object into it. + if err := d.unmarshalMessage(em, true); err != nil { + return err + } + } + // Serialize the embedded message and assign the resulting bytes to the + // proto value field. + b, err := proto.MarshalOptions{ + AllowPartial: true, // No need to check required fields inside an Any. + Deterministic: true, + }.Marshal(em.Interface()) + if err != nil { + return d.newError(start.Pos(), "error in marshaling Any.value field: %v", err) + } + + fds := m.Descriptor().Fields() + fdType := fds.ByNumber(genid.Any_TypeUrl_field_number) + fdValue := fds.ByNumber(genid.Any_Value_field_number) + + m.Set(fdType, pref.ValueOfString(typeURL)) + m.Set(fdValue, pref.ValueOfBytes(b)) + return nil +} + +var errEmptyObject = fmt.Errorf(`empty object`) +var errMissingType = fmt.Errorf(`missing "@type" field`) + +// findTypeURL returns the token for the "@type" field value from the given +// JSON bytes. It is expected that the given bytes start with json.ObjectOpen. +// It returns errEmptyObject if the JSON object is empty or errMissingType if +// @type field does not exist. It returns other error if the @type field is not +// valid or other decoding issues. +func findTypeURL(d decoder) (json.Token, error) { + var typeURL string + var typeTok json.Token + numFields := 0 + // Skip start object. + d.Read() + +Loop: + for { + tok, err := d.Read() + if err != nil { + return json.Token{}, err + } + + switch tok.Kind() { + case json.ObjectClose: + if typeURL == "" { + // Did not find @type field. + if numFields > 0 { + return json.Token{}, errMissingType + } + return json.Token{}, errEmptyObject + } + break Loop + + case json.Name: + numFields++ + if tok.Name() != "@type" { + // Skip value. + if err := d.skipJSONValue(); err != nil { + return json.Token{}, err + } + continue + } + + // Return error if this was previously set already. + if typeURL != "" { + return json.Token{}, d.newError(tok.Pos(), `duplicate "@type" field`) + } + // Read field value. + tok, err := d.Read() + if err != nil { + return json.Token{}, err + } + if tok.Kind() != json.String { + return json.Token{}, d.newError(tok.Pos(), `@type field value is not a string: %v`, tok.RawString()) + } + typeURL = tok.ParsedString() + if typeURL == "" { + return json.Token{}, d.newError(tok.Pos(), `@type field contains empty value`) + } + typeTok = tok + } + } + + return typeTok, nil +} + +// skipJSONValue parses a JSON value (null, boolean, string, number, object and +// array) in order to advance the read to the next JSON value. It relies on +// the decoder returning an error if the types are not in valid sequence. +func (d decoder) skipJSONValue() error { + tok, err := d.Read() + if err != nil { + return err + } + // Only need to continue reading for objects and arrays. + switch tok.Kind() { + case json.ObjectOpen: + for { + tok, err := d.Read() + if err != nil { + return err + } + switch tok.Kind() { + case json.ObjectClose: + return nil + case json.Name: + // Skip object field value. + if err := d.skipJSONValue(); err != nil { + return err + } + } + } + + case json.ArrayOpen: + for { + tok, err := d.Peek() + if err != nil { + return err + } + switch tok.Kind() { + case json.ArrayClose: + d.Read() + return nil + default: + // Skip array item. + if err := d.skipJSONValue(); err != nil { + return err + } + } + } + } + return nil +} + +// unmarshalAnyValue unmarshals the given custom-type message from the JSON +// object's "value" field. +func (d decoder) unmarshalAnyValue(unmarshal unmarshalFunc, m pref.Message) error { + // Skip ObjectOpen, and start reading the fields. + d.Read() + + var found bool // Used for detecting duplicate "value". + for { + tok, err := d.Read() + if err != nil { + return err + } + switch tok.Kind() { + case json.ObjectClose: + if !found { + return d.newError(tok.Pos(), `missing "value" field`) + } + return nil + + case json.Name: + switch tok.Name() { + case "@type": + // Skip the value as this was previously parsed already. + d.Read() + + case "value": + if found { + return d.newError(tok.Pos(), `duplicate "value" field`) + } + // Unmarshal the field value into the given message. + if err := unmarshal(d, m); err != nil { + return err + } + found = true + + default: + if d.opts.DiscardUnknown { + if err := d.skipJSONValue(); err != nil { + return err + } + continue + } + return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) + } + } + } +} + +// Wrapper types are encoded as JSON primitives like string, number or boolean. + +func (e encoder) marshalWrapperType(m pref.Message) error { + fd := m.Descriptor().Fields().ByNumber(genid.WrapperValue_Value_field_number) + val := m.Get(fd) + return e.marshalSingular(val, fd) +} + +func (d decoder) unmarshalWrapperType(m pref.Message) error { + fd := m.Descriptor().Fields().ByNumber(genid.WrapperValue_Value_field_number) + val, err := d.unmarshalScalar(fd) + if err != nil { + return err + } + m.Set(fd, val) + return nil +} + +// The JSON representation for Empty is an empty JSON object. + +func (e encoder) marshalEmpty(pref.Message) error { + e.StartObject() + e.EndObject() + return nil +} + +func (d decoder) unmarshalEmpty(pref.Message) error { + tok, err := d.Read() + if err != nil { + return err + } + if tok.Kind() != json.ObjectOpen { + return d.unexpectedTokenError(tok) + } + + for { + tok, err := d.Read() + if err != nil { + return err + } + switch tok.Kind() { + case json.ObjectClose: + return nil + + case json.Name: + if d.opts.DiscardUnknown { + if err := d.skipJSONValue(); err != nil { + return err + } + continue + } + return d.newError(tok.Pos(), "unknown field %v", tok.RawString()) + + default: + return d.unexpectedTokenError(tok) + } + } +} + +// The JSON representation for Struct is a JSON object that contains the encoded +// Struct.fields map and follows the serialization rules for a map. + +func (e encoder) marshalStruct(m pref.Message) error { + fd := m.Descriptor().Fields().ByNumber(genid.Struct_Fields_field_number) + return e.marshalMap(m.Get(fd).Map(), fd) +} + +func (d decoder) unmarshalStruct(m pref.Message) error { + fd := m.Descriptor().Fields().ByNumber(genid.Struct_Fields_field_number) + return d.unmarshalMap(m.Mutable(fd).Map(), fd) +} + +// The JSON representation for ListValue is JSON array that contains the encoded +// ListValue.values repeated field and follows the serialization rules for a +// repeated field. + +func (e encoder) marshalListValue(m pref.Message) error { + fd := m.Descriptor().Fields().ByNumber(genid.ListValue_Values_field_number) + return e.marshalList(m.Get(fd).List(), fd) +} + +func (d decoder) unmarshalListValue(m pref.Message) error { + fd := m.Descriptor().Fields().ByNumber(genid.ListValue_Values_field_number) + return d.unmarshalList(m.Mutable(fd).List(), fd) +} + +// The JSON representation for a Value is dependent on the oneof field that is +// set. Each of the field in the oneof has its own custom serialization rule. A +// Value message needs to be a oneof field set, else it is an error. + +func (e encoder) marshalKnownValue(m pref.Message) error { + od := m.Descriptor().Oneofs().ByName(genid.Value_Kind_oneof_name) + fd := m.WhichOneof(od) + if fd == nil { + return errors.New("%s: none of the oneof fields is set", genid.Value_message_fullname) + } + if fd.Number() == genid.Value_NumberValue_field_number { + if v := m.Get(fd).Float(); math.IsNaN(v) || math.IsInf(v, 0) { + return errors.New("%s: invalid %v value", genid.Value_NumberValue_field_fullname, v) + } + } + return e.marshalSingular(m.Get(fd), fd) +} + +func (d decoder) unmarshalKnownValue(m pref.Message) error { + tok, err := d.Peek() + if err != nil { + return err + } + + var fd pref.FieldDescriptor + var val pref.Value + switch tok.Kind() { + case json.Null: + d.Read() + fd = m.Descriptor().Fields().ByNumber(genid.Value_NullValue_field_number) + val = pref.ValueOfEnum(0) + + case json.Bool: + tok, err := d.Read() + if err != nil { + return err + } + fd = m.Descriptor().Fields().ByNumber(genid.Value_BoolValue_field_number) + val = pref.ValueOfBool(tok.Bool()) + + case json.Number: + tok, err := d.Read() + if err != nil { + return err + } + fd = m.Descriptor().Fields().ByNumber(genid.Value_NumberValue_field_number) + var ok bool + val, ok = unmarshalFloat(tok, 64) + if !ok { + return d.newError(tok.Pos(), "invalid %v: %v", genid.Value_message_fullname, tok.RawString()) + } + + case json.String: + // A JSON string may have been encoded from the number_value field, + // e.g. "NaN", "Infinity", etc. Parsing a proto double type also allows + // for it to be in JSON string form. Given this custom encoding spec, + // however, there is no way to identify that and hence a JSON string is + // always assigned to the string_value field, which means that certain + // encoding cannot be parsed back to the same field. + tok, err := d.Read() + if err != nil { + return err + } + fd = m.Descriptor().Fields().ByNumber(genid.Value_StringValue_field_number) + val = pref.ValueOfString(tok.ParsedString()) + + case json.ObjectOpen: + fd = m.Descriptor().Fields().ByNumber(genid.Value_StructValue_field_number) + val = m.NewField(fd) + if err := d.unmarshalStruct(val.Message()); err != nil { + return err + } + + case json.ArrayOpen: + fd = m.Descriptor().Fields().ByNumber(genid.Value_ListValue_field_number) + val = m.NewField(fd) + if err := d.unmarshalListValue(val.Message()); err != nil { + return err + } + + default: + return d.newError(tok.Pos(), "invalid %v: %v", genid.Value_message_fullname, tok.RawString()) + } + + m.Set(fd, val) + return nil +} + +// The JSON representation for a Duration is a JSON string that ends in the +// suffix "s" (indicating seconds) and is preceded by the number of seconds, +// with nanoseconds expressed as fractional seconds. +// +// Durations less than one second are represented with a 0 seconds field and a +// positive or negative nanos field. For durations of one second or more, a +// non-zero value for the nanos field must be of the same sign as the seconds +// field. +// +// Duration.seconds must be from -315,576,000,000 to +315,576,000,000 inclusive. +// Duration.nanos must be from -999,999,999 to +999,999,999 inclusive. + +const ( + secondsInNanos = 999999999 + maxSecondsInDuration = 315576000000 +) + +func (e encoder) marshalDuration(m pref.Message) error { + fds := m.Descriptor().Fields() + fdSeconds := fds.ByNumber(genid.Duration_Seconds_field_number) + fdNanos := fds.ByNumber(genid.Duration_Nanos_field_number) + + secsVal := m.Get(fdSeconds) + nanosVal := m.Get(fdNanos) + secs := secsVal.Int() + nanos := nanosVal.Int() + if secs < -maxSecondsInDuration || secs > maxSecondsInDuration { + return errors.New("%s: seconds out of range %v", genid.Duration_message_fullname, secs) + } + if nanos < -secondsInNanos || nanos > secondsInNanos { + return errors.New("%s: nanos out of range %v", genid.Duration_message_fullname, nanos) + } + if (secs > 0 && nanos < 0) || (secs < 0 && nanos > 0) { + return errors.New("%s: signs of seconds and nanos do not match", genid.Duration_message_fullname) + } + // Generated output always contains 0, 3, 6, or 9 fractional digits, + // depending on required precision, followed by the suffix "s". + var sign string + if secs < 0 || nanos < 0 { + sign, secs, nanos = "-", -1*secs, -1*nanos + } + x := fmt.Sprintf("%s%d.%09d", sign, secs, nanos) + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, ".000") + e.WriteString(x + "s") + return nil +} + +func (d decoder) unmarshalDuration(m pref.Message) error { + tok, err := d.Read() + if err != nil { + return err + } + if tok.Kind() != json.String { + return d.unexpectedTokenError(tok) + } + + secs, nanos, ok := parseDuration(tok.ParsedString()) + if !ok { + return d.newError(tok.Pos(), "invalid %v value %v", genid.Duration_message_fullname, tok.RawString()) + } + // Validate seconds. No need to validate nanos because parseDuration would + // have covered that already. + if secs < -maxSecondsInDuration || secs > maxSecondsInDuration { + return d.newError(tok.Pos(), "%v value out of range: %v", genid.Duration_message_fullname, tok.RawString()) + } + + fds := m.Descriptor().Fields() + fdSeconds := fds.ByNumber(genid.Duration_Seconds_field_number) + fdNanos := fds.ByNumber(genid.Duration_Nanos_field_number) + + m.Set(fdSeconds, pref.ValueOfInt64(secs)) + m.Set(fdNanos, pref.ValueOfInt32(nanos)) + return nil +} + +// parseDuration parses the given input string for seconds and nanoseconds value +// for the Duration JSON format. The format is a decimal number with a suffix +// 's'. It can have optional plus/minus sign. There needs to be at least an +// integer or fractional part. Fractional part is limited to 9 digits only for +// nanoseconds precision, regardless of whether there are trailing zero digits. +// Example values are 1s, 0.1s, 1.s, .1s, +1s, -1s, -.1s. +func parseDuration(input string) (int64, int32, bool) { + b := []byte(input) + size := len(b) + if size < 2 { + return 0, 0, false + } + if b[size-1] != 's' { + return 0, 0, false + } + b = b[:size-1] + + // Read optional plus/minus symbol. + var neg bool + switch b[0] { + case '-': + neg = true + b = b[1:] + case '+': + b = b[1:] + } + if len(b) == 0 { + return 0, 0, false + } + + // Read the integer part. + var intp []byte + switch { + case b[0] == '0': + b = b[1:] + + case '1' <= b[0] && b[0] <= '9': + intp = b[0:] + b = b[1:] + n := 1 + for len(b) > 0 && '0' <= b[0] && b[0] <= '9' { + n++ + b = b[1:] + } + intp = intp[:n] + + case b[0] == '.': + // Continue below. + + default: + return 0, 0, false + } + + hasFrac := false + var frac [9]byte + if len(b) > 0 { + if b[0] != '.' { + return 0, 0, false + } + // Read the fractional part. + b = b[1:] + n := 0 + for len(b) > 0 && n < 9 && '0' <= b[0] && b[0] <= '9' { + frac[n] = b[0] + n++ + b = b[1:] + } + // It is not valid if there are more bytes left. + if len(b) > 0 { + return 0, 0, false + } + // Pad fractional part with 0s. + for i := n; i < 9; i++ { + frac[i] = '0' + } + hasFrac = true + } + + var secs int64 + if len(intp) > 0 { + var err error + secs, err = strconv.ParseInt(string(intp), 10, 64) + if err != nil { + return 0, 0, false + } + } + + var nanos int64 + if hasFrac { + nanob := bytes.TrimLeft(frac[:], "0") + if len(nanob) > 0 { + var err error + nanos, err = strconv.ParseInt(string(nanob), 10, 32) + if err != nil { + return 0, 0, false + } + } + } + + if neg { + if secs > 0 { + secs = -secs + } + if nanos > 0 { + nanos = -nanos + } + } + return secs, int32(nanos), true +} + +// The JSON representation for a Timestamp is a JSON string in the RFC 3339 +// format, i.e. "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where +// {year} is always expressed using four digits while {month}, {day}, {hour}, +// {min}, and {sec} are zero-padded to two digits each. The fractional seconds, +// which can go up to 9 digits, up to 1 nanosecond resolution, is optional. The +// "Z" suffix indicates the timezone ("UTC"); the timezone is required. Encoding +// should always use UTC (as indicated by "Z") and a decoder should be able to +// accept both UTC and other timezones (as indicated by an offset). +// +// Timestamp.seconds must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z +// inclusive. +// Timestamp.nanos must be from 0 to 999,999,999 inclusive. + +const ( + maxTimestampSeconds = 253402300799 + minTimestampSeconds = -62135596800 +) + +func (e encoder) marshalTimestamp(m pref.Message) error { + fds := m.Descriptor().Fields() + fdSeconds := fds.ByNumber(genid.Timestamp_Seconds_field_number) + fdNanos := fds.ByNumber(genid.Timestamp_Nanos_field_number) + + secsVal := m.Get(fdSeconds) + nanosVal := m.Get(fdNanos) + secs := secsVal.Int() + nanos := nanosVal.Int() + if secs < minTimestampSeconds || secs > maxTimestampSeconds { + return errors.New("%s: seconds out of range %v", genid.Timestamp_message_fullname, secs) + } + if nanos < 0 || nanos > secondsInNanos { + return errors.New("%s: nanos out of range %v", genid.Timestamp_message_fullname, nanos) + } + // Uses RFC 3339, where generated output will be Z-normalized and uses 0, 3, + // 6 or 9 fractional digits. + t := time.Unix(secs, nanos).UTC() + x := t.Format("2006-01-02T15:04:05.000000000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, "000") + x = strings.TrimSuffix(x, ".000") + e.WriteString(x + "Z") + return nil +} + +func (d decoder) unmarshalTimestamp(m pref.Message) error { + tok, err := d.Read() + if err != nil { + return err + } + if tok.Kind() != json.String { + return d.unexpectedTokenError(tok) + } + + t, err := time.Parse(time.RFC3339Nano, tok.ParsedString()) + if err != nil { + return d.newError(tok.Pos(), "invalid %v value %v", genid.Timestamp_message_fullname, tok.RawString()) + } + // Validate seconds. No need to validate nanos because time.Parse would have + // covered that already. + secs := t.Unix() + if secs < minTimestampSeconds || secs > maxTimestampSeconds { + return d.newError(tok.Pos(), "%v value out of range: %v", genid.Timestamp_message_fullname, tok.RawString()) + } + + fds := m.Descriptor().Fields() + fdSeconds := fds.ByNumber(genid.Timestamp_Seconds_field_number) + fdNanos := fds.ByNumber(genid.Timestamp_Nanos_field_number) + + m.Set(fdSeconds, pref.ValueOfInt64(secs)) + m.Set(fdNanos, pref.ValueOfInt32(int32(t.Nanosecond()))) + return nil +} + +// The JSON representation for a FieldMask is a JSON string where paths are +// separated by a comma. Fields name in each path are converted to/from +// lower-camel naming conventions. Encoding should fail if the path name would +// end up differently after a round-trip. + +func (e encoder) marshalFieldMask(m pref.Message) error { + fd := m.Descriptor().Fields().ByNumber(genid.FieldMask_Paths_field_number) + list := m.Get(fd).List() + paths := make([]string, 0, list.Len()) + + for i := 0; i < list.Len(); i++ { + s := list.Get(i).String() + if !pref.FullName(s).IsValid() { + return errors.New("%s contains invalid path: %q", genid.FieldMask_Paths_field_fullname, s) + } + // Return error if conversion to camelCase is not reversible. + cc := strs.JSONCamelCase(s) + if s != strs.JSONSnakeCase(cc) { + return errors.New("%s contains irreversible value %q", genid.FieldMask_Paths_field_fullname, s) + } + paths = append(paths, cc) + } + + e.WriteString(strings.Join(paths, ",")) + return nil +} + +func (d decoder) unmarshalFieldMask(m pref.Message) error { + tok, err := d.Read() + if err != nil { + return err + } + if tok.Kind() != json.String { + return d.unexpectedTokenError(tok) + } + str := strings.TrimSpace(tok.ParsedString()) + if str == "" { + return nil + } + paths := strings.Split(str, ",") + + fd := m.Descriptor().Fields().ByNumber(genid.FieldMask_Paths_field_number) + list := m.Mutable(fd).List() + + for _, s0 := range paths { + s := strs.JSONSnakeCase(s0) + if strings.Contains(s0, "_") || !pref.FullName(s).IsValid() { + return d.newError(tok.Pos(), "%v contains invalid path: %q", genid.FieldMask_Paths_field_fullname, s0) + } + list.Append(pref.ValueOfString(s)) + } + return nil +} diff --git a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go index a427f8b70..9c61112f5 100644 --- a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +++ b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go @@ -21,10 +21,11 @@ import ( type Number int32 const ( - MinValidNumber Number = 1 - FirstReservedNumber Number = 19000 - LastReservedNumber Number = 19999 - MaxValidNumber Number = 1<<29 - 1 + MinValidNumber Number = 1 + FirstReservedNumber Number = 19000 + LastReservedNumber Number = 19999 + MaxValidNumber Number = 1<<29 - 1 + DefaultRecursionLimit = 10000 ) // IsValid reports whether the field number is semantically valid. @@ -55,6 +56,7 @@ const ( errCodeOverflow errCodeReserved errCodeEndGroup + errCodeRecursionDepth ) var ( @@ -112,6 +114,10 @@ func ConsumeField(b []byte) (Number, Type, int) { // When parsing a group, the length includes the end group marker and // the end group is verified to match the starting field number. func ConsumeFieldValue(num Number, typ Type, b []byte) (n int) { + return consumeFieldValueD(num, typ, b, DefaultRecursionLimit) +} + +func consumeFieldValueD(num Number, typ Type, b []byte, depth int) (n int) { switch typ { case VarintType: _, n = ConsumeVarint(b) @@ -126,6 +132,9 @@ func ConsumeFieldValue(num Number, typ Type, b []byte) (n int) { _, n = ConsumeBytes(b) return n case StartGroupType: + if depth < 0 { + return errCodeRecursionDepth + } n0 := len(b) for { num2, typ2, n := ConsumeTag(b) @@ -140,7 +149,7 @@ func ConsumeFieldValue(num Number, typ Type, b []byte) (n int) { return n0 - len(b) } - n = ConsumeFieldValue(num2, typ2, b) + n = consumeFieldValueD(num2, typ2, b, depth-1) if n < 0 { return n // forward error code } diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go new file mode 100644 index 000000000..b13fd29e8 --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode.go @@ -0,0 +1,340 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package json + +import ( + "bytes" + "fmt" + "io" + "regexp" + "unicode/utf8" + + "google.golang.org/protobuf/internal/errors" +) + +// call specifies which Decoder method was invoked. +type call uint8 + +const ( + readCall call = iota + peekCall +) + +const unexpectedFmt = "unexpected token %s" + +// ErrUnexpectedEOF means that EOF was encountered in the middle of the input. +var ErrUnexpectedEOF = errors.New("%v", io.ErrUnexpectedEOF) + +// Decoder is a token-based JSON decoder. +type Decoder struct { + // lastCall is last method called, either readCall or peekCall. + // Initial value is readCall. + lastCall call + + // lastToken contains the last read token. + lastToken Token + + // lastErr contains the last read error. + lastErr error + + // openStack is a stack containing ObjectOpen and ArrayOpen values. The + // top of stack represents the object or the array the current value is + // directly located in. + openStack []Kind + + // orig is used in reporting line and column. + orig []byte + // in contains the unconsumed input. + in []byte +} + +// NewDecoder returns a Decoder to read the given []byte. +func NewDecoder(b []byte) *Decoder { + return &Decoder{orig: b, in: b} +} + +// Peek looks ahead and returns the next token kind without advancing a read. +func (d *Decoder) Peek() (Token, error) { + defer func() { d.lastCall = peekCall }() + if d.lastCall == readCall { + d.lastToken, d.lastErr = d.Read() + } + return d.lastToken, d.lastErr +} + +// Read returns the next JSON token. +// It will return an error if there is no valid token. +func (d *Decoder) Read() (Token, error) { + const scalar = Null | Bool | Number | String + + defer func() { d.lastCall = readCall }() + if d.lastCall == peekCall { + return d.lastToken, d.lastErr + } + + tok, err := d.parseNext() + if err != nil { + return Token{}, err + } + + switch tok.kind { + case EOF: + if len(d.openStack) != 0 || + d.lastToken.kind&scalar|ObjectClose|ArrayClose == 0 { + return Token{}, ErrUnexpectedEOF + } + + case Null: + if !d.isValueNext() { + return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) + } + + case Bool, Number: + if !d.isValueNext() { + return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) + } + + case String: + if d.isValueNext() { + break + } + // This string token should only be for a field name. + if d.lastToken.kind&(ObjectOpen|comma) == 0 { + return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) + } + if len(d.in) == 0 { + return Token{}, ErrUnexpectedEOF + } + if c := d.in[0]; c != ':' { + return Token{}, d.newSyntaxError(d.currPos(), `unexpected character %s, missing ":" after field name`, string(c)) + } + tok.kind = Name + d.consume(1) + + case ObjectOpen, ArrayOpen: + if !d.isValueNext() { + return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) + } + d.openStack = append(d.openStack, tok.kind) + + case ObjectClose: + if len(d.openStack) == 0 || + d.lastToken.kind == comma || + d.openStack[len(d.openStack)-1] != ObjectOpen { + return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) + } + d.openStack = d.openStack[:len(d.openStack)-1] + + case ArrayClose: + if len(d.openStack) == 0 || + d.lastToken.kind == comma || + d.openStack[len(d.openStack)-1] != ArrayOpen { + return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) + } + d.openStack = d.openStack[:len(d.openStack)-1] + + case comma: + if len(d.openStack) == 0 || + d.lastToken.kind&(scalar|ObjectClose|ArrayClose) == 0 { + return Token{}, d.newSyntaxError(tok.pos, unexpectedFmt, tok.RawString()) + } + } + + // Update d.lastToken only after validating token to be in the right sequence. + d.lastToken = tok + + if d.lastToken.kind == comma { + return d.Read() + } + return tok, nil +} + +// Any sequence that looks like a non-delimiter (for error reporting). +var errRegexp = regexp.MustCompile(`^([-+._a-zA-Z0-9]{1,32}|.)`) + +// parseNext parses for the next JSON token. It returns a Token object for +// different types, except for Name. It does not handle whether the next token +// is in a valid sequence or not. +func (d *Decoder) parseNext() (Token, error) { + // Trim leading spaces. + d.consume(0) + + in := d.in + if len(in) == 0 { + return d.consumeToken(EOF, 0), nil + } + + switch in[0] { + case 'n': + if n := matchWithDelim("null", in); n != 0 { + return d.consumeToken(Null, n), nil + } + + case 't': + if n := matchWithDelim("true", in); n != 0 { + return d.consumeBoolToken(true, n), nil + } + + case 'f': + if n := matchWithDelim("false", in); n != 0 { + return d.consumeBoolToken(false, n), nil + } + + case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + if n, ok := parseNumber(in); ok { + return d.consumeToken(Number, n), nil + } + + case '"': + s, n, err := d.parseString(in) + if err != nil { + return Token{}, err + } + return d.consumeStringToken(s, n), nil + + case '{': + return d.consumeToken(ObjectOpen, 1), nil + + case '}': + return d.consumeToken(ObjectClose, 1), nil + + case '[': + return d.consumeToken(ArrayOpen, 1), nil + + case ']': + return d.consumeToken(ArrayClose, 1), nil + + case ',': + return d.consumeToken(comma, 1), nil + } + return Token{}, d.newSyntaxError(d.currPos(), "invalid value %s", errRegexp.Find(in)) +} + +// newSyntaxError returns an error with line and column information useful for +// syntax errors. +func (d *Decoder) newSyntaxError(pos int, f string, x ...interface{}) error { + e := errors.New(f, x...) + line, column := d.Position(pos) + return errors.New("syntax error (line %d:%d): %v", line, column, e) +} + +// Position returns line and column number of given index of the original input. +// It will panic if index is out of range. +func (d *Decoder) Position(idx int) (line int, column int) { + b := d.orig[:idx] + line = bytes.Count(b, []byte("\n")) + 1 + if i := bytes.LastIndexByte(b, '\n'); i >= 0 { + b = b[i+1:] + } + column = utf8.RuneCount(b) + 1 // ignore multi-rune characters + return line, column +} + +// currPos returns the current index position of d.in from d.orig. +func (d *Decoder) currPos() int { + return len(d.orig) - len(d.in) +} + +// matchWithDelim matches s with the input b and verifies that the match +// terminates with a delimiter of some form (e.g., r"[^-+_.a-zA-Z0-9]"). +// As a special case, EOF is considered a delimiter. It returns the length of s +// if there is a match, else 0. +func matchWithDelim(s string, b []byte) int { + if !bytes.HasPrefix(b, []byte(s)) { + return 0 + } + + n := len(s) + if n < len(b) && isNotDelim(b[n]) { + return 0 + } + return n +} + +// isNotDelim returns true if given byte is a not delimiter character. +func isNotDelim(c byte) bool { + return (c == '-' || c == '+' || c == '.' || c == '_' || + ('a' <= c && c <= 'z') || + ('A' <= c && c <= 'Z') || + ('0' <= c && c <= '9')) +} + +// consume consumes n bytes of input and any subsequent whitespace. +func (d *Decoder) consume(n int) { + d.in = d.in[n:] + for len(d.in) > 0 { + switch d.in[0] { + case ' ', '\n', '\r', '\t': + d.in = d.in[1:] + default: + return + } + } +} + +// isValueNext returns true if next type should be a JSON value: Null, +// Number, String or Bool. +func (d *Decoder) isValueNext() bool { + if len(d.openStack) == 0 { + return d.lastToken.kind == 0 + } + + start := d.openStack[len(d.openStack)-1] + switch start { + case ObjectOpen: + return d.lastToken.kind&Name != 0 + case ArrayOpen: + return d.lastToken.kind&(ArrayOpen|comma) != 0 + } + panic(fmt.Sprintf( + "unreachable logic in Decoder.isValueNext, lastToken.kind: %v, openStack: %v", + d.lastToken.kind, start)) +} + +// consumeToken constructs a Token for given Kind with raw value derived from +// current d.in and given size, and consumes the given size-lenght of it. +func (d *Decoder) consumeToken(kind Kind, size int) Token { + tok := Token{ + kind: kind, + raw: d.in[:size], + pos: len(d.orig) - len(d.in), + } + d.consume(size) + return tok +} + +// consumeBoolToken constructs a Token for a Bool kind with raw value derived from +// current d.in and given size. +func (d *Decoder) consumeBoolToken(b bool, size int) Token { + tok := Token{ + kind: Bool, + raw: d.in[:size], + pos: len(d.orig) - len(d.in), + boo: b, + } + d.consume(size) + return tok +} + +// consumeStringToken constructs a Token for a String kind with raw value derived +// from current d.in and given size. +func (d *Decoder) consumeStringToken(s string, size int) Token { + tok := Token{ + kind: String, + raw: d.in[:size], + pos: len(d.orig) - len(d.in), + str: s, + } + d.consume(size) + return tok +} + +// Clone returns a copy of the Decoder for use in reading ahead the next JSON +// object, array or other values without affecting current Decoder. +func (d *Decoder) Clone() *Decoder { + ret := *d + ret.openStack = append([]Kind(nil), ret.openStack...) + return &ret +} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go new file mode 100644 index 000000000..2999d7133 --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_number.go @@ -0,0 +1,254 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package json + +import ( + "bytes" + "strconv" +) + +// parseNumber reads the given []byte for a valid JSON number. If it is valid, +// it returns the number of bytes. Parsing logic follows the definition in +// https://tools.ietf.org/html/rfc7159#section-6, and is based off +// encoding/json.isValidNumber function. +func parseNumber(input []byte) (int, bool) { + var n int + + s := input + if len(s) == 0 { + return 0, false + } + + // Optional - + if s[0] == '-' { + s = s[1:] + n++ + if len(s) == 0 { + return 0, false + } + } + + // Digits + switch { + case s[0] == '0': + s = s[1:] + n++ + + case '1' <= s[0] && s[0] <= '9': + s = s[1:] + n++ + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + n++ + } + + default: + return 0, false + } + + // . followed by 1 or more digits. + if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { + s = s[2:] + n += 2 + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + n++ + } + } + + // e or E followed by an optional - or + and + // 1 or more digits. + if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { + s = s[1:] + n++ + if s[0] == '+' || s[0] == '-' { + s = s[1:] + n++ + if len(s) == 0 { + return 0, false + } + } + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + n++ + } + } + + // Check that next byte is a delimiter or it is at the end. + if n < len(input) && isNotDelim(input[n]) { + return 0, false + } + + return n, true +} + +// numberParts is the result of parsing out a valid JSON number. It contains +// the parts of a number. The parts are used for integer conversion. +type numberParts struct { + neg bool + intp []byte + frac []byte + exp []byte +} + +// parseNumber constructs numberParts from given []byte. The logic here is +// similar to consumeNumber above with the difference of having to construct +// numberParts. The slice fields in numberParts are subslices of the input. +func parseNumberParts(input []byte) (numberParts, bool) { + var neg bool + var intp []byte + var frac []byte + var exp []byte + + s := input + if len(s) == 0 { + return numberParts{}, false + } + + // Optional - + if s[0] == '-' { + neg = true + s = s[1:] + if len(s) == 0 { + return numberParts{}, false + } + } + + // Digits + switch { + case s[0] == '0': + // Skip first 0 and no need to store. + s = s[1:] + + case '1' <= s[0] && s[0] <= '9': + intp = s + n := 1 + s = s[1:] + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + n++ + } + intp = intp[:n] + + default: + return numberParts{}, false + } + + // . followed by 1 or more digits. + if len(s) >= 2 && s[0] == '.' && '0' <= s[1] && s[1] <= '9' { + frac = s[1:] + n := 1 + s = s[2:] + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + n++ + } + frac = frac[:n] + } + + // e or E followed by an optional - or + and + // 1 or more digits. + if len(s) >= 2 && (s[0] == 'e' || s[0] == 'E') { + s = s[1:] + exp = s + n := 0 + if s[0] == '+' || s[0] == '-' { + s = s[1:] + n++ + if len(s) == 0 { + return numberParts{}, false + } + } + for len(s) > 0 && '0' <= s[0] && s[0] <= '9' { + s = s[1:] + n++ + } + exp = exp[:n] + } + + return numberParts{ + neg: neg, + intp: intp, + frac: bytes.TrimRight(frac, "0"), // Remove unnecessary 0s to the right. + exp: exp, + }, true +} + +// normalizeToIntString returns an integer string in normal form without the +// E-notation for given numberParts. It will return false if it is not an +// integer or if the exponent exceeds than max/min int value. +func normalizeToIntString(n numberParts) (string, bool) { + intpSize := len(n.intp) + fracSize := len(n.frac) + + if intpSize == 0 && fracSize == 0 { + return "0", true + } + + var exp int + if len(n.exp) > 0 { + i, err := strconv.ParseInt(string(n.exp), 10, 32) + if err != nil { + return "", false + } + exp = int(i) + } + + var num []byte + if exp >= 0 { + // For positive E, shift fraction digits into integer part and also pad + // with zeroes as needed. + + // If there are more digits in fraction than the E value, then the + // number is not an integer. + if fracSize > exp { + return "", false + } + + // Make sure resulting digits are within max value limit to avoid + // unnecessarily constructing a large byte slice that may simply fail + // later on. + const maxDigits = 20 // Max uint64 value has 20 decimal digits. + if intpSize+exp > maxDigits { + return "", false + } + + // Set cap to make a copy of integer part when appended. + num = n.intp[:len(n.intp):len(n.intp)] + num = append(num, n.frac...) + for i := 0; i < exp-fracSize; i++ { + num = append(num, '0') + } + } else { + // For negative E, shift digits in integer part out. + + // If there are fractions, then the number is not an integer. + if fracSize > 0 { + return "", false + } + + // index is where the decimal point will be after adjusting for negative + // exponent. + index := intpSize + exp + if index < 0 { + return "", false + } + + num = n.intp + // If any of the digits being shifted to the right of the decimal point + // is non-zero, then the number is not an integer. + for i := index; i < intpSize; i++ { + if num[i] != '0' { + return "", false + } + } + num = num[:index] + } + + if n.neg { + return "-" + string(num), true + } + return string(num), true +} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go new file mode 100644 index 000000000..f7fea7d8d --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_string.go @@ -0,0 +1,91 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package json + +import ( + "strconv" + "unicode" + "unicode/utf16" + "unicode/utf8" + + "google.golang.org/protobuf/internal/strs" +) + +func (d *Decoder) parseString(in []byte) (string, int, error) { + in0 := in + if len(in) == 0 { + return "", 0, ErrUnexpectedEOF + } + if in[0] != '"' { + return "", 0, d.newSyntaxError(d.currPos(), "invalid character %q at start of string", in[0]) + } + in = in[1:] + i := indexNeedEscapeInBytes(in) + in, out := in[i:], in[:i:i] // set cap to prevent mutations + for len(in) > 0 { + switch r, n := utf8.DecodeRune(in); { + case r == utf8.RuneError && n == 1: + return "", 0, d.newSyntaxError(d.currPos(), "invalid UTF-8 in string") + case r < ' ': + return "", 0, d.newSyntaxError(d.currPos(), "invalid character %q in string", r) + case r == '"': + in = in[1:] + n := len(in0) - len(in) + return string(out), n, nil + case r == '\\': + if len(in) < 2 { + return "", 0, ErrUnexpectedEOF + } + switch r := in[1]; r { + case '"', '\\', '/': + in, out = in[2:], append(out, r) + case 'b': + in, out = in[2:], append(out, '\b') + case 'f': + in, out = in[2:], append(out, '\f') + case 'n': + in, out = in[2:], append(out, '\n') + case 'r': + in, out = in[2:], append(out, '\r') + case 't': + in, out = in[2:], append(out, '\t') + case 'u': + if len(in) < 6 { + return "", 0, ErrUnexpectedEOF + } + v, err := strconv.ParseUint(string(in[2:6]), 16, 16) + if err != nil { + return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:6]) + } + in = in[6:] + + r := rune(v) + if utf16.IsSurrogate(r) { + if len(in) < 6 { + return "", 0, ErrUnexpectedEOF + } + v, err := strconv.ParseUint(string(in[2:6]), 16, 16) + r = utf16.DecodeRune(r, rune(v)) + if in[0] != '\\' || in[1] != 'u' || + r == unicode.ReplacementChar || err != nil { + return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:6]) + } + in = in[6:] + } + out = append(out, string(r)...) + default: + return "", 0, d.newSyntaxError(d.currPos(), "invalid escape code %q in string", in[:2]) + } + default: + i := indexNeedEscapeInBytes(in[n:]) + in, out = in[n+i:], append(out, in[:n+i]...) + } + } + return "", 0, ErrUnexpectedEOF +} + +// indexNeedEscapeInBytes returns the index of the character that needs +// escaping. If no characters need escaping, this returns the input length. +func indexNeedEscapeInBytes(b []byte) int { return indexNeedEscapeInString(strs.UnsafeString(b)) } diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go new file mode 100644 index 000000000..50578d659 --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/encoding/json/decode_token.go @@ -0,0 +1,192 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package json + +import ( + "bytes" + "fmt" + "strconv" +) + +// Kind represents a token kind expressible in the JSON format. +type Kind uint16 + +const ( + Invalid Kind = (1 << iota) / 2 + EOF + Null + Bool + Number + String + Name + ObjectOpen + ObjectClose + ArrayOpen + ArrayClose + + // comma is only for parsing in between tokens and + // does not need to be exported. + comma +) + +func (k Kind) String() string { + switch k { + case EOF: + return "eof" + case Null: + return "null" + case Bool: + return "bool" + case Number: + return "number" + case String: + return "string" + case ObjectOpen: + return "{" + case ObjectClose: + return "}" + case Name: + return "name" + case ArrayOpen: + return "[" + case ArrayClose: + return "]" + case comma: + return "," + } + return "" +} + +// Token provides a parsed token kind and value. +// +// Values are provided by the difference accessor methods. The accessor methods +// Name, Bool, and ParsedString will panic if called on the wrong kind. There +// are different accessor methods for the Number kind for converting to the +// appropriate Go numeric type and those methods have the ok return value. +type Token struct { + // Token kind. + kind Kind + // pos provides the position of the token in the original input. + pos int + // raw bytes of the serialized token. + // This is a subslice into the original input. + raw []byte + // boo is parsed boolean value. + boo bool + // str is parsed string value. + str string +} + +// Kind returns the token kind. +func (t Token) Kind() Kind { + return t.kind +} + +// RawString returns the read value in string. +func (t Token) RawString() string { + return string(t.raw) +} + +// Pos returns the token position from the input. +func (t Token) Pos() int { + return t.pos +} + +// Name returns the object name if token is Name, else it panics. +func (t Token) Name() string { + if t.kind == Name { + return t.str + } + panic(fmt.Sprintf("Token is not a Name: %v", t.RawString())) +} + +// Bool returns the bool value if token kind is Bool, else it panics. +func (t Token) Bool() bool { + if t.kind == Bool { + return t.boo + } + panic(fmt.Sprintf("Token is not a Bool: %v", t.RawString())) +} + +// ParsedString returns the string value for a JSON string token or the read +// value in string if token is not a string. +func (t Token) ParsedString() string { + if t.kind == String { + return t.str + } + panic(fmt.Sprintf("Token is not a String: %v", t.RawString())) +} + +// Float returns the floating-point number if token kind is Number. +// +// The floating-point precision is specified by the bitSize parameter: 32 for +// float32 or 64 for float64. If bitSize=32, the result still has type float64, +// but it will be convertible to float32 without changing its value. It will +// return false if the number exceeds the floating point limits for given +// bitSize. +func (t Token) Float(bitSize int) (float64, bool) { + if t.kind != Number { + return 0, false + } + f, err := strconv.ParseFloat(t.RawString(), bitSize) + if err != nil { + return 0, false + } + return f, true +} + +// Int returns the signed integer number if token is Number. +// +// The given bitSize specifies the integer type that the result must fit into. +// It returns false if the number is not an integer value or if the result +// exceeds the limits for given bitSize. +func (t Token) Int(bitSize int) (int64, bool) { + s, ok := t.getIntStr() + if !ok { + return 0, false + } + n, err := strconv.ParseInt(s, 10, bitSize) + if err != nil { + return 0, false + } + return n, true +} + +// Uint returns the signed integer number if token is Number. +// +// The given bitSize specifies the unsigned integer type that the result must +// fit into. It returns false if the number is not an unsigned integer value +// or if the result exceeds the limits for given bitSize. +func (t Token) Uint(bitSize int) (uint64, bool) { + s, ok := t.getIntStr() + if !ok { + return 0, false + } + n, err := strconv.ParseUint(s, 10, bitSize) + if err != nil { + return 0, false + } + return n, true +} + +func (t Token) getIntStr() (string, bool) { + if t.kind != Number { + return "", false + } + parts, ok := parseNumberParts(t.raw) + if !ok { + return "", false + } + return normalizeToIntString(parts) +} + +// TokenEquals returns true if given Tokens are equal, else false. +func TokenEquals(x, y Token) bool { + return x.kind == y.kind && + x.pos == y.pos && + bytes.Equal(x.raw, y.raw) && + x.boo == y.boo && + x.str == y.str +} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/json/encode.go b/vendor/google.golang.org/protobuf/internal/encoding/json/encode.go new file mode 100644 index 000000000..fbdf34873 --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/encoding/json/encode.go @@ -0,0 +1,276 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package json + +import ( + "math" + "math/bits" + "strconv" + "strings" + "unicode/utf8" + + "google.golang.org/protobuf/internal/detrand" + "google.golang.org/protobuf/internal/errors" +) + +// kind represents an encoding type. +type kind uint8 + +const ( + _ kind = (1 << iota) / 2 + name + scalar + objectOpen + objectClose + arrayOpen + arrayClose +) + +// Encoder provides methods to write out JSON constructs and values. The user is +// responsible for producing valid sequences of JSON constructs and values. +type Encoder struct { + indent string + lastKind kind + indents []byte + out []byte +} + +// NewEncoder returns an Encoder. +// +// If indent is a non-empty string, it causes every entry for an Array or Object +// to be preceded by the indent and trailed by a newline. +func NewEncoder(indent string) (*Encoder, error) { + e := &Encoder{} + if len(indent) > 0 { + if strings.Trim(indent, " \t") != "" { + return nil, errors.New("indent may only be composed of space or tab characters") + } + e.indent = indent + } + return e, nil +} + +// Bytes returns the content of the written bytes. +func (e *Encoder) Bytes() []byte { + return e.out +} + +// WriteNull writes out the null value. +func (e *Encoder) WriteNull() { + e.prepareNext(scalar) + e.out = append(e.out, "null"...) +} + +// WriteBool writes out the given boolean value. +func (e *Encoder) WriteBool(b bool) { + e.prepareNext(scalar) + if b { + e.out = append(e.out, "true"...) + } else { + e.out = append(e.out, "false"...) + } +} + +// WriteString writes out the given string in JSON string value. Returns error +// if input string contains invalid UTF-8. +func (e *Encoder) WriteString(s string) error { + e.prepareNext(scalar) + var err error + if e.out, err = appendString(e.out, s); err != nil { + return err + } + return nil +} + +// Sentinel error used for indicating invalid UTF-8. +var errInvalidUTF8 = errors.New("invalid UTF-8") + +func appendString(out []byte, in string) ([]byte, error) { + out = append(out, '"') + i := indexNeedEscapeInString(in) + in, out = in[i:], append(out, in[:i]...) + for len(in) > 0 { + switch r, n := utf8.DecodeRuneInString(in); { + case r == utf8.RuneError && n == 1: + return out, errInvalidUTF8 + case r < ' ' || r == '"' || r == '\\': + out = append(out, '\\') + switch r { + case '"', '\\': + out = append(out, byte(r)) + case '\b': + out = append(out, 'b') + case '\f': + out = append(out, 'f') + case '\n': + out = append(out, 'n') + case '\r': + out = append(out, 'r') + case '\t': + out = append(out, 't') + default: + out = append(out, 'u') + out = append(out, "0000"[1+(bits.Len32(uint32(r))-1)/4:]...) + out = strconv.AppendUint(out, uint64(r), 16) + } + in = in[n:] + default: + i := indexNeedEscapeInString(in[n:]) + in, out = in[n+i:], append(out, in[:n+i]...) + } + } + out = append(out, '"') + return out, nil +} + +// indexNeedEscapeInString returns the index of the character that needs +// escaping. If no characters need escaping, this returns the input length. +func indexNeedEscapeInString(s string) int { + for i, r := range s { + if r < ' ' || r == '\\' || r == '"' || r == utf8.RuneError { + return i + } + } + return len(s) +} + +// WriteFloat writes out the given float and bitSize in JSON number value. +func (e *Encoder) WriteFloat(n float64, bitSize int) { + e.prepareNext(scalar) + e.out = appendFloat(e.out, n, bitSize) +} + +// appendFloat formats given float in bitSize, and appends to the given []byte. +func appendFloat(out []byte, n float64, bitSize int) []byte { + switch { + case math.IsNaN(n): + return append(out, `"NaN"`...) + case math.IsInf(n, +1): + return append(out, `"Infinity"`...) + case math.IsInf(n, -1): + return append(out, `"-Infinity"`...) + } + + // JSON number formatting logic based on encoding/json. + // See floatEncoder.encode for reference. + fmt := byte('f') + if abs := math.Abs(n); abs != 0 { + if bitSize == 64 && (abs < 1e-6 || abs >= 1e21) || + bitSize == 32 && (float32(abs) < 1e-6 || float32(abs) >= 1e21) { + fmt = 'e' + } + } + out = strconv.AppendFloat(out, n, fmt, -1, bitSize) + if fmt == 'e' { + n := len(out) + if n >= 4 && out[n-4] == 'e' && out[n-3] == '-' && out[n-2] == '0' { + out[n-2] = out[n-1] + out = out[:n-1] + } + } + return out +} + +// WriteInt writes out the given signed integer in JSON number value. +func (e *Encoder) WriteInt(n int64) { + e.prepareNext(scalar) + e.out = append(e.out, strconv.FormatInt(n, 10)...) +} + +// WriteUint writes out the given unsigned integer in JSON number value. +func (e *Encoder) WriteUint(n uint64) { + e.prepareNext(scalar) + e.out = append(e.out, strconv.FormatUint(n, 10)...) +} + +// StartObject writes out the '{' symbol. +func (e *Encoder) StartObject() { + e.prepareNext(objectOpen) + e.out = append(e.out, '{') +} + +// EndObject writes out the '}' symbol. +func (e *Encoder) EndObject() { + e.prepareNext(objectClose) + e.out = append(e.out, '}') +} + +// WriteName writes out the given string in JSON string value and the name +// separator ':'. Returns error if input string contains invalid UTF-8, which +// should not be likely as protobuf field names should be valid. +func (e *Encoder) WriteName(s string) error { + e.prepareNext(name) + var err error + // Append to output regardless of error. + e.out, err = appendString(e.out, s) + e.out = append(e.out, ':') + return err +} + +// StartArray writes out the '[' symbol. +func (e *Encoder) StartArray() { + e.prepareNext(arrayOpen) + e.out = append(e.out, '[') +} + +// EndArray writes out the ']' symbol. +func (e *Encoder) EndArray() { + e.prepareNext(arrayClose) + e.out = append(e.out, ']') +} + +// prepareNext adds possible comma and indentation for the next value based +// on last type and indent option. It also updates lastKind to next. +func (e *Encoder) prepareNext(next kind) { + defer func() { + // Set lastKind to next. + e.lastKind = next + }() + + if len(e.indent) == 0 { + // Need to add comma on the following condition. + if e.lastKind&(scalar|objectClose|arrayClose) != 0 && + next&(name|scalar|objectOpen|arrayOpen) != 0 { + e.out = append(e.out, ',') + // For single-line output, add a random extra space after each + // comma to make output unstable. + if detrand.Bool() { + e.out = append(e.out, ' ') + } + } + return + } + + switch { + case e.lastKind&(objectOpen|arrayOpen) != 0: + // If next type is NOT closing, add indent and newline. + if next&(objectClose|arrayClose) == 0 { + e.indents = append(e.indents, e.indent...) + e.out = append(e.out, '\n') + e.out = append(e.out, e.indents...) + } + + case e.lastKind&(scalar|objectClose|arrayClose) != 0: + switch { + // If next type is either a value or name, add comma and newline. + case next&(name|scalar|objectOpen|arrayOpen) != 0: + e.out = append(e.out, ',', '\n') + + // If next type is a closing object or array, adjust indentation. + case next&(objectClose|arrayClose) != 0: + e.indents = e.indents[:len(e.indents)-len(e.indent)] + e.out = append(e.out, '\n') + } + e.out = append(e.out, e.indents...) + + case e.lastKind&name != 0: + e.out = append(e.out, ' ') + // For multi-line output, add a random extra space after key: to make + // output unstable. + if detrand.Bool() { + e.out = append(e.out, ' ') + } + } +} diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index eb10ea102..37803773f 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -381,7 +381,7 @@ func (d *Decoder) currentOpenKind() (Kind, byte) { case '[': return ListOpen, ']' } - panic(fmt.Sprintf("Decoder: openStack contains invalid byte %s", string(openCh))) + panic(fmt.Sprintf("Decoder: openStack contains invalid byte %c", openCh)) } func (d *Decoder) pushOpenStack(ch byte) { diff --git a/vendor/google.golang.org/protobuf/internal/errors/is_go112.go b/vendor/google.golang.org/protobuf/internal/errors/is_go112.go index f90e909b3..fbcd34920 100644 --- a/vendor/google.golang.org/protobuf/internal/errors/is_go112.go +++ b/vendor/google.golang.org/protobuf/internal/errors/is_go112.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.13 // +build !go1.13 package errors diff --git a/vendor/google.golang.org/protobuf/internal/errors/is_go113.go b/vendor/google.golang.org/protobuf/internal/errors/is_go113.go index dc05f4191..5e72f1cde 100644 --- a/vendor/google.golang.org/protobuf/internal/errors/is_go113.go +++ b/vendor/google.golang.org/protobuf/internal/errors/is_go113.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.13 // +build go1.13 package errors diff --git a/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go b/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go index a72995f02..bda8e8cf3 100644 --- a/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go +++ b/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !protolegacy // +build !protolegacy package flags diff --git a/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go b/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go index 772e2f0e4..6d8d9bd6b 100644 --- a/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go +++ b/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build protolegacy // +build protolegacy package flags diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go index 2706bb67f..4b15493f2 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.12 // +build !go1.12 package impl diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go index 1533ef600..0b31b66ea 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.12 // +build go1.12 package impl diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go b/vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go index 90705e3ae..145c577bd 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego || appengine // +build purego appengine package impl diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go b/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go index e118af1e2..757642e23 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego && !appengine // +build !purego,!appengine package impl diff --git a/vendor/google.golang.org/protobuf/internal/impl/decode.go b/vendor/google.golang.org/protobuf/internal/impl/decode.go index 949dc49a6..c65b0325c 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/decode.go +++ b/vendor/google.golang.org/protobuf/internal/impl/decode.go @@ -18,6 +18,7 @@ import ( ) var errDecode = errors.New("cannot parse invalid wire-format data") +var errRecursionDepth = errors.New("exceeded maximum recursion depth") type unmarshalOptions struct { flags protoiface.UnmarshalInputFlags @@ -25,6 +26,7 @@ type unmarshalOptions struct { FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) } + depth int } func (o unmarshalOptions) Options() proto.UnmarshalOptions { @@ -44,6 +46,7 @@ func (o unmarshalOptions) IsDefault() bool { var lazyUnmarshalOptions = unmarshalOptions{ resolver: preg.GlobalTypes, + depth: protowire.DefaultRecursionLimit, } type unmarshalOutput struct { @@ -62,6 +65,7 @@ func (mi *MessageInfo) unmarshal(in piface.UnmarshalInput) (piface.UnmarshalOutp out, err := mi.unmarshalPointer(in.Buf, p, 0, unmarshalOptions{ flags: in.Flags, resolver: in.Resolver, + depth: in.Depth, }) var flags piface.UnmarshalOutputFlags if out.initialized { @@ -82,6 +86,10 @@ var errUnknown = errors.New("unknown") func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { mi.init() + opts.depth-- + if opts.depth < 0 { + return out, errRecursionDepth + } if flags.ProtoLegacy && mi.isMessageSet { return unmarshalMessageSet(mi, b, p, opts) } diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go index 9e3ed821e..4c491bdf4 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego || appengine // +build purego appengine package impl diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go index 9ecf23a85..ee0e0573e 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego && !appengine // +build !purego,!appengine package impl diff --git a/vendor/google.golang.org/protobuf/internal/strs/strings_pure.go b/vendor/google.golang.org/protobuf/internal/strs/strings_pure.go index 85e074c97..a1f6f3338 100644 --- a/vendor/google.golang.org/protobuf/internal/strs/strings_pure.go +++ b/vendor/google.golang.org/protobuf/internal/strs/strings_pure.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego || appengine // +build purego appengine package strs diff --git a/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go b/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go index 2160c7019..56a8a4ed3 100644 --- a/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego && !appengine // +build !purego,!appengine package strs diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index 14e774fb2..3d40d5249 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,8 +52,8 @@ import ( // 10. Send out the CL for review and submit it. const ( Major = 1 - Minor = 27 - Patch = 1 + Minor = 28 + Patch = 0 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index 49f9b8c88..11bf7173b 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -42,18 +42,25 @@ type UnmarshalOptions struct { FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) } + + // RecursionLimit limits how deeply messages may be nested. + // If zero, a default limit is applied. + RecursionLimit int } // Unmarshal parses the wire-format message in b and places the result in m. // The provided message must be mutable (e.g., a non-nil pointer to a message). func Unmarshal(b []byte, m Message) error { - _, err := UnmarshalOptions{}.unmarshal(b, m.ProtoReflect()) + _, err := UnmarshalOptions{RecursionLimit: protowire.DefaultRecursionLimit}.unmarshal(b, m.ProtoReflect()) return err } // Unmarshal parses the wire-format message in b and places the result in m. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m Message) error { + if o.RecursionLimit == 0 { + o.RecursionLimit = protowire.DefaultRecursionLimit + } _, err := o.unmarshal(b, m.ProtoReflect()) return err } @@ -63,6 +70,9 @@ func (o UnmarshalOptions) Unmarshal(b []byte, m Message) error { // This method permits fine-grained control over the unmarshaler. // Most users should use Unmarshal instead. func (o UnmarshalOptions) UnmarshalState(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + if o.RecursionLimit == 0 { + o.RecursionLimit = protowire.DefaultRecursionLimit + } return o.unmarshal(in.Buf, in.Message) } @@ -86,12 +96,17 @@ func (o UnmarshalOptions) unmarshal(b []byte, m protoreflect.Message) (out proto Message: m, Buf: b, Resolver: o.Resolver, + Depth: o.RecursionLimit, } if o.DiscardUnknown { in.Flags |= protoiface.UnmarshalDiscardUnknown } out, err = methods.Unmarshal(in) } else { + o.RecursionLimit-- + if o.RecursionLimit < 0 { + return out, errors.New("exceeded max recursion depth") + } err = o.unmarshalMessageSlow(b, m) } if err != nil { diff --git a/vendor/google.golang.org/protobuf/proto/proto_methods.go b/vendor/google.golang.org/protobuf/proto/proto_methods.go index d8dd604f6..465e057b3 100644 --- a/vendor/google.golang.org/protobuf/proto/proto_methods.go +++ b/vendor/google.golang.org/protobuf/proto/proto_methods.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // The protoreflect build tag disables use of fast-path methods. +//go:build !protoreflect // +build !protoreflect package proto diff --git a/vendor/google.golang.org/protobuf/proto/proto_reflect.go b/vendor/google.golang.org/protobuf/proto/proto_reflect.go index b103d4320..494d6ceef 100644 --- a/vendor/google.golang.org/protobuf/proto/proto_reflect.go +++ b/vendor/google.golang.org/protobuf/proto/proto_reflect.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // The protoreflect build tag disables use of fast-path methods. +//go:build protoreflect // +build protoreflect package proto diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go index 6be5d16e9..d5d5af6eb 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go @@ -53,6 +53,7 @@ type ( FindExtensionByName(field FullName) (ExtensionType, error) FindExtensionByNumber(message FullName, field FieldNumber) (ExtensionType, error) } + Depth int } unmarshalOutput = struct { pragma.NoUnkeyedLiterals diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go index 918e685e1..7ced876f4 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego || appengine // +build purego appengine package protoreflect diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go index 5a3414724..eb7764c30 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go @@ -41,6 +41,31 @@ import ( // Converting to/from a Value and a concrete Go value panics on type mismatch. // For example, ValueOf("hello").Int() panics because this attempts to // retrieve an int64 from a string. +// +// List, Map, and Message Values are called "composite" values. +// +// A composite Value may alias (reference) memory at some location, +// such that changes to the Value updates the that location. +// A composite value acquired with a Mutable method, such as Message.Mutable, +// always references the source object. +// +// For example: +// // Append a 0 to a "repeated int32" field. +// // Since the Value returned by Mutable is guaranteed to alias +// // the source message, modifying the Value modifies the message. +// message.Mutable(fieldDesc).(List).Append(protoreflect.ValueOfInt32(0)) +// +// // Assign [0] to a "repeated int32" field by creating a new Value, +// // modifying it, and assigning it. +// list := message.NewField(fieldDesc).(List) +// list.Append(protoreflect.ValueOfInt32(0)) +// message.Set(fieldDesc, list) +// // ERROR: Since it is not defined whether Set aliases the source, +// // appending to the List here may or may not modify the message. +// list.Append(protoreflect.ValueOfInt32(0)) +// +// Some operations, such as Message.Get, may return an "empty, read-only" +// composite Value. Modifying an empty, read-only value panics. type Value value // The protoreflect API uses a custom Value union type instead of interface{} diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go index c45debdca..702ddf22a 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego && !appengine // +build !purego,!appengine package protoreflect diff --git a/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go b/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go index 32c04f67e..44cf467d8 100644 --- a/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go +++ b/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go @@ -103,6 +103,7 @@ type UnmarshalInput = struct { FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) } + Depth int } // UnmarshalOutput is output from the Unmarshal method. diff --git a/vendor/modules.txt b/vendor/modules.txt index 411877e99..c4f38b1bf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,7 +1,3 @@ -# github.com/PuerkitoBio/purell v1.1.1 -github.com/PuerkitoBio/purell -# github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 -github.com/PuerkitoBio/urlesc # github.com/agext/levenshtein v1.2.3 ## explicit github.com/agext/levenshtein @@ -12,7 +8,8 @@ github.com/asaskevich/govalidator # github.com/fatih/color v1.13.0 ## explicit github.com/fatih/color -# github.com/go-openapi/analysis v0.21.2 +# github.com/go-openapi/analysis v0.21.3 +## explicit github.com/go-openapi/analysis github.com/go-openapi/analysis/internal/debug github.com/go-openapi/analysis/internal/flatten/normalize @@ -24,11 +21,12 @@ github.com/go-openapi/analysis/internal/flatten/sortref github.com/go-openapi/errors # github.com/go-openapi/jsonpointer v0.19.5 github.com/go-openapi/jsonpointer -# github.com/go-openapi/jsonreference v0.19.6 +# github.com/go-openapi/jsonreference v0.20.0 github.com/go-openapi/jsonreference +github.com/go-openapi/jsonreference/internal # github.com/go-openapi/loads v0.21.1 github.com/go-openapi/loads -# github.com/go-openapi/runtime v0.23.2 +# github.com/go-openapi/runtime v0.24.1 ## explicit github.com/go-openapi/runtime github.com/go-openapi/runtime/client @@ -39,7 +37,8 @@ github.com/go-openapi/runtime/middleware/header github.com/go-openapi/runtime/middleware/untyped github.com/go-openapi/runtime/security github.com/go-openapi/runtime/yamlpc -# github.com/go-openapi/spec v0.20.4 +# github.com/go-openapi/spec v0.20.6 +## explicit github.com/go-openapi/spec # github.com/go-openapi/strfmt v0.21.2 ## explicit @@ -51,14 +50,14 @@ github.com/go-openapi/validate # github.com/go-stack/stack v1.8.1 github.com/go-stack/stack # github.com/golang/protobuf v1.5.2 +github.com/golang/protobuf/jsonpb github.com/golang/protobuf/proto github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/empty github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-cmp v0.5.7 -## explicit +# github.com/google/go-cmp v0.5.8 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags @@ -77,36 +76,45 @@ github.com/hashicorp/go-cty/cty/json github.com/hashicorp/go-cty/cty/msgpack github.com/hashicorp/go-cty/cty/set # github.com/hashicorp/go-hclog v1.2.0 -## explicit github.com/hashicorp/go-hclog # github.com/hashicorp/go-multierror v1.1.1 -## explicit github.com/hashicorp/go-multierror -# github.com/hashicorp/go-plugin v1.4.3 -## explicit +# github.com/hashicorp/go-plugin v1.4.4 github.com/hashicorp/go-plugin github.com/hashicorp/go-plugin/internal/plugin -# github.com/hashicorp/go-uuid v1.0.2 -## explicit +# github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-uuid # github.com/hashicorp/go-version v1.4.0 -## explicit github.com/hashicorp/go-version -# github.com/hashicorp/hcl/v2 v2.11.1 -## explicit +# github.com/hashicorp/hcl/v2 v2.12.0 github.com/hashicorp/hcl/v2 github.com/hashicorp/hcl/v2/ext/customdecode github.com/hashicorp/hcl/v2/hclsyntax -# github.com/hashicorp/terraform-plugin-go v0.2.1 +# github.com/hashicorp/logutils v1.0.0 +github.com/hashicorp/logutils +# github.com/hashicorp/terraform-plugin-go v0.9.1 +## explicit +github.com/hashicorp/terraform-plugin-go/internal/logging github.com/hashicorp/terraform-plugin-go/tfprotov5 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/fromproto github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto -github.com/hashicorp/terraform-plugin-go/tfprotov5/server -github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes -# github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3 +github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server +github.com/hashicorp/terraform-plugin-go/tfprotov6 +github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/fromproto +github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6 +github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/toproto +github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server +github.com/hashicorp/terraform-plugin-go/tftypes +# github.com/hashicorp/terraform-plugin-log v0.4.0 +github.com/hashicorp/terraform-plugin-log/internal/hclogutils +github.com/hashicorp/terraform-plugin-log/internal/logging +github.com/hashicorp/terraform-plugin-log/tflog +github.com/hashicorp/terraform-plugin-log/tfsdklog +# github.com/hashicorp/terraform-plugin-sdk/v2 v2.16.0 ## explicit github.com/hashicorp/terraform-plugin-sdk/v2/diag +github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation @@ -114,12 +122,18 @@ github.com/hashicorp/terraform-plugin-sdk/v2/internal/addrs github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/configschema github.com/hashicorp/terraform-plugin-sdk/v2/internal/configs/hcl2shim github.com/hashicorp/terraform-plugin-sdk/v2/internal/helper/hashcode +github.com/hashicorp/terraform-plugin-sdk/v2/internal/logging github.com/hashicorp/terraform-plugin-sdk/v2/internal/plans/objchange github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfdiags github.com/hashicorp/terraform-plugin-sdk/v2/meta github.com/hashicorp/terraform-plugin-sdk/v2/plugin github.com/hashicorp/terraform-plugin-sdk/v2/terraform +# github.com/hashicorp/terraform-registry-address v0.0.0-20220510144317-d78f4a47ae27 +## explicit +github.com/hashicorp/terraform-registry-address +# github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 +github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 ## explicit github.com/hashicorp/yamux @@ -135,15 +149,13 @@ github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.14 github.com/mattn/go-isatty # github.com/mitchellh/copystructure v1.2.0 -## explicit github.com/mitchellh/copystructure # github.com/mitchellh/go-testing-interface v1.14.1 -## explicit github.com/mitchellh/go-testing-interface # github.com/mitchellh/go-wordwrap v1.0.1 ## explicit github.com/mitchellh/go-wordwrap -# github.com/mitchellh/mapstructure v1.4.3 +# github.com/mitchellh/mapstructure v1.5.0 github.com/mitchellh/mapstructure # github.com/mitchellh/reflectwalk v1.0.2 github.com/mitchellh/reflectwalk @@ -156,7 +168,7 @@ github.com/oklog/ulid github.com/opentracing/opentracing-go github.com/opentracing/opentracing-go/ext github.com/opentracing/opentracing-go/log -# github.com/smutel/go-netbox v3.0.1+incompatible +# github.com/smutel/go-netbox v3.1.0+incompatible ## explicit github.com/smutel/go-netbox/netbox/client github.com/smutel/go-netbox/netbox/client/circuits @@ -167,12 +179,20 @@ github.com/smutel/go-netbox/netbox/client/status github.com/smutel/go-netbox/netbox/client/tenancy github.com/smutel/go-netbox/netbox/client/users github.com/smutel/go-netbox/netbox/client/virtualization +github.com/smutel/go-netbox/netbox/client/wireless github.com/smutel/go-netbox/netbox/models # github.com/vmihailenco/msgpack v4.0.4+incompatible github.com/vmihailenco/msgpack github.com/vmihailenco/msgpack/codes -# github.com/zclconf/go-cty v1.10.0 +# github.com/vmihailenco/msgpack/v4 v4.3.12 +github.com/vmihailenco/msgpack/v4 +github.com/vmihailenco/msgpack/v4/codes +# github.com/vmihailenco/tagparser v0.1.2 ## explicit +github.com/vmihailenco/tagparser +github.com/vmihailenco/tagparser/internal +github.com/vmihailenco/tagparser/internal/parser +# github.com/zclconf/go-cty v1.10.0 github.com/zclconf/go-cty/cty github.com/zclconf/go-cty/cty/convert github.com/zclconf/go-cty/cty/function @@ -180,7 +200,7 @@ github.com/zclconf/go-cty/cty/function/stdlib github.com/zclconf/go-cty/cty/gocty github.com/zclconf/go-cty/cty/json github.com/zclconf/go-cty/cty/set -# go.mongodb.org/mongo-driver v1.8.4 +# go.mongodb.org/mongo-driver v1.9.1 ## explicit go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/bson/bsoncodec @@ -189,7 +209,7 @@ go.mongodb.org/mongo-driver/bson/bsonrw go.mongodb.org/mongo-driver/bson/bsontype go.mongodb.org/mongo-driver/bson/primitive go.mongodb.org/mongo-driver/x/bsonx/bsoncore -# golang.org/x/net v0.0.0-20220225172249-27dd8689420f +# golang.org/x/net v0.0.0-20220516155154-20f960328961 ## explicit golang.org/x/net/context golang.org/x/net/http/httpguts @@ -198,7 +218,7 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 +# golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a ## explicit golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix @@ -207,7 +227,6 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -golang.org/x/text/width # google.golang.org/appengine v1.6.7 ## explicit google.golang.org/appengine @@ -221,10 +240,10 @@ google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api -# google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 +# google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 ## explicit google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.45.0 +# google.golang.org/grpc v1.46.2 ## explicit google.golang.org/grpc google.golang.org/grpc/attributes @@ -234,6 +253,7 @@ google.golang.org/grpc/balancer/base google.golang.org/grpc/balancer/grpclb/state google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/binarylog/grpc_binarylog_v1 +google.golang.org/grpc/channelz google.golang.org/grpc/codes google.golang.org/grpc/connectivity google.golang.org/grpc/credentials @@ -245,6 +265,7 @@ google.golang.org/grpc/health google.golang.org/grpc/health/grpc_health_v1 google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff +google.golang.org/grpc/internal/balancer/gracefulswitch google.golang.org/grpc/internal/balancerload google.golang.org/grpc/internal/binarylog google.golang.org/grpc/internal/buffer @@ -256,6 +277,7 @@ google.golang.org/grpc/internal/grpcrand google.golang.org/grpc/internal/grpcsync google.golang.org/grpc/internal/grpcutil google.golang.org/grpc/internal/metadata +google.golang.org/grpc/internal/pretty google.golang.org/grpc/internal/resolver google.golang.org/grpc/internal/resolver/dns google.golang.org/grpc/internal/resolver/passthrough @@ -275,13 +297,15 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -# google.golang.org/protobuf v1.27.1 +# google.golang.org/protobuf v1.28.0 +google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire google.golang.org/protobuf/internal/descfmt google.golang.org/protobuf/internal/descopts google.golang.org/protobuf/internal/detrand google.golang.org/protobuf/internal/encoding/defval +google.golang.org/protobuf/internal/encoding/json google.golang.org/protobuf/internal/encoding/messageset google.golang.org/protobuf/internal/encoding/tag google.golang.org/protobuf/internal/encoding/text